Empty XMP error when saving modified XMP metadata #3045
-
|
I'm writing a library to edit keyword metadata information in various image file types. It currently fails when adding new keywords to PNG files. The general outline of my editing process is:
Here is the part of my code which "appends" the new keywords and then creates a new XmProfile from the revised XDocument (which was obtained from the image after I loaded it): Unfortunately, when I use I compared the XDocument from the original file to one I derived from the revised one by reloading the image file after first saving it to disk with the revised Xmp data. In comparing the two XDocuments, the only obvious difference (other than the addition of some new rdf:li elements) is that the one derived from the revised image file has the following first line: I'm not sure, but this looks like a byte order mark followed by a "default" xml version/encoding element. It's not something that I added to the XDocument before I generated a new XmpProfile from it. Is this something that gets added to the XDocument when a new profile is assigned to Metadata.XmpProfile? If so, is there a way to prevent the addition? Or is there a better way to save a revised Xmp XDocument to the image? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
How are you saving the doc to disk? Using StreamWriter? |
Beta Was this translation helpful? Give feedback.
Sorry, I meant how are you saving the updated document. I think you would need to use something like this.