From 5e54bb45368026b112beea1acef21269d1e189ec Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 23 Dec 2022 19:54:09 -0800 Subject: [PATCH] Call rotate_by_exif before taking image dimensions. --- resize.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resize.py b/resize.py index f5d55b0..f0e9bc4 100644 --- a/resize.py +++ b/resize.py @@ -32,6 +32,7 @@ def resize( file = pathclass.Path(filename) image = PIL.Image.open(file.absolute_path) + (image, exif) = imagetools.rotate_by_exif(image) (image_width, image_height) = image.size @@ -109,7 +110,7 @@ def resize( if output_file.extension == '.jpg': image = image.convert('RGB') - image.save(output_file.absolute_path, exif=image.getexif(), quality=quality) + image.save(output_file.absolute_path, exif=exif, quality=quality) return output_file def resize_argparse(args):