fix BUG-104 by only calling exif auto trans on jpegs, not all images

This commit is contained in:
2022-08-03 18:00:02 +10:00
parent a620024de6
commit b82d3107dc

View File

@@ -121,9 +121,13 @@ def SymlinkName(ptype, path, file):
def GenThumb(fname,auto_rotate):
try:
if auto_rotate:
# run cmdline util to re-orient jpeg (only changes if needed, and does it losslessly)
p = subprocess.run([PA_EXIF_ROTATER,fname] )
im=Image.open(fname)
im_orig = Image.open(fname)
if im_orig.format == 'JPEG':
# run cmdline util to re-orient jpeg (only changes if needed, and does it losslessly)
p = subprocess.run([PA_EXIF_ROTATER,fname] )
im=Image.open(fname)
else:
im=im_orig
# if we don't autorotate/touch the original, we still want the thumbnail oriented the right way
else:
im_orig = Image.open(fname)