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

strip exif

New Here ,
Jan 28, 2009 Jan 28, 2009
Hello
could anybody tell me how to strip exif files i ps 4 ( mac os 10.4) as a batch. Not the SFW solution, but high res tiff files. thanks
TOPICS
Actions and scripting
6.3K
Translate
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
Valorous Hero ,
Jan 28, 2009 Jan 28, 2009
I would have suggested using Exiftool but that has problems with tif files.
This is another way, copy and paste to a new document and save the new document as a tif. This has it's own problems if you want to retain layers/alpha channels etc. Anyway here is a script that should do a folder of tifs.....


var sourceFolder = Folder.selectDialog("Select the folder to process");

var outputFolder = Folder.selectDialog("Select Output folder");



if (sourceFolder != null)

{

var fileList = sourceFolder.getFiles("*.tif")

for (var i = 0; i < fileList.length; i++)

{

displayDialogs = DialogModes.NO;

if (fileList instanceof File)

{

open(fileList);

var startRulerUnits = preferences.rulerUnits;

preferences.rulerUnits = Units.PIXELS;

var doc = app.activeDocument;

var docName = app.activeDocument.name;

var saveFile =new File(outputFolder + "/" + docName);

doc.selection.selectAll();

doc.selection.copy();

var W = activeDocument.width.value;

var H = activeDocument.height.value;

var R = activeDocument.resolution;

var MODE = app.activeDocument.mode;

var doc2 = app.documents.add(W, H, R, "Untitled-"+(documents.length+1), eval("New"+MODE), DocumentFill.WHITE,1.0);

doc.close(SaveOptions.DONOTSAVECHANGES);

doc2.paste();

doc2.flatten();

SaveTIFF(saveFile);

app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

app.preferences.rulerUnits = startRulerUnits;

}

}

}



function SaveTIFF(saveFile){

tiffSaveOptions = new TiffSaveOptions();

tiffSaveOptions.embedColorProfile = true;

tiffSaveOptions.alphaChannels = true;

tiffSaveOptions.imageCompression = TIFFEncoding.TIFFLZW;

activeDocument.saveAs(saveFile, tiffSaveOptions, true, Extension.LOWERCASE);

}

Translate
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 Expert ,
Jul 24, 2018 Jul 24, 2018
LATEST

Update: modern versions of ExifTool do not appear to have any problems fully removing all traces of Photoshop history metadata from TIFF files:

exiftool -history= '/Path/to image/file.tif'

Translate
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
New Here ,
Jan 30, 2009 Jan 30, 2009
OKAY ????
Paul it is impressing. There is only one problem. I did not now anything about script. Is there a place where i just can download the script an place it in the script folder in photoshop?
Translate
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 Expert ,
Jan 30, 2009 Jan 30, 2009
Just copy the above, open a text editing program like TextEdit and paste. Save it as a regular text file with a .jsx extension. Place in the script folder and run from the menu.
Translate
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
New Here ,
Jan 30, 2009 Jan 30, 2009
thank you - thats fine and I'll try it
Translate
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
Guest
Feb 02, 2009 Feb 02, 2009
Morten, in the Photoshop Exchange, there are three very useful scripts to help tidy up high resolution documents for distribution:

StripExif: http://preview.tinyurl.com/bejyym

Remove Alpha: I can't find an active link when searching for the old file name and my bookmark is out of date (I have the jsx file).

That being said, I note that the script code kindly supplied by Paul R could be easily modified so that alpha channels are removed when saving the TIFF (change the true to false for the appropriate alpha step near the end of the code).

Delete Paths: I can't find an active link when searching for the old file name and my bookmark is out of date (I have the jsx file).

Sincerely,

Stephen Marsh
Translate
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 Expert ,
Mar 01, 2016 Mar 01, 2016

// StripExif.js

// This script strips all the Exif and other information from a file.

//It is based on CopyAndPaste.js by Adobe, Copyright 2002-2003.  Adobe Systems, Incorporated.  All rights reserved.

//All amendments Copyright Brian Price 2004 (brian@secalis.com)

