PNG files and XMP metadata

*** Please report new bugs here! ***

Moderators: helmut, xnview, Dreamer

insanetesterftw
Posts: 2
Joined: Thu Feb 26, 2015 12:17 pm

PNG files and XMP metadata

Post by insanetesterftw »

XnViewMP writes XMP metadata in PNG files in the incorrect chunk, in the tEXt instead of iTXt, causing bad interaction with other applications which might lead to file corruption or loss of metadata.

EXAMPLE

I used two applications to write metadata to a PNG file: XnViewMP and Daminion.

The first example is from Daminion:

Code: Select all

iTXtXML:com.adobe.xmp     <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.4.0">
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about=""
    xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
    xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
    xmlns:exif="http://ns.adobe.com/exif/1.0/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:xmp="http://ns.adobe.com/xap/1.0/"
   tiff:Orientation="1"
   photoshop:DateCreated="2015-02-23T02:09:39"
   exif:DateTimeOriginal="2015-02-23T02:09:39"
   xmp:MetadataDate="2015-02-26T12:45:18"
   xmp:ModifyDate="2015-02-26T12:45:18">
   <dc:description>
    <rdf:Alt>
     <rdf:li xml:lang="x-default">Daminion EXAMPLE DESCRIPTION</rdf:li>
    </rdf:Alt>
   </dc:description>
  </rdf:Description>
 </rdf:RDF>
</x:xmpmeta>
<?xpacket end="r"?>
The second example is from XnViewMP Version 0.72 x64 (Dec 19 2014):

Code: Select all

tEXtXML:com.adobe.xmp <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.1.2">
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about=""
            xmlns:dc="http://purl.org/dc/elements/1.1/">
         <dc:description>XnViewMP EXAMPLE DESCRIPTION</dc:description>
      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>
And this is how XnViewMP shows it:
Screenshot - 26-02-2015 , 12_47_08.png
XnViewMP also appears to be using an old version Adobe's XMPCore. The most recent is 2014.12. http://www.adobe.com/devnet/xmp.html

Thank you.
You do not have the required permissions to view the files attached to this post.
User avatar
xnview
Author of XnView
Posts: 46957
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: PNG files and XMP metadata

Post by xnview »

could you send me an example of png with iTxt chunk?
Pierre.
insanetesterftw
Posts: 2
Joined: Thu Feb 26, 2015 12:17 pm

Re: PNG files and XMP metadata

Post by insanetesterftw »

I hope that posting here as an attachment is enough.
You do not have the required permissions to view the files attached to this post.
User avatar
xnview
Author of XnView
Posts: 46957
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: PNG files and XMP metadata

Post by xnview »

See Issue 621 for current status and details.

iTXt is better to save XMP??
Pierre.
User avatar
XnTriq
Forum Librarian
Posts: 6519
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: PNG files and XMP metadata

Post by XnTriq »

Wikipedia (Portable Network Graphics » [url=http://en.wikipedia.org/wiki/Portable_Network_Graphics#Ancillary_chunks]Ancillary chunks[/url]) wrote:iTXt contains UTF-8 text, compressed or not, with an optional language tag. iTXt chunk with the keyword 'XML:com.adobe.xmp' can contain Extensible Metadata Platform (XMP).
Adobe ([url=http://www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/cs6/XMPSpecificationPart3.pdf]XMP Specification Part 3[/url] of April 2012 » Embedding XMP metadata in application files » PNG) wrote:An XMP packet is embedded in a PNG graphic file by adding a chunk of type iTXt. This chunk is semantically equivalent to the tEXt and zTXt chunks, but the textual data is in the UTF-8 encoding of the Unicode character set, instead of Latin-1.

The Chunk Data portion is the XMP packet. The packet must be marked as read-only. XMP software that is not aware of the file format must not be allowed to change the content of the XMP packet because of the CRC checksum following the chunk data.

There should be no more than one chunk containing XMP in each PNG file. Encoders are encouraged to place the chunk at the beginning of the file, but this is not required.

The PNG data format is shown in Table 9.