be more explicit, only exif_transform jpegs, and if mode is not rgb convert it first before thumbnail - fixes BUG-63 no thumbs for GIFs

This commit is contained in:
2021-09-21 16:53:47 +10:00
parent 13aab072db
commit 6f17e1677d
2 changed files with 8 additions and 6 deletions

View File

@@ -113,9 +113,10 @@ def SymlinkName(ptype, path, file):
def GenThumb(fname):
try:
im_orig = Image.open(fname)
im = ImageOps.exif_transpose(im_orig)
bands = im.getbands()
if 'A' in bands:
if im_orig.format == 'JPEG':
im = ImageOps.exif_transpose(im_orig)
im = im_orig
if im.mode != "RGB":
im = im.convert('RGB')
orig_w, orig_h = im.size
im.thumbnail((THUMBSIZE,THUMBSIZE))