How to disable XMP data from ever being inserted into any image, even when copy & pasting?

Community Beginner ,
Jun 16, 2021 Jun 16, 2021

Copy link to clipboard

Copied

I'm looking for an option in photoshop that disables XMP data from being inserted into images.


Using export or "save as web (legacy)" takes way too long, so that's not a viable option.

 

I want to be able to work with an image, copy and paste it on the web fast, but I don't want metadata, xmp, or any other data embedded into it.

 

Is this possible?

TOPICS
How to

Views

358

Likes

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
Adobe Community Professional ,
Jun 16, 2021 Jun 16, 2021

Copy link to clipboard

Copied

"copy and paste it on the web fast"

 

What exactly means sentence above? You want to copy image from Photoshop, right? Something else? Please explain your workflow/process with more details or step by step.

Likes

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
Adobe Community Professional ,
Jun 16, 2021 Jun 16, 2021

Copy link to clipboard

Copied

Not all metadata is XMP. Bridge is often a better place to this in most cases, however, if you wan't to do it in Photoshop, you can simply duplicate image layers to a new file (not duplicate the image, there is a difference). Most common file formats also accept metadata to various degrees/extents. So it is very hard permanently stop metadata from entering a file, however, you can remove metadata.

 

I hacked this script to do this for multiple layers, I think it is your best bet to remove all metadata, short of using ExifTool:

 

https://community.adobe.com/t5/photoshop/script-to-remove-all-meta-data-from-the-photo/m-p/10400906

 

 

/* Remove All Metadata & Retain Layers v2 - a brute force alternative to ExifTool
https://community.adobe.com/t5/photoshop/script-to-remove-all-meta-data-from-the-photo/m-p/10400906
Script to remove all metadata from the photo
30th July 2020 Update */

#target photoshop
app.bringToFront();

/* FLATTENED */
if (app.activeDocument.activeLayer.isBackgroundLayer) {
    // alert('Flattened image...');
    // Call function to duplicate all layers
    DupeSelectedLayers.main = function () {
        DupeSelectedLayers();
    };
    DupeSelectedLayers.main();
    alertMessage();
}

/* SINGLE (TRANSPARENT) LAYER BUG WORKAROUND */
else if (app.activeDocument.layers.length === 1) {
    // alert('Single layer image...');
    // Set the original doc
    var sourceDoc = app.activeDocument;
    // Add a randomly named temp layer
    app.activeDocument.artLayers.add();
    app.activeDocument.activeLayer.name = "2563@361#47&-TEMP_LAYER";
    // Select all layers and layer groups/sets!
    selectAllLayers();
    // Call function to duplicate all layers
    DupeSelectedLayers.main = function () {
        DupeSelectedLayers();
    };
    DupeSelectedLayers.main();
    // Select & remove temporary layer
    removeTempLayer(false);
    // Set the duplicated document
    var dupedDoc = app.activeDocument;
    // Switch back to the original doc
    app.activeDocument = sourceDoc;
    // Select & remove temporary layer
    removeTempLayer(false);
    // Set the duped doc as the active doc
    app.activeDocument = dupedDoc;
    alertMessage();
}

/* MULTIPLE LAYERS */
else {
    // alert('Multiple layer image...');
    // Select all layers and layer groups/sets!
    selectAllLayers();
    // Call function to duplicate all layers
    DupeSelectedLayers.main = function () {
        DupeSelectedLayers();
    };
    DupeSelectedLayers.main();
    alertMessage();
}

///// START FUNCTIONS /////

function selectAllLayers() {
    // https://feedback.photoshop.com/photoshop_family/topics/i-cant-record-sellect-all-layers-in-script-listener-and-in-actions
    var c2t = function (s) {
        return app.charIDToTypeID(s);
    };

    var s2t = function (s) {
        return app.stringIDToTypeID(s);
    };

    var descriptor = new ActionDescriptor();
    var descriptor2 = new ActionDescriptor();
    var reference = new ActionReference();
    var reference2 = new ActionReference();

    reference2.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
    descriptor.putReference(c2t("null"), reference2);
    executeAction(s2t("selectAllLayers"), descriptor, DialogModes.NO);
    reference.putProperty(s2t("layer"), s2t("background"));
    descriptor2.putReference(c2t("null"), reference);
    descriptor2.putEnumerated(s2t("selectionModifier"), s2t("selectionModifierType"), s2t("addToSelection"));
    descriptor2.putBoolean(s2t("makeVisible"), false);
    try {
        executeAction(s2t("select"), descriptor2, DialogModes.NO);
    } catch (e) { }
}

// Duplicate all selected layers to new document  
function DupeSelectedLayers() {
    function step1(enabled, withDialog) {
        if (enabled !== undefined && !enabled)
            return;
        cTID = function (s) {
            return app.charIDToTypeID(s);
        };
        sTID = function (s) {
            return app.stringIDToTypeID(s);
        };
        var origFilename = app.activeDocument.name.replace(/\.[^\.]+$/, ''); // Remove filename extension from original
        var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
        var desc1 = new ActionDescriptor();
        var ref1 = new ActionReference();
        ref1.putClass(cTID('Dcmn'));
        desc1.putReference(cTID('null'), ref1);
        // Use the original document filename + suffix
        desc1.putString(cTID('Nm  '), origFilename + "_NoMetadata");
        // Use the original document filename, beware overwriting the original file and losing all metadata!
        // desc1.putString(cTID('Nm  '), origFilename );               
        var ref2 = new ActionReference();
        ref2.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
        desc1.putReference(cTID('Usng'), ref2);
        desc1.putInteger(cTID('Vrsn'), 5);
        executeAction(cTID('Mk  '), desc1, dialogMode);
    }

    step1();
}

function removeTempLayer(makeVisible) {
    // Select & remove temporary layer
    var c2t = function (s) {
        return app.charIDToTypeID(s);
    };
    var s2t = function (s) {
        return app.stringIDToTypeID(s);
    };
    var descriptor = new ActionDescriptor();
    var list = new ActionList();
    var reference = new ActionReference();
    reference.putName(s2t("layer"), "2563@361#47&-TEMP_LAYER");
    descriptor.putReference(c2t("null"), reference);
    descriptor.putBoolean(s2t("makeVisible"), makeVisible);
    list.putInteger(3);
    descriptor.putList(s2t("layerID"), list);
    executeAction(s2t("select"), descriptor, DialogModes.NO);
    app.activeDocument.activeLayer.remove();
}

function alertMessage() {
    alert('File duplicated to remove metadata with "_NoMetadata" suffix added to the filename for safety.' + '\r' + 'Note: guides, color samplers, alpha channels, paths and other common document additions have not been copied.');

}

///// FINISH FUNCTIONS /////

 

 

 

And this script will remove all XMP metadata, but it will still retain other metadata, such as camera related data. You could run the script manually or even set up the Script Events Manager to automatically play this script whenever a file is opened. There are good reasons to keep metadata for your own use, however I understand that you may not wish to share it with others:

 

 

 

// https://forums.adobe.com/thread/2604316
// https://forums.adobe.com/message/10978749#10978749
#target photoshop
removeXMP();

function removeXMP() {
    if (!documents.length) return;
    if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
    var xmp = new XMPMeta(activeDocument.xmpMetadata.rawData);
    XMPUtils.removeProperties(xmp, "", "", XMPConst.REMOVE_ALL_PROPERTIES);
    app.activeDocument.xmpMetadata.rawData = xmp.serialize();
} 

 

 

 

Likes

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
Adobe Community Professional ,
Jun 16, 2021 Jun 16, 2021

Copy link to clipboard

Copied

LATEST

Not very elegant but it will work:

  1. Open image. 
  2. Select All. 
  3. Copy. 
  4. Make new Document sized for 'clipboard'. 
  5. Paste. 

Now examine the Info (File>File Info). 

Now exporting in Lightroom, lots of images, very fast. 

Author “Color Management for Photographers" & "Photoshop CC Color Management" (pluralsight.com)

Likes

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