Skip to main content
June 22, 2012
Question

Script to erase all meta data?

  • June 22, 2012
  • 1 reply
  • 1324 views

I'm looking for a script that will erase all meta data from an image that I can put in the event manager to run whenever I save. 

I work with renderings, not photos, and some of my software inserts a lot of meta data that is interfering with other people in the pipeline.

Is this possible through a PS script?

-Brodie

This topic has been closed for replies.

1 reply

Paul Riggott
Inspiring
June 23, 2012

Not really as some schemas are read only.

This code will remove all that can be removed...

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

xmp = app.activeDocument.xmpMetadata.rawData;

xmpObject = new XMPMeta(xmp);

XMPUtils.removeProperties(xmpObject, "", "", XMPConst.REMOVE_ALL_PROPERTIES);

app.activeDocument.xmpMetadata.rawData = xmpObject.serialize();


If you wanted to remove all data, you would have to export as Save for Web making sure no metadata is selected; or create a new document by selecting all layers and duplicate them to a new document. Do not just duplicate the document as this will retain the metadata.

Inspiring
June 23, 2012

Should note some are read-only to XMP. There are some apps like Exiftool that can remove much more metadata that Photoshop can. Exiftool can remove camera data for example while Photoshop can not.