Skip to content

Handle IPTC TIFF tags with incorrect type #8925

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

radarhere
Copy link
Member

Resolves #8923

#8315 replaced im.tag.tagdata[TiffImagePlugin.IPTC_NAA_CHUNK] with im.tag_v2[TiffImagePlugin.IPTC_NAA_CHUNK], but didn't think to ask why .tagdata was used, rather than just im.tag[TiffImagePlugin.IPTC_NAA_CHUNK]. The answer would have been in this comment.

# get raw data from the IPTC/NAA tag (PhotoShop tags the data
# as 4-byte integers, so we cannot use the get method...)

This would have been referring to the same phenomenon as https://web.archive.org/web/20240221164915/https://www.awaresystems.be/imaging/tiff/tifftags/iptc.html

Often times, the datatype is incorrectly specified as LONG.

This fixes the issue by switching to im.tag_v2._tagdata[TiffImagePlugin.IPTC_NAA_CHUNK]

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.

getiptcinfo() fails to get iptc metadata for TIFF images
1 participant