Hi,
I have a public XMP text file containing exif and tiff metadata: http://ns.adobe.com/exif/1.0/ and http://ns.adobe.com/tiff/1.0/.
I want to write these XMP data in an image file and it doesn't work. I don't get any exceptions, just the metadata are missing in the image file.
C#
using (var xmpFiles = new XmpFiles())
{
if (!xmpFiles.OpenFile("test.jpg", handler.FileFormat, OpenFlags.OpenForUpdate))
xmpFiles.OpenFile("test.jpg", FileFormat.Unknown, OpenFlags.OpenUsePacketScanning | OpenFlags.OpenForUpdate);
using (var xmpCore = new XmpCore())
{
xmpCore.ParseFromBuffer(xmpPublic.ToString(), ParseFlags.None);
if (xmpFiles.CanPutXmp(xmpCore))
xmpFiles.PutXmp(xmpCore);
}
xmpFiles.CloseFile(CloseFlags.None);
}
Public XMP:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description xmlns:_ns_2="http://ns.adobe.com/tiff/1.0/" rdf:about="">
<_ns_2:ImageLength>4252</_ns_2:ImageLength>
</rdf:Description>
<rdf:Description xmlns:_ns_3="http://ns.adobe.com/exif/1.0/" rdf:about="">
<_ns_3:ApertureValue>8/1</_ns_3:ApertureValue>
</rdf:Description>
</rdf:RDF>
Result XMP in image file:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""/>
</rdf:RDF>
Does anyone can help with that problem?
Thanks,
Alexandra