Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed IPTC tile tuple to match other plugins #7661

Merged
merged 1 commit into from
Dec 31, 2023

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
55 of 56 checks passed
@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