When no exif data was found we returned false, not the image

This commit is contained in:
2019-04-15 22:53:20 +02:00
parent 97ec6c22b0
commit c910b47dda

View File

@@ -52,7 +52,7 @@ def rotateFromExifMetadata(image):
exif = image._getexif()
except AttributeError as e:
print("Could not get exif - Bad image!")
return False
return image
(width, height) = image.size
if not exif:
@@ -71,9 +71,6 @@ def rotateFromExifMetadata(image):
if orientation in rotate_values:
# Rotate and return the picture
return image.rotate(rotate_values[orientation])
else:
if width > height:
return image.rotate(90)
return image