• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Remove CRS metadata

Community Expert ,
Jan 15, 2019 Jan 15, 2019

Copy link to clipboard

Copied

Aparently standing on the shoulders of giants is harder than it would appear...

I have attempted to modify the following code to remove Adobe Camera Raw “develop” metadata from a JPG or TIFF, however it does not work. Can anybody point a rookie in the right direction? The end result should be the same as using Bridge’s “right click on file > develop settings > clear settings” command. I believe that my error is in line 12 where I would like to remove all of the "crs" metadata as a block:

// https://forums.adobe.com/message/9671488#9671488

#target photoshop; 

var inputFolder= Folder.selectDialog ("Please select folder to process"); 

if(inputFolder != null){ 

var fileList  = inputFolder.getFiles(/\.(jpg|tif)$/i); 

for(var a in fileList){clearSettings(fileList);} 

function clearSettings(selectedFile) {         

if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");      

var xmpFile = new XMPFile( selectedFile.fsName, XMPConst.FILE_UNKNOWN, XMPConst.OPEN_FOR_UPDATE | XMPConst.OPEN_USE_SMART_HANDLER );  

var xmp = xmpFile.getXMP(); 

xmp.deleteProperty(XMPConst.NS_CAMERA_RAW, "crs"); 

if (xmpFile.canPutXMP(xmp)) {  

        xmpFile.putXMP(xmp); 

         xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);  

         }               

};

info.png

P.S. There is a Bridge script to do this, however the requirement is to do so from Photoshop.

TOPICS
Actions and scripting

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Jan 15, 2019 Jan 15, 2019

Here you are Steven...

#target photoshop; 
var inputFolder= Folder.selectDialog ("Please select folder to process"); 
if(inputFolder != null){ 
var fileList  = inputFolder.getFiles(/\.(jpg|tif|psd)$/i); 
for(var a in fileList){delFileAncestorsMeta(fileList);} 
function delFileAncestorsMeta(selectedFile) {    
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript"); 
var xmpFile = new XMPFile( selectedFile.fsName, XMPConst.FILE_
...

Votes

Translate

Translate
Adobe
Guide ,
Jan 15, 2019 Jan 15, 2019

Copy link to clipboard

Copied

Here you are Steven...

#target photoshop; 
var inputFolder= Folder.selectDialog ("Please select folder to process"); 
if(inputFolder != null){ 
var fileList  = inputFolder.getFiles(/\.(jpg|tif|psd)$/i); 
for(var a in fileList){delFileAncestorsMeta(fileList);} 
function delFileAncestorsMeta(selectedFile) {    
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript"); 
var xmpFile = new XMPFile( selectedFile.fsName, XMPConst.FILE_UNKNOWN, XMPConst.OPEN_FOR_UPDATE | XMPConst.OPEN_USE_SMART_HANDLER );  
var xmp = xmpFile.getXMP(); 
XMPUtils.removeProperties(xmp,XMPConst.NS_CAMERA_RAW, "", XMPConst.REMOVE_ALL_PROPERTIES);
if (xmpFile.canPutXMP(xmp)) {  
        xmpFile.putXMP(xmp); 
         xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);  
         }          

};

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 15, 2019 Jan 15, 2019

Copy link to clipboard

Copied

Thanks SuperMerlin, as always your on the money!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

Supermerlin

I tried your script on mac with high sierra

photoshop cc2018

does not work

nothing is happening

how can you solve it?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

How are you verifying that the metadata is not being removed?

What file format? Is this a JPEG or TIFF? Was the CRS metadata applied in Bridge by opening into ACR, adjusting and then pressing done? Or was the file saved from ACR “baking in” the applied metadat? Or something else?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

I opened the nef in the raw room

I saved in jpg

I uploaded the .jsx file

indicating the folder where e

present the jpg file the nef file and the .xmp file

I do not know if I'm wrong?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

OK, so the metadata has been saved into the JPEG save from the raw file.

Is the filename extension .jpg or .jpeg?

The script is only processing files with an exact extension of JPG | TIF | PSD (upper or lower case does not matter). You may need to add in TIFF and JPEG versions if there are variations in filename extension. NEF and XMP are not processed.

In Bridge or Photoshop, you can use File > File Info then look on the Raw Data tab for the following CRS entries:

<crs:Version>10.5</crs:Version>

<crs:ProcessVersion>10.0</crs:ProcessVersion>

<crs:WhiteBalance>As Shot</crs:WhiteBalance>

<crs: etc...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

LATEST

ok after I see how it goes

thank you

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines