Conversation
|
|
||
| @property | ||
| def size(self) -> tuple[int, int]: | ||
| if hasattr(self, "tag_v2"): |
There was a problem hiding this comment.
There is a cases after copying or pickling, when the class is actually TiffImageFile, but it is loaded and doesn't have tag_v2 attribute
| return super().load() | ||
|
|
||
| @property | ||
| def size(self) -> tuple[int, int]: |
There was a problem hiding this comment.
This implementation is differ from uploadcare@1d77bfe since for me it looks less magical, but if you can't agree, I can copy the previous as is
|
This PR was created in an effort to ensure that 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. |
|
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 |
|
Ah, I see now, thanks. I think introducing the idea that |
|
Closed in favour of #8390. |
No description provided.