Skip to content

Conversation

@radarhere
Copy link
Member

Looking at

self.tile = [
("iptc", (compression, offset), (0, 0, self.size[0], self.size[1]))
]

I find this odd, as it does not match the structure that we otherwise have for self.tile.
class _Tile(NamedTuple):
encoder_name: str
extents: tuple[int, int, int, int]
offset: int
args: tuple | str | None

self.tile = [("jpeg", (0, 0) + self.size, 0, (rawmode, ""))]

The reason this problem has not been found by the test suite is that no test actually opens a valid IPTC image.

This PR changes the self.tile tuple to match the format used in other plugins.

self.tile = [("iptc", (0, 0) + self.size, offset, compression)]

I've reversed-engineered test data for _open from the code.

@hugovk hugovk merged commit da61ed1 into python-pillow:main Dec 31, 2023
@radarhere radarhere deleted the iptc branch January 1, 2024 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants