You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tried to load image (attached below) and rotate it using image = ImageOps.exif_transpose(image)
Related to #4852 and #6123
What did you expect to happen?
Image rotated according to EXIF
What actually happened?
Processing failed with an error due to EXIF metadata being broken. Looking at exif information, I see it contains a duplicate Exif\x00\x00Exif\x00\x00 at the beginning. This image is uploaded by one of the clients, so I don't know how exactly that happened.
exiftool shows there is error with exif Warning : Malformed APP1 EXIF segment
What are your OS, Python and Pillow versions?
OS: MacOS
Python: 3.10
Pillow: 10.2.0
Please paste here the output of running:
Pillow 10.2.0
Python 3.10.14 (main, Mar 19 2024, 21:46:16) [Clang 15.0.0 (clang-1500.3.9.4)]
--------------------------------------------------------------------
Python modules loaded from /opt/homebrew/lib/python3.10/site-packages/PIL
Binary modules loaded from /opt/homebrew/lib/python3.10/site-packages/PIL
--------------------------------------------------------------------
--- PIL CORE support ok, compiled for 10.2.0
--- TKINTER support ok, loaded 8.6
--- FREETYPE2 support ok, loaded 2.13.3
--- LITTLECMS2 support ok, loaded 2.16
--- WEBP support ok, loaded 1.4.0
--- WEBP Transparency support ok
--- WEBPMUX support ok
--- WEBP Animation support ok
--- JPEG support ok, compiled for libjpeg-turbo 3.0.2
--- OPENJPEG (JPEG2000) support ok, loaded 2.5.2
--- ZLIB (PNG/ZIP) support ok, loaded 1.2.12
--- LIBTIFF support ok, loaded 4.6.0
*** RAQM (Bidirectional Text) support not installed
*** LIBIMAGEQUANT (Quantization method) support not installed
--- XCB (X protocol) support ok
This image is uploaded by one of the clients, so I don't know how exactly that happened.
If this is just a single image, not something that has happened repeatedly, is it possible to just accept that this is broken, and not something that Pillow needs to handle?
exiftool agrees that it is malformed, so it's not just us that think so.
This specific image, the only one you know of with this problem, isn't even transposed when the data is correctly parsed. The image retains its original orientation - meaning that just catching the error
There are actually 3 similar images with the same problem that were uploaded, I attached a single one for simplicity. I will add the try .. .except block logic, just wanted to push a workaround if anyone will meet same problem in the future
What did you do?
Tried to load image (attached below) and rotate it using
image = ImageOps.exif_transpose(image)
Related to #4852 and #6123
What did you expect to happen?
Image rotated according to EXIF
What actually happened?
Processing failed with an error due to EXIF metadata being broken. Looking at exif information, I see it contains a duplicate
Exif\x00\x00Exif\x00\x00
at the beginning. This image is uploaded by one of the clients, so I don't know how exactly that happened.b'Exif\x00\x00Exif\x00\x00II*\x00\x08\x00\x00\x00\x06\x00\x12\x01\x03\x00\x01\x00\x00\x00\x01\x00\x00\x00\x1a\x01\x05\x00\x01\x00\x00\x00V\x00\x00\x00\x1b\x01\x05\x00\x01\x00\x00\x00^\x00\x00\x00(\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\x00\x13\x02\x03\x00\x01\x00\x00\x00\x01\x00\x00\x00i\x87\x04\x00\x01\x00\x00\x00f\x00\x00\x00\x00\x00\x00\x00H\x00\x00\x00\x01\x00\x00\x00H\x00\x00\x00\x01\x00\x00\x00\x06\x00\x00\x90\x07\x00\x04\x00\x00\x000210\x01\x91\x07\x00\x04\x00\x00\x00\x01\x02\x03\x00\x00\xa0\x07\x00\x04\x00\x00\x000100\x01\xa0\x03\x00\x01\x00\x00\x00\xff\xff\x00\x00\x02\xa0\x04\x00\x01\x00\x00\x00\x08\x07\x00\x00\x03\xa0\x04\x00\x01\x00\x00\x00\x08\x07\x00\x00\x00\x00\x00\x00'
exiftool shows there is error with exif
Warning : Malformed APP1 EXIF segment
What are your OS, Python and Pillow versions?
Image itself
The text was updated successfully, but these errors were encountered: