Skip to content

Instantly share code, notes, and snippets.

@kenny1har
Last active May 23, 2017 09:23
Show Gist options
  • Save kenny1har/5f3852547ceee8fb406711bedba12e77 to your computer and use it in GitHub Desktop.
Save kenny1har/5f3852547ceee8fb406711bedba12e77 to your computer and use it in GitHub Desktop.
function removeMetadata( file ){
if ( !ExternalObject.AdobeXMPScript ) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
var xmpf = new XMPFile( File(file).fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE );
var xmp = xmpf.getXMP();
XMPUtils.removeProperties(xmp, "", "", XMPConst.REMOVE_ALL_PROPERTIES);
if (xmpf.canPutXMP( xmp )) {
xmpf.putXMP( xmp );
}
xmpf.closeFile( XMPConst.CLOSE_UPDATE_SAFELY );
};
var f = File("/example.tif");
removeMetadata(f);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment