Project

General

Profile

Patch #699

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

Added by Joachim Gelhaus over 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Category:
xmp
Target version:
Start date:
28 Apr 2010
Due date:
% Done:

100%

Estimated time:

Description

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
Change:
if (XmpParser::encode(xmpPacket_, xmpData_) > 1) {
to:
if (XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting) > 1) {

Kind regards,
Joachim Gelhaus

Associated revisions

Revision 2206 (diff)
Added by Andreas Huggel over 9 years ago

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

History

#1

Updated by Andreas Huggel over 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 about 9 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF