Skip to content

Commit

Permalink
LOL: re-download empty thumbnail files
Browse files Browse the repository at this point in the history
  • Loading branch information
Theverat committed Jul 25, 2020
1 parent b6f9e22 commit b7c46ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/lol/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,8 @@ def load_previews(context, assets):
imgname = previmg_name(i)

asset["thumbnail"] = imgname
if os.path.exists(tpath):
# Sometimes empty files are created - possibly failed downloads? Re-download in this case.
if os.path.exists(tpath) and os.path.getsize(tpath) > 0:
img = bpy.data.images.get(imgname)

if img is None or img.size[0] == 0:
Expand Down

0 comments on commit b7c46ab

Please sign in to comment.