Author Topic: Detecting Mac-problematic XMP in PNG files?  (Read 1240 times)

ShipSkip

  • Newbie
  • *
  • Posts: 4
Detecting Mac-problematic XMP in PNG files?
« on: August 13, 2016, 05:00:59 PM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16681
    • ExifTool Home Page
Re: Detecting Mac-problematic XMP in PNG files?
« Reply #1 on: August 13, 2016, 07:54:20 PM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

ShipSkip

  • Newbie
  • *
  • Posts: 4
Re: Detecting Mac-problematic XMP in PNG files?
« Reply #2 on: August 17, 2016, 11:42:38 AM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16681
    • ExifTool Home Page
Re: Detecting Mac-problematic XMP in PNG files?
« Reply #3 on: August 17, 2016, 12:39:11 PM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).