Copy link to clipboard
Copied
Has anyone come across or knows the solution to a problem?
There are two RAW files "1.NEF" and its full copy "1.NEF_".
The script throws an error with the original file extension.
ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
try {
var s = "C:\\1.NEF";
var file = new XMPFile(s, XMPConst.FILE_UNKNOWN, XMPConst.OPEN_FOR_READ);
alert(s + "\nOK!");
}
catch(e) { alert(s + "\n" + "WTF! " + e); }
try {
var s = "C:\\1.NEF_";
var file = new XMPFile(s, XMPConst.FILE_UNKNOWN, XMPConst.OPEN_FOR_READ);
alert(s + "\nOK!");
}
catch(e) { alert(s + "\nWTF! " + e); }
The error is present in CS6 - CC2018.
Is this a bug and, if so, is Adobe going to fix it?
Copy link to clipboard
Copied
You can try to ask where where Staff sometimes replies: XMP SDK (but I don't know it's related forum).
Copy link to clipboard
Copied
I can confirm the issue so it may be a bug indeed. I would recommend sending a bug report to Adobe.
I can't find photoshop.uservoice.com but there is a bridge one that may be close enough given that's xmp related:
Welcome to Bridge CC's Feature Request Page
Hopefully, people can upvote this and have this been fixed.
Copy link to clipboard
Copied
I found only one similar topic without an answer.
XMP from camera raw files: ACR SDK yes – but where from?
It looks like it's such a feature and no one will fix it.
Copy link to clipboard
Copied
You can refresh that topic, like posting link to this one. I noticed some staff members watch that forums. You may be lucky. You can also try on Photoshop Family Customer Community where staff always replies (at least from that I saw) to XMP questions, and if they consider it as bug they're going to log it for future fix.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
btw when I edit metadata by Photoshop (and save them) or Bridge of .raw file (by for example changing rating to one star) it creates .xmp file next to it. When then I remove .raw file or move it to other folder it's loosing its metadata as associated .xmp left in previous location.
How to make (especially having many .raw files) when I move them to other location, the .xmp files are going to be deleted automatically, or simply moved with associated .raw file? For now this is really annoying to see .xmp files left untouched - while I don't need them anymore, so I have always to remove them manually.
Copy link to clipboard
Copied
Are you using Bridge to move the files? As Bridge should move all associated files.
Copy link to clipboard
Copied
I know Bridge does that, but this time my goal is to do it without Bridge Anyway I will add to a script appropriate part.
Copy link to clipboard
Copied
Maybe I did not quite understand the question, but if you move raw files with a script, then what problems move the same xmp files?
It is also not clear how the question relates to the topic.
Can you change the metadata in the raw file with Photoshop? How and what specific data?
Copy link to clipboard
Copied
I was looking yestarday for a way how to add metadata to raw files, and then finished up in this topic where I got to know that's not possible because of bug. Then I wanted to find some workaround and most reasonable way to do comply was to do it the way it provided, so accepting there are separate .xmp files (if metadata indluded) next to appropriate .raw file. But then I found when I move files in Windows the .xmp remains in original folder, so I have to copy both .raw and .xmp at once or if I don't need that .xmp file then additionally to remove it manually. It's not related to this topic, but that was related to a problem I tried to sort out somehow. Well of course I'm going to take care of .xmp files by script, but I'm annoyed that when there are hundreds .raw files in different folders I can't simply manage them in Windows. I have either to use Bridge or write a script for if I want to be free, so not keeping in mind anything else that the core, so sole .raw files.
I'd like to ask the same question, why do we need .xmp files for .raw files, but not for converted ones, so for ex. .jpg files that have metadata included inside? The only what I noticed is that some metadata set to camera, like name of owner are added to .raw files, but ratings or labels, created surely later unfortunately not. Probably because only exif properties can be added.
Copy link to clipboard
Copied
It is a bit speculative, and would need verification…
One aspect is that Photoshop/Camera RAW treats RAW files as if they were read-only (even if the permissions would allow writing). This affects metadata, and for that reason, the metadata must be carried externally (in the .XMP file).
Another aspect is that Camera RAW writes many custom tags (crs: group) into the metadata. I can not confirm whether Photoshop/Camera RAW would be able to read those tags from the image file's metadata, and even more so writing them properly (even if it would treat the image files as writeable).
Other image formats (JPEG, TIFF, PSD) can be considered derivative formats from the RAW format. These formats are not considered to be read-only, and Photoshop is free to write metadata directly into the file. However, because the crs: tags are only of interest for the RAW format, PS would neither use nor write those tags in connection with those file formats.
Note that the crs: tags from the Camera RAW plug-in are the reason why we can do non-destructive processing of the RAW images. Actually using the XMP sidecar file opens some very interesting possibilities (which are to some extent implemented in Lightroom).
Copy link to clipboard
Copied
All is possible - if someone started such project to integrate internally .XMP with .RAW (all formats) files that could be used by huge companies. There are some programs which give you new possibilites, not in relation to this topic, but you can do by them that wasn't so easy before. For example exiftool let you do some helpful stuff. Unfortunately somone had to invest much money we could get benefits from it.
Copy link to clipboard
Copied
You have a syntax error, it should be...
var file = new XMPFile(File(s).fsName, XMPConst.FILE_UNKNOWN, XMPConst.OPEN_FOR_READ); |
But of course it will not work for raw files.
The only work-around I know of are:
If the raw file has an associated xmp file, this can be amended direct.
or have Bridge as the target and use XMPMeta
Copy link to clipboard
Copied
I saw your script how to do that using Bridge on XMP SDK forum but for some reason it's not longer there 😕 that was still some alternative, Did you remove it?
Copy link to clipboard
Copied
Sorry about that, I posted in the wrong thread.
Here's an example.
#target bridge;
ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var s = File("C:\\1.NEF");
try {
var file = new XMPFile(File(s).fsName, XMPConst.FILE_UNKNOWN, XMPConst.OPEN_FOR_READ);
alert(s + "\nOK!");
}
catch(e) { alert(s + "\nWTF! " + e); }
var thumb = new Thumbnail(s);
var md = thumb.synchronousMetadata;
var xmp = new XMPMeta(md.serialize());
var win = new Window("dialog","XMP");
var txt = win.add("edittext",undefined,"", { multiline: true, closeButton: true} );
txt.preferredSize=[500,500];
txt.text =xmp.dumpObject();
win.show();