From bcb8dfc2fa9011c99d6332d5b0aa00c82e1c6cdf Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 15 Apr 2023 22:30:18 +1000 Subject: [PATCH] Rearranged code --- src/PIL/ImageOps.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/PIL/ImageOps.py b/src/PIL/ImageOps.py index 460a21ce2..5dc34f442 100644 --- a/src/PIL/ImageOps.py +++ b/src/PIL/ImageOps.py @@ -622,9 +622,7 @@ def exif_transpose(image, inPlace=False): exif_image.info["XML:com.adobe.xmp"] = re.sub( pattern, "", exif_image.info["XML:com.adobe.xmp"] ) - if inPlace: - return - return transposed_image - if inPlace: - return - return image.copy() + if not inPlace: + return transposed_image + elif not inPlace: + return image.copy()