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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user