From 8d3014b8bf94ee6d07276b227dfac4d6f7f5a859 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 15 Apr 2023 21:03:59 +1000 Subject: [PATCH] Added inPlace argument to exif_transpose() --- Tests/images/orientation_rectangle.jpg | Bin 0 -> 669 bytes Tests/test_imageops.py | 12 ++++++ src/PIL/ImageOps.py | 51 +++++++++++++++---------- 3 files changed, 42 insertions(+), 21 deletions(-) create mode 100644 Tests/images/orientation_rectangle.jpg diff --git a/Tests/images/orientation_rectangle.jpg b/Tests/images/orientation_rectangle.jpg new file mode 100644 index 0000000000000000000000000000000000000000..85cfbd0a813a1b36d64318ead4f0fe5a3258a51f GIT binary patch literal 669 zcmex=wh=DOELf4NWZ*Q!{f5ODks= zS2uSLPp{yR(6I1`$f)F$)U@=B%&g*)(z5c3%Btp;*0%PJ&aO$5r%atTea6gLixw|g zx@`H1m8&*w-m-Pu_8mKS9XfpE=&|D`PM*4S`O4L6*Kgds_3+W-Cr_U}fAR9w$4{TX zeEs(Q$Io9Ne=#yJL%anfAwEO%mmttzOe`$SEbJhEF*22dJTAz>s%Xe2([0-9])", ): - transposed_image.info["XML:com.adobe.xmp"] = re.sub( - pattern, "", transposed_image.info["XML:com.adobe.xmp"] + 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()