IPTC vs Embedded XMP vs sidecar XMP

Ask for help and post your question on how to use XnView MP.

Moderators: XnTriq, xnview

Post Reply
User avatar
xnview
Author of XnView
Posts: 31733
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

IPTC vs Embedded XMP vs sidecar XMP

Post by xnview » Fri Mar 11, 2016 3:59 pm

if a file have IPTC keywords, XMP keywords and a XMP sidecar, what is the correct order to read metadata?

if sidecar => take sidecar XMP
else if XMP metadata => take XMP
else if IPTC metadata => take IPTC
Pierre.

User avatar
oops66
XnThusiast
Posts: 1999
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: IPTC vs Embedded XMP vs sidecar XMP

Post by oops66 » Sat Mar 12, 2016 2:18 am

xnview wrote:if a file have IPTC keywords, XMP keywords and a XMP sidecar, what is the correct order to read metadata?

if sidecar => take sidecar XMP
else if XMP metadata => take XMP
else if IPTC metadata => take IPTC
Hello Pierre,
Seems to be:
...
3.1 Read Algorithm:
From the above investigation, the read algorithm is quite simple. We just need to go through the markers, find and read the content of Exif APP1, XMP APP1, IPTC APP13 segments. Those segments all locate before the SOS segment (which is immediately followed by entropy-coded data) and often locate right after the SOI segment (not guaranteed). Hence, it’s not necessary to read the whole JPEG file to check whether the metadata exists or not; the process can be stopped whenever the marker SOS is found.
Image
3.2 Write Algorithm
The general idea for the write algorithm is to find Exif APP1, XMP APP1, IPTC APP13 segments, remove them from the JPEG file and replace them with the new metadata. To simplify this a bit, we agree the following rules (this is standard in most jpegs anyway).

The order of the Exif, XMP, IPTC segments in the output file (regardless of their positions in the input file)
SOI | (APP0) | (Exif App1) | (XMP App1) | (IPTC App13) | … | EOI
The COM segment is located just before SOFn in the output file (regardless of its position in the input file).

http://dev.exiv2.org/projects/exiv2/wik ... JPEG_files
XnViewMP 0.82 Linux X64 - Ubuntu 16.04 LTS - X64

User avatar
xnview
Author of XnView
Posts: 31733
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: IPTC vs Embedded XMP vs sidecar XMP

Post by xnview » Mon Mar 14, 2016 8:30 am

the sidecar is not here :)
Pierre.

User avatar
oops66
XnThusiast
Posts: 1999
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: IPTC vs Embedded XMP vs sidecar XMP

Post by oops66 » Mon Mar 14, 2016 12:19 pm

xnview wrote:the sidecar is not here :)
Right, so it is not very important ... the integrity of this sidecar file is not very secure. (in my point of view)
XnViewMP 0.82 Linux X64 - Ubuntu 16.04 LTS - X64

Post Reply