Hi,
Can anybody help with geting XMP property from file? I need to get the date of picture shooting (exif:DateTimeOriginal). But while trying example from internet I'm stuck already on XMP file opening. Function XMPFile returns "Error 1000: XMP Exception: OpenFile returned false".
Here is a code sample:
var imageRef = File.openDialog("Please select File","All Files:*.*;");
loadXMPLibrary();
placeFile( imageRef ); //opens image as smart object
var myxmpFile = new XMPFile(decodeURI(imageRef), XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
var xmp = myxmpFile.getXMP();
var myXmp = xmp.serialize();
myxmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
Which file should be used as the first argument of XMPFile function? RAW format file, xmp, psd? Actually I tried to put all of them explicitly but no success.
Maybe there is another way to do my task, so here is a description of the final target.
I need to get the date of the picture that is included in PSD file as a layer. As I understood the only way to do it is to insert files as smart objects and assign this information to XMP property "userComment" of the layer.
It was an easy task to find example of SO insertion. But I can't solve the date reading problem.
PS CS6 is used if it matters.
Any help is appreciated.
Best regards,
Mike