metadata-extractor
metadata-extractor copied to clipboard
Treat \0 as terminator in IPTC strings
The below image, when passed through exiftool, reads the IPTC Source
as "Getty Images North America".
When read with the IptcDirectory
we're getting "Getty Images ����
". On closer inspection it looks something more like: "Getty Images\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0005\u0000\u0000\u0000\n����
".
The null character is often used to denote the end of a string - is this being respected? Or not as it's not part of the standard?
From looking at the file in a hex editor, it seems that the Getty Images North America
string only exists in an IPTC segment and is extracted successfully:
[IPTC - 0x0273] Source = Getty Images North America
What's interesting in this file is that there are actually two IPTC segments. At a glance it seems that the segment with the target string exists within Photoshop data.
It's reasonable that the string you're referring to should treat the first null character as a terminator.