I am writing some XMP metadata using a photoshop .jsx script using :
var xmp = new XMPMeta( activeDocument.xmpMetadata.rawData);
XMPMeta.registerNamespace(nameSpace, nsPrefix);
and then adding some data to this new namespace. I am able to view it in Photoshop by checking under File -> FileInfo
. My question is how can I access this data using the metadata extractor library in my c# project ? When I use the following code I do not see the new metadata I added inside any of the directories:
FileStream OriginalFile = new FileStream("C:\\Users\\av\\Desktop\\test.tif", FileMode.Open, FileAccess.Read, FileShare.Read);
IEnumerable<MetadataExtractor.Directory> directories = ImageMetadataReader.ReadMetadata(OriginalFile);
Edit: I am able to loop through all the properties but when I try to do
var xmpDirectory = ImageMetadataReader.ReadMetadata("path/test.tif").OfType<XmpDirectory>().FirstOrDefault();
xmpDirectory.XmpMeta.GetProperty("http://ns.adobe.com/xap/1.0/mm/xmpMM:DerivedForm/", "stRef:documentID")
I get an exception. The property is present when I look at it through Photoshop.