Detecting Mac-problematic XMP in PNG files?

Started by ShipSkip, August 13, 2016, 05:00:59 PM

Previous topic - Next topic

ShipSkip

Regarding the problem with macOS ignoring "late" XMP info in PNG files - Topic 5347...

Suppose I have a PNG file and I'd like to know if it's going to be problematic on macOS. Is there an ExifTool command that can distinguish whether XMP blocks come before/after PNG IDAT? [More precisely: will ExifTool's output somehow expose XMP/IDAT ordering?]

Phil Harvey

Yes.  From the PNGEarlyXMP API option documentation:

When reading, this option causes a warning to be issued if standard XMP is found after the IDAT chunk.

So this command should do what you want:

exiftool -api pngearlyxmp -a -warning FILE

Then look for a warning that says "XMP found after PNG IDAT".

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

ShipSkip

Thanks for your response Phil. However, your recommended command isn't giving me the advertised results.

I have a file that I think has XMP-after-IDAT - see the attached 'ScanThenMogrify03.png'. TweakPNG shows this having several tEXt chunks after IDAT. Mac OS X Preview's 'Inspector' window doesn't display GPS metadata in this file.

I'm using ExifTool version 10.25 running on OS X 10.10.5.

My exact command:

exiftool -api pngearlyxmp -a -warning ScanThenMogrify03.png

Should I see an error message for this command and file? Thanks for any feedback or insight.

Phil Harvey

This file is fine, and shouldn't give a warning.  The XMP comes before the IDAT chunk.  The stuff written after the IDAT chunk isn't XMP.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).