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

Difficulty removing metadata even when doing a replace with a different metadata template

Contributor ,
Oct 31, 2022 Oct 31, 2022

Copy link to clipboard

Copied

Hi everyone,

I am tearing my hair out because I can't seem to overwrite a metadata file.  I have created a new one and then try to replace and overwrite the previous details, but it still keeps the old camera EXIF data and not the new one which I require.

Does this have anything to do with Document Ancestors? Do I have to run some kind of script to get rid of old data?

 

I have been on this for days now and it is getting me frustrated. Hope someone can help. Thank you.

Best regards Paul

TOPICS
Metadata , Scripting

Views

1.9K

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 2 Correct answers

Community Expert , Oct 31, 2022 Oct 31, 2022
quote

Thank you.

Where can I download the Extendscript code editor? 

 


By @paulc65657246

 

If you are on a newish Mac, there is no 64-bit version of ExtendScript Toolkit:

Adobe ExtendScript Toolkit (32-bit only)

 

Adobe has moved on to offering an ExtendScript Debugger extension for MS Visual Studio Code:

MS Visual Studio Code + Adobe ExtendScript Debugger

 

Common free or commercial plain text editors suitable for code saving include –

Cross-platform: Atom, Sublime Text
Mac: Apple TextEdit (ensure t

...

Votes

Translate

Translate
LEGEND , Nov 02, 2022 Nov 02, 2022

Votes

Translate

Translate
LEGEND ,
Nov 03, 2022 Nov 03, 2022

Copy link to clipboard

Copied

I'll take a look at it. This was one I wrote to solve a problem I was having so it's not really well tested.

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
Contributor ,
Nov 04, 2022 Nov 04, 2022

Copy link to clipboard

Copied

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
LEGEND ,
Nov 04, 2022 Nov 04, 2022

Copy link to clipboard

Copied

Ok, try this update.

/*
Utility Pack Scripts created by David M. Converse ©2018-22

This script strips EXIF/XMP camera data

Last modifed 11/4/2022

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#target bridge
    if(BridgeTalk.appName == 'bridge'){
        //create menu
        var exifStrip = MenuElement.create('command', 'Strip EXIF', 'after Thumbnail/Open', this.menuID); //add to Contextual menu

        exifStrip.onSelect = function(){
            exifMain();
            }

        exifMain = function(){
            var Thumbs = app.document.selections; //apply to all selected thumbs
            var exifExifVersion = 0; //attributes to preserve
            var exifPixelXDimension = 0;
            var exifPixelYDimension = 0;
            var exifColorSpace = 1;
            if(ExternalObject.AdobeXMPScript == undefined)  ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript'); //load library for metadata
            
            for(var a in Thumbs){
                try{
                    if(Thumbs[a].hasMetadata){
                        var ThumbsMeta = Thumbs[a].synchronousMetadata; //get metadata
                        var ThumbsXMP = new XMPMeta(ThumbsMeta.serialize());
                        exifExifVersion = Thumbs[a].metadata.read('http://ns.adobe.com/exif/1.0/', 'ExifVersion'); //read attr to preserve
                        exifPixelXDimension = Thumbs[a].metadata.read('http://ns.adobe.com/exif/1.0/', 'PixelXDimension');
                        exifPixelYDimension = Thumbs[a].metadata.read('http://ns.adobe.com/exif/1.0/', 'PixelYDimension');
                        exifColorSpace = Thumbs[a].metadata.read('http://ns.adobe.com/exif/1.0/', 'ColorSpace');
                        XMPUtils.removeProperties(ThumbsXMP, 'http://cipa.jp/exif/1.0/', '', XMPConst.REMOVE_ALL_PROPERTIES); //delete namespaces
                        XMPUtils.removeProperties(ThumbsXMP, 'http://ns.adobe.com/exif/1.0/', '', XMPConst.REMOVE_ALL_PROPERTIES);
                        XMPUtils.removeProperties(ThumbsXMP, 'http://ns.adobe.com/exif/1.0/aux/', '', XMPConst.REMOVE_ALL_PROPERTIES);
                        ThumbsXMP.deleteProperty('http://ns.adobe.com/tiff/1.0/', 'Make'); //keep the rest of the TIFF namespace
                        ThumbsXMP.deleteProperty('http://ns.adobe.com/tiff/1.0/', 'Model');
                        ThumbsXMP.setProperty('http://ns.adobe.com/exif/1.0/', 'ExifVersion', Number(exifExifVersion)); //restore values
                        ThumbsXMP.setProperty('http://ns.adobe.com/exif/1.0/', 'PixelXDimension', Number(exifPixelXDimension));
                        ThumbsXMP.setProperty('http://ns.adobe.com/exif/1.0/', 'PixelYDimension', Number(exifPixelYDimension));
                        ThumbsXMP.setProperty('http://ns.adobe.com/exif/1.0/', 'ColorSpace', Number(exifColorSpace));
                        var ThumbsUpdatedPacket = ThumbsXMP.serialize(XMPConst.SERIALIZE_OMIT_PACKET_WRAPPER | XMPConst.SERIALIZE_USE_COMPACT_FORMAT); //update metadata object
                        Thumbs[a].metadata = new Metadata(ThumbsUpdatedPacket); //write to file
                        }
                    }
                catch(e){
                    alert(e + ' ' + e.line);
                    }
                }
            }
        }

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 Beginner ,
Jun 25, 2023 Jun 25, 2023

Copy link to clipboard

Copied

LATEST

I'm having a similar problem and I believe I have found a bug in the export process. I'm trying to remove all Meta data from the Exported file. If I use the Meta Off export profile, as is, the Camera data (Exif) is removed including the serial number of the camera. If I make a copy of the Meta Off profile and change the profile to Export the file with Long Edge as 3840, the Camera data is exported in the file. I think Export has a bug that includes Camera data when trying to resize the image.

 

The technique that works for me is to export using Meta Off, full size, and then Export the entire Meta Off directory a second time resizing to 3840. Since the JPEGs in the Meta Off file do not have the camera data, neither do the resized images.

 

This is frustrating because it wastes a lot of disk space and time. I'm hoping someone from Adobe can test this and fix this issue.

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