Getting tags in sync on PNG files - adding IPTC tags throw error

Started by Velo145, January 14, 2024, 06:08:34 PM

Previous topic - Next topic

Velo145

I have gathered the commands to add the copyright-related metadata that's primary function is for Google image search to read and add Licensable and (in beta) AI-generated badges to images - in my case, PNG images.

When I run the following, I get the error, Warning: [minor] Creating non-standard IPTC in PNG for every PNG image in the directory:

exiftool -r -all= -tagsfromfile @ -xmp-photoshop:DateCreated -overwrite_original \
-ifd0:ImageDescription='DESCRIPTION' \
-ifd0:Copyright='COPYRIGHT © YEAR-NAME' \
-xmp-dc:rights='COPYRIGHT © YEAR-NAME' \
-xmp-dc:Creator='CREATOR' \
-xmp-photoshop:Credit='CREDIT-TO' \
-xmp-xmprights:WebStatement='HTTPS://URL.COM/LANDING' \
-xmp-plus:LicensorName='LICENSOR' \
-xmp-plus:LicensorURL='HTTPS://URL.COM' \
-xmp-iptcExt:DigitalSourceType='IPTC-NEWSCODE-FOR-AI-TYPE' \
-xmp-dc:Description='DESCRIPTION' \
-iptc:By-Line='Happy Vito' \
-iptc:Caption-Abstract='DESCRIPTION' \
-iptc:CopyrightNotice='COPYRIGHT © YEAR-NAME' \
-iptc:Credit='CREDIT' \
~/TO/MY/DIRECTORY

I have poked around this forum and found that the PNG spec doesn't allow for the EXIF block, as StarGeek wrote in another post:

QuoteThe post I linked says exiftool stores "EXIF information in a PNG "Raw profile type APP1" zTXt chunk".  This is non-standard and Exiftool will warn you as such when it first tries to add an EXIF tag to the png (Warning: [minor] Creating non-standard EXIF in PNG).

It is a complete EXIF block and can even include things such as MakerNotes.  But the PNG spec doesn't allow for the EXIF block.  So it's not the EXIF block that's non-standard, it's the insertion of the EXIF block into the PNG which is non-standard.

If I delete the four IPTC tags from the above command, the error goes away. However, when I view the file with IPTC's Get Photo Metadata online tool, it then says that multiple tags are NOTsync1 and the copyright tag (from ifd0:Copyright or xmp-dc:rights) doesn't show up at all. It only shows up (and is in sync) if the iptc:CopyrightNotice tag is also added.

I know this IPTC Get Photo Metadata online tool is actually utilizing Exiftool, but I like when it shows that I have all the necessary tags for Google image search licenses (and that they're in sync), but then I am getting an error from exiftool.

For my case, it seems best to proceed with adding the IPTC tags. But, I have about 60,000 PNG images to add them to. That's a lot of error messages coming across my Terminal screen. I would think it also slows it down significantly? So far, I've only tested on a hundred. Is there any way around this error?

Thanks.

StarGeek

Quote from: Velo145 on January 14, 2024, 06:08:34 PMI have poked around this forum and found that the PNG spec doesn't allow for the EXIF block, as StarGeek wrote in another post:

That post hast to be at least 6½+ years old, as EXIF data was added to the PNG spec mid-2017.

However, the older IPTC IIM/Legacy standard is still non-standard in PNG files, as per the warning you get. This is extremely unlikely to change, as the IPTC IIM standard dates from the 90s and any new tags that have been created by the IPTC Photo Metadata Standard appear only in the XMP group, not in IPTC.

QuoteHowever, when I view the file with IPTC's Get Photo Metadata online tool, it then says that multiple tags are NOTsync1 and the copyright tag (from ifd0:Copyright or xmp-dc:rights) doesn't show up at all. It only shows up (and is in sync) if the iptc:CopyrightNotice tag is also added.

The EXIF tag isn't going to show up at all because there are no EXIF tags in the IPTC standard.  I'm not sure why it isn't listing the copyright notice when it only appears in XMP:Rights.  That's most likely a problem with the script they are using.

It looks like tags are only in-sync if they have the matching IPTC tags.  Which I really wouldn't worry about.  About the only program that's going to read IPTC tags in a PNG is exiftool, maybe ImageMagick and exiv2. And Google should be fine reading only XMP tags.  I would think it's highly unlikely that Google would be reading IPTC tags in a PNG unless they are using exiftool.

I should point out that some of your tags are getting a NOTsync1 result because you are writing different values to the tags. You are writing "Happy Vito," to By-Line but "CREATOR" to Creator.

QuoteFor my case, it seems best to proceed with adding the IPTC tags.

Personally, I suggest ditching them altogether.  Google is going to read the XMP tags and trying to keep things in sync is a PITA that's best avoided.

QuoteBut, I have about 60,000 PNG images to add them to. That's a lot of error messages coming across my Terminal screen. I would think it also slows it down significantly? So far, I've only tested on a hundred. Is there any way around this error?

Add the -m (-ignoreMinorErrors) option option.  This will also take care of the problem that IPTC IIM tags have a character limit and will be truncated by exiftool without this option (see third paragraph on the IPTC tags page.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Velo145

Appreciate the knowledge and explanation. Btw, I used the metadata of one of Getty Image's stock preview image to add the IPTC tags (and get everything in sync), which do include a copyright notice that the ITPC Get Metadata online tool picks up. I also thought it was just an error the tool has to not pick up the xmp:rights tag.

As it sounds like xmp is the new standard, I'll stick with that.

Thanks.