Patch #699

Padding of XMP data caused XMP JPEG segment is larger than 65535 bytes while writing metadata

Added by Joachim Gelhaus almost 9 years ago. Updated almost 9 years ago.

Status:ClosedStart date:28 Apr 2010
Priority:NormalDue date:
Assignee:Andreas Huggel% Done:


Target version:0.20


Due to the padding and newline characters of XmpParser::encode it can happen that the XMP data grows over the 64KByte limit.
Especially Adobe Lightroom seems to save the XMP data without any formating or padding. In my personal example image(which I cannot share;-) the XMP was 58900 Bytes and after reencoding it with XmpParser::encode it was about ~72000 Bytes.

The simple solution is to patch jpgimage.cpp
if (XmpParser::encode(xmpPacket_, xmpData_) > 1) {
if (XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting) > 1) {

Kind regards,
Joachim Gelhaus

Associated revisions

Revision 2206
Added by Andreas Huggel almost 9 years ago

#699: Omit all formatting whitespace when encoding XMP for JPEG. (Patch from Joachim Gelhaus)


#1 Updated by Andreas Huggel almost 9 years ago

  • Category set to xmp
  • Status changed from New to Resolved
  • Target version set to 0.20
  • % Done changed from 0 to 100

Thanks for the report and patch!

#2 Updated by Andreas Huggel almost 9 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux