Skip to content

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]

@hugovk hugovk merged commit 2b39f75 into python-pillow:main Jun 30, 2025
63 of 64 checks passed
@radarhere radarhere deleted the iptc branch June 30, 2025 12:31
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

2 participants