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

Increase flexibility when reading IPTC fields #7319

Merged
merged 3 commits into from
Oct 5, 2023

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Aug 4, 2023

Resolves #7318

  1. The issue has found an image where im.info["photoshop"][0x0404] appears to be zero padded. I've added a commit ignoring an IPTC field if it is only zero bytes, resolving the problem.
  2. A later post in the issue has found an image where tag[0]
    if s[0] != 0x1C or tag[0] < 1 or tag[0] > 9:

    is 240. This doesn't line up with page 12 (PDF page 12, not page 12 according to the footer) of http://www.iptc.org/std/IIM/4.1/specification/IIMV4.1.pdf, which lists 1 to 9. However, https://exiftool.org/TagNames/IPTC.html lists 240, making me think that this is a proprietary extension, rather than something mentioned in the format. I've adjusted the code to also accept 240 as a value.

@radarhere radarhere changed the title Ignore IPTC field that is only zero bytes Increase flexibility when reading IPTC fields Aug 22, 2023
@hugovk hugovk merged commit 0c55a2d into python-pillow:main Oct 5, 2023
@radarhere radarhere deleted the iptc branch October 5, 2023 21:25
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.

Inconsistent IPTC data retrieval: Failure with specific JPEG files
2 participants