// This script selects all of the active document, copies the selection,

// to the clipboard, creates a new document of the same dimensions

// and pastes the contents of the clipboard into it without the Exif data,

//applying the original filename to the new stripped document

//Check if a document is open

if (documents.length > 0)

{

//Check that the document has no Layers

if (activeDocument.artLayers.length ==1)

{

// This ensures that rulerUnits are set before creating the new document.

var originalRulerUnits = preferences.rulerUnits;

  preferences.rulerUnits = Units.INCHES;

// Set variables for the Initial File and filename

var originalDoc = activeDocument

var Filename = (originalDoc.name)

//Select All and Copy

originalDoc.selection.selectAll();

originalDoc.selection.copy()

// record original dimensions

var x = originalDoc.width

var y= originalDoc.height

var r = originalDoc.resolution

var m = originalDoc.Mod

var b = originalDoc.bitsPerChannel

// Close original file

originalDoc.close(SaveOptions.DONOTSAVECHANGES)

// Create the new document and paste the original into it (without the Exif data)

  var stripDoc = documents.add(x, y, r, Filename,m , DocumentFill.TRANSPARENT);

  stripDoc.bitsPerChannel = b

  stripDoc.paste();

  stripDoc.flatten();

// Reset Variables

stripDoc = null;

originalDoc = null;

x = null;

y = null;

r = null;

m = null;

b = null

Filename = null;

// Reset rulers

preferences.rulerUnits = originalRulerUnits;

//Open alert box if the document has layers

}

else

{

    alert("This Document has layers - the script cannot be used");

}

//Open alert box if there is no document open

}

else

{

    alert("You must have a document open before running this script!");

}

Translate
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
Valorous Hero ,
Feb 03, 2009 Feb 03, 2009
Hi Stephen, there will be no alpha channels or paths as the script is only doing a copy and paste into a new document. The only thing that I did miss out was to add a flatten to the original document when opened.
Translate
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
Guest
Feb 03, 2009 Feb 03, 2009
Thanks Paul, I can't write script, however after posting I looked at the code in full. I found that I could translate the Photoshop specific functions and then realised that a simple copy/paste into a new doc was taking place (actions saved as a text file dump are much easier for a non programmer to understand, even if this plain text is not the true action code).

So, as you say, the file will not have alpha channels or paths.

I will copy and paste the code from the alpha and paths scripts for reference, as I can no longer find the links in the Exchange.

I have just found out about Xtools, so I will try to find time to learn more about scripting by translating action steps into javascript.

Stephen Marsh
Translate
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
New Here ,
Feb 03, 2009 Feb 03, 2009
Thanks Paul, I have now try to copy the text as Larry said. And it works. It works with open files and as a batch on a folder, but not with selected files from bridge. That's strange.

Morten Holtum
Translate
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
Valorous Hero ,
Feb 03, 2009 Feb 03, 2009
No it will not work on selected files from Bridge as that would need it to be completely re-written from scratch.
Translate
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
Guest
Feb 03, 2009 Feb 03, 2009
Remove Alpha:
______________

// remove every but the composite channels,

if (documents.length > 0)
{
docRef = activeDocument;

for (var i = docRef.channels.length-1 ; i >=0 ; i--) {
if (docRef.channels.kind != ChannelType.COMPONENT) {
$.writeln(docRef.channels.kind);
docRef.channels.remove(); }
}

}
else
{
alert("There must be at least one open document to run this script!");
}

______________

Not my code, I can't find the file/link in the Exchange anymore.

Hope this helps,

Stephen Marsh
Translate
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
Guest
Feb 03, 2009 Feb 03, 2009
Remove Paths: (even clipping paths, so watch out!)
______________

// remove all paths

if (documents.length > 0) {
docRef = activeDocument;
for (var i = docRef.pathItems.length-1 ; i >=0 ; i--) {
$.writeln(docRef.pathItems.kind);
docRef.pathItems.remove();
}
} else {
alert("There must be at least one open document to run this script!");
}
______________

