Last active
May 23, 2017 09:23
-
-
Save kenny1har/5f3852547ceee8fb406711bedba12e77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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