Page MenuHomePhabricator

[in bawolff's img_metadata branch] XMP parse error on files that incorrectly use an unordered array for creator's list
Closed, ResolvedPublic

Description

Author: a.fiedler

Description:
JpegHandler::getMetadata: XMP parse error: exception 'Exception' with message 'Expected <rdf:Seq> but got http://www.w3.org/1999/02/22-rdf-syntax-ns# Bag.' in ...\XMP.php:636

File:

http://svn.wikimedia.org/viewvc/mediawiki/branches/img_metadata/phase3/includes/media/XMP.php?view=markup

XMP Meta Data:

<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.2-c020 1.124078, Tue Sep 11 2007 23:21:40 ">
<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:exif="http://ns.adobe.com/exif/1.0/"
  xmlns:xap="http://ns.adobe.com/xap/1.0/"
  xmlns:aux="http://ns.adobe.com/exif/1.0/aux/"
  xmlns:xapRights="http://ns.adobe.com/xap/1.0/rights/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"
  xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/"
  xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
 tiff:Make="Canon"
 tiff:Model="Canon EOS 450D"
 tiff:ImageWidth="1000"
 tiff:ImageLength="667"
 tiff:XResolution="72/1"
 tiff:YResolution="72/1"
 tiff:ResolutionUnit="2"
 exif:ExifVersion="0221"
 exif:ExposureTime="1/100"
 exif:ShutterSpeedValue="6643856/1000000"
 exif:FNumber="4/1"
 exif:ApertureValue="4/1"
 exif:ExposureProgram="3"
 exif:DateTimeOriginal="2010-04-11T10:59:01.03+02:00"
 exif:DateTimeDigitized="2010-04-11T10:59:01.03+02:00"
 exif:ExposureBiasValue="0/1"
 exif:MaxApertureValue="3/1"
 exif:SubjectDistance="236/100"
 exif:MeteringMode="5"
 exif:FocalLength="20/1"
 exif:CustomRendered="0"
 exif:ExposureMode="0"
 exif:WhiteBalance="0"
 exif:SceneCaptureType="0"
 exif:FocalPlaneXResolution="4272000/878"
 exif:FocalPlaneYResolution="2848000/584"
 exif:FocalPlaneResolutionUnit="2"
 exif:PixelXDimension="1000"
 exif:PixelYDimension="667"
 xap:ModifyDate="2011-01-25T21:45:07+01:00"
 xap:CreateDate="2010-04-11T10:59:01.03+02:00"
 xap:MetadataDate="2011-01-25T21:29:29+01:00"
 xap:Label="Lila"
 xap:CreatorTool="Adobe Photoshop Lightroom 3.3"
 aux:SerialNumber="680256520"
 aux:LensInfo="17/1 55/1 0/0 0/0"
 aux:Lens="EF-S17-55mm f/2.8 IS USM"
 aux:LensID="240"
 aux:ImageNumber="0"
 aux:FlashCompensation="0/1"
 aux:OwnerName="Andre Fiedler"
 aux:Firmware="1.1.0"
 xapRights:Marked="True"
 Iptc4xmpCore:Location="Leipzig"
 crs:Version="6.3"
 crs:ProcessVersion="5.7"
 crs:WhiteBalance="Custom"
 crs:Temperature="7043"
 crs:Tint="+20"
 crs:Exposure="0.00"
 crs:Shadows="9"
 crs:Brightness="+59"
 crs:Contrast="+2"
 crs:Saturation="+29"
 crs:Sharpness="25"
 crs:LuminanceSmoothing="30"
 crs:ColorNoiseReduction="25"
 crs:ChromaticAberrationR="0"
 crs:ChromaticAberrationB="0"
 crs:VignetteAmount="0"
 crs:ShadowTint="0"
 crs:RedHue="0"
 crs:RedSaturation="0"
 crs:GreenHue="0"
 crs:GreenSaturation="0"
 crs:BlueHue="0"
 crs:BlueSaturation="0"
 crs:FillLight="30"
 crs:Vibrance="-46"
 crs:HighlightRecovery="25"
 crs:Clarity="-23"
 crs:Defringe="0"
 crs:HueAdjustmentRed="0"
 crs:HueAdjustmentOrange="0"
 crs:HueAdjustmentYellow="0"
 crs:HueAdjustmentGreen="0"
 crs:HueAdjustmentAqua="0"
 crs:HueAdjustmentBlue="0"
 crs:HueAdjustmentPurple="0"
 crs:HueAdjustmentMagenta="0"
 crs:SaturationAdjustmentRed="0"
 crs:SaturationAdjustmentOrange="0"
 crs:SaturationAdjustmentYellow="0"
 crs:SaturationAdjustmentGreen="0"
 crs:SaturationAdjustmentAqua="0"
 crs:SaturationAdjustmentBlue="0"
 crs:SaturationAdjustmentPurple="0"
 crs:SaturationAdjustmentMagenta="0"
 crs:LuminanceAdjustmentRed="0"
 crs:LuminanceAdjustmentOrange="0"
 crs:LuminanceAdjustmentYellow="0"
 crs:LuminanceAdjustmentGreen="0"
 crs:LuminanceAdjustmentAqua="0"
 crs:LuminanceAdjustmentBlue="0"
 crs:LuminanceAdjustmentPurple="0"
 crs:LuminanceAdjustmentMagenta="0"
 crs:SplitToningShadowHue="0"
 crs:SplitToningShadowSaturation="0"
 crs:SplitToningHighlightHue="0"
 crs:SplitToningHighlightSaturation="0"
 crs:SplitToningBalance="0"
 crs:ParametricShadows="-30"
 crs:ParametricDarks="-15"
 crs:ParametricLights="+15"
 crs:ParametricHighlights="+8"
 crs:ParametricShadowSplit="25"
 crs:ParametricMidtoneSplit="50"
 crs:ParametricHighlightSplit="75"
 crs:SharpenRadius="+1.0"
 crs:SharpenDetail="25"
 crs:SharpenEdgeMasking="0"
 crs:PostCropVignetteAmount="-17"
 crs:PostCropVignetteMidpoint="50"
 crs:PostCropVignetteFeather="50"
 crs:PostCropVignetteRoundness="0"
 crs:PostCropVignetteStyle="1"
 crs:PostCropVignetteHighlightContrast="0"
 crs:GrainAmount="0"
 crs:LuminanceNoiseReductionDetail="50"
 crs:ColorNoiseReductionDetail="50"
 crs:LuminanceNoiseReductionContrast="0"
 crs:LensProfileEnable="1"
 crs:LensManualDistortionAmount="0"
 crs:PerspectiveVertical="0"
 crs:PerspectiveHorizontal="0"
 crs:PerspectiveRotate="0.0"
 crs:PerspectiveScale="100"
 crs:ConvertToGrayscale="False"
 crs:ToneCurveName="Medium Contrast"
 crs:CameraProfile="Adobe Standard"
 crs:CameraProfileDigest="162E063AD6FEDE4357249927BD89FB79"
 crs:LensProfileSetup="LensDefaults"
 crs:LensProfileName="Adobe (Canon EF-S 17-55mm f/2.8 IS USM)"
 crs:LensProfileFilename="Canon EOS 50D (Canon EF-S 17-55mm f2.8 IS USM) - RAW.lcp"
 crs:LensProfileDigest="BFADFF3EBFE5233D5F5D3CB628ABE6DC"
 crs:LensProfileDistortionScale="100"
 crs:LensProfileChromaticAberrationScale="100"
 crs:LensProfileVignettingScale="100"
 crs:HasSettings="True"
 crs:HasCrop="False"
 crs:AlreadyApplied="True"
 photoshop:LegacyIPTCDigest="BC392F15FD12685E8C5D19D449D4F24C">
 <exif:ISOSpeedRatings>
  <rdf:Seq>
   <rdf:li>200</rdf:li>
  </rdf:Seq>
 </exif:ISOSpeedRatings>
 <exif:Flash
  exif:Fired="False"
  exif:Return="0"
  exif:Mode="2"
  exif:Function="False"
  exif:RedEyeMode="False"/>
 <dc:creator>
  <rdf:Bag>
   <rdf:li>André Fiedler</rdf:li>
  </rdf:Bag>
 </dc:creator>
 <dc:rights>
  <rdf:Alt>
   <rdf:li xml:lang="x-default">André Fiedler, 2010</rdf:li>
  </rdf:Alt>
 </dc:rights>
 <dc:subject>
  <rdf:Bag>
   <rdf:li>AMI Messe Leipzig 2010</rdf:li>
  </rdf:Bag>
 </dc:subject>
 <crs:ToneCurve>
  <rdf:Seq>
   <rdf:li>0, 0</rdf:li>
   <rdf:li>32, 22</rdf:li>
   <rdf:li>64, 56</rdf:li>
   <rdf:li>128, 128</rdf:li>
   <rdf:li>192, 196</rdf:li>
   <rdf:li>255, 255</rdf:li>
  </rdf:Seq>
 </crs:ToneCurve>
</rdf:Description>

</rdf:RDF>
</x:xmpmeta>


Version: unspecified
Severity: minor

Details

Reference
bz27105

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:22 PM
bzimport set Reference to bz27105.

Thanks for reporting this. I'll try to make sure a developer looks at this.

First off, yay! people are testing things from my branch!

Just to clarify, is this from the debug output, or are you seeing this as an error message. In the case of invalid XMP metadata, it is supposed to dump a whole bunch of stuff to the debug output, but show no error message to the user, and generally behave as if there was no metadata for the file. The ordinary user should not be able to see that message.

On to the actual issue. It rejects the file, because the xmp data actually is invalid. According to the standard ( http://www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMPSpecificationPart1.pdf ), the list of creators must be an ordered list (with primary/most important author first).

However, this isn't the first file I've heard of that incorrectly uses an unordered list for creators. Presumably there's a broken xmp encoder somewhere. It might be a good idea to be lax on the ordered vs unordered distinction instead of just rejecting the metadata.

a.fiedler wrote:

Hey, thx that you took the time looking into this.

No, this isn´t a debug output. I´ve used your XMP Parser stand alone. The XMP above is copied directly from the JPG file.

The file was exported using Adobe Photoshop Lightroom v3.3. Thats bad to see, that Adobe doesn´t follow it´s own standards. :(

Think it would be a good idea to not be so strict on the standard. Uncomplete data or data in the wrong order is better than no data at all. ;o)

Wow, that's even awesomer you're using it stand alone for some other project.

Yeah it is kind of weird that adobe makes a standard, then doesn't follow it. Anyways, fixed as of r82051.

Gilles raised the priority of this task from Medium to Unbreak Now!.Dec 4 2014, 10:29 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Medium.Dec 4 2014, 11:23 AM