Not my code, I can't find the file/link in the Exchange.

Hope this helps,

Stephen Marsh
Translate
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
New Here ,
Feb 28, 2009 Feb 28, 2009
i have a question that i hope you can help me with--that wort of follows this thread--.
i'm using PSCS4 and i'm trying to delete the "history" portion that was originally saved in my XMP data. i've gone to the "file info"->"advanced" window pane (tab) and deleted the "history" folder (like you suggested in your article a photoshop history lesson"), but the folder continues to reappear with all the initial history data. it appears like i delete the history folder, but then when opening up the "file info" window again, all the history is there like it was before i attempted to delete it.
can you help me out?
best-- and many thanks.
tv
Translate
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
Explorer ,
Feb 28, 2009 Feb 28, 2009
Tony Vincent wrote:
> have a question that i hope you can help me with--that wort of follows this thread--. i'm using PSCS4 and i'm trying to delete the "history" portion that was originally saved in my XMP data. i've gone to the "file info"->"advanced" window pane (tab) and deleted the "history" folder (like you suggested in your article a photoshop history lesson"), but the folder continues to reappear with all the initial history data. it appears like i delete the history folder, but then when opening up the "file info" window again, all the history is there like it was before i attempted to delete it.
> can you help me out?

You can't change history.
Really.
I've tried. Repeatedly.


At least not in PS. It may be possible to do it from with Bridge, provided the
document is not open in PS. And it is definitely possible to with exiftool. If
you only have to do a few every once in awhile, a bit of script in Bridge is the
way to go. If you have hundreds or thousands of images to process, use exiftool.

-X
Translate
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
New Here ,
Feb 28, 2009 Feb 28, 2009
hey X-
thanks for getting back to me.
so you're saying i can do it in Bridge? how so? i see the history in the metadata section (bottom-left)... but i can't edit it from there. (the image isn't open in PS). do you have a script for this?
let me know when you have a moment- much appreciated.
tv
Translate
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
Guru ,
Feb 28, 2009 Feb 28, 2009
This should clear the history of selected files in Bridge

#target bridge // let EntendScript know what app the script is for


clearHistory = {};// create an object

clearHistory.execute = function(){// create a method for that object
var sels = app.document.selections;// store the array of selected files
for (var i = 0; i < sels.length; i++){//loop though that array

var md = sels.synchronousMetadata;// get the metadata for the file
md.namespace = "http://ns.adobe.com/photoshop/1.0/";// set the namespace
md.History = " ";//set the porperty
}
}

// this script only works in bridge
if (BridgeTalk.appName == "bridge"){
//creage the munuItem
var menu = MenuElement.create( "command", "Clear history in Metadata", "at the end of Tools");
menu.onSelect = clearHistory.execute;
}
Translate
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
New Here ,
Feb 28, 2009 Feb 28, 2009
michael-
thank you so much for this info--
can you explain how i should use this exactly? is it in terminal? while i'm a very experienced audio editor-- i'm clueless in the terminal-world...
help is SO appreciated
tv
Translate
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
Guru ,
Feb 28, 2009 Feb 28, 2009
In Bridge choose from the menu Edit-Preferences-Startup Scripts. Click on the button named Reveal Scripts. That will either open Finder or Windows Explorer to the folder where you need to place the script.

Copy the script and paste it into a plain text editor. Save it as plain text in the startup scripts folder above with jsx as the ext and restart Bridge.

Upon restart Bridge will ask if you want to enable the script. Once Bridge is running you should see a new menu item under Tools Clear history in Metadata.
Translate
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
New Here ,
Feb 28, 2009 Feb 28, 2009
michael-
maybe we could email back and forth-- after doing what you stated above i get an error message saying "an error occurred while running a startup script names "EraseHistory". It may not be compatible with this version of Bridge; you can check for available updates by selecting the Updates command from the Help menu."
maybe i haven't saved the script in the proper way-- but being that i have no script experience, maybe you could help me out mate?
my email is tonyvincentimages@gmail.com
thanks in advance mate.
tv
Translate
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