PNG images / XMP metadata

Started by SamiM, March 05, 2011, 11:53:50 AM

Previous topic - Next topic

SamiM

I have been developing new metadata tools for the Qt framework for a while and I thought that I could use ExifTool to write XMP metadata to PNG images.

However, it seems that the application violates the XMP specification and it also seems that the application contains a bug.

1. The XMP specification indicates that the iTXt chunk which includes the XMP metadata must begin with the keyword and followed by the compression flag and method and two null separators. However, the it seems that the XMP metadata start immediately after the keyword.

2. The XMP metadata is not encoded as UTF-8. The XML parser of the Qt framework fails immediately and generates the following error message:

"Encountered incorrectly encoded content."

The error message indicates that the XMP metadata is not encoded as UTF-8.

Phil Harvey

I think you will find that exiftool writes XMP correctly to PNG.  Specifically:

1) ExifTool does write the compression flag and method (both zero) for an iTxt chunk.

2) ExifTool does write UTF-8 encoded XMP

I suggest that your other software and/or your analysis technique is flawed.  However, I am happy to fix any problems you find if you can convince me otherwise.

Also, what version of ExifTool are you using?  Make sure it is relatively up-to-date.

- 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 ($).

SamiM

#2
How about null separators? Does ExifTool write any null separators?

Indeed there are the compression flag and method fields, but it seems that the XML parser of the Qt framework still cannot decode the XML data. This issue might be a bug in the Qt framework as well, but I want to be sure about this issue.

For some reason the XML parser seems to operate without any problems with all the other files, but files which have been created with ExifTool always lead to an error.

SamiM

It seems that the null separators are there as well and everything is according to the XMP specification.

It seems that there is a bug in the Qt framework, because when I loaded the XMP metadata to a string instead of reading it from a file, there were no problems at all.

Thanks for help, it seems that ExifTool is indeed writing the XMP metadata correctly.