Closed homm closed 2 months ago
There is no conflict between the presence of eXIf chunks in PNG files and the goal of "having the same size after opening as after loading," because when loading a PNG (by calling the .load()
method or any dependent method), the Exif data is populated, but the image is not automatically rotated. This differs from the behavior of TIFF, where calling .load()
actually rotates the image and can change its size. This is exactly the issue I aim to address in this PR.
Ah, I see now, thanks.
I think introducing the idea that im.size
might not match im._size
complicates things. How about #8390 instead?
Closed in favour of https://github.com/python-pillow/Pillow/pull/8390.
This PR was created in an effort to ensure that
load()
does not change the size of an image.It naturally sounds like a good idea for images to have the same size after opening as after loading. However, Pillow also aims to open an image without loading it, for the sake of performance, and the rotation data might not appear early on in the file.
For the PNG format, https://ftp-osl.osuosl.org/pub/libpng/documents/pngext-1.5.0.html#C.eXIf states
So I don't think it is possible to simultaneously achieve those two goals.