Increase flexibility when reading IPTC fields #7319
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #7318
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.tag[0]
Pillow/src/PIL/IptcImagePlugin.py
Line 67 in 52206c7
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.