How can I remove junk RAW DATA from file?

New Here ,
Jun 26, 2017 Jun 26, 2017

Copy link to clipboard

Copied

Hello everyone,

I am hoping one of you can help me.

I have imagery that has excessive amounts of junk information/data in the files Raw Data.

I am talking hundreds or lines such as,

               <rdf:li>006866056250D71BF7680982B0D05DF3</rdf:li>

               <rdf:li>006DD14C462C310A9EF1CBDBCA7B7495</rdf:li>

               <rdf:li>00705EFBC9A5EE18A2EED4A717FB5F3B</rdf:li>

               <rdf:li>007658278627CC4858C4936D67F0DF67</rdf:li>

               <rdf:li>0078FB3D86D842E685C914C2D00A2E40</rdf:li>

               <rdf:li>0079BF078397D573B94DED2786347029</rdf:li>

               <rdf:li>0081E97051E1C1286376E67546DC1F9C</rdf:li>

               <rdf:li>0084E230C00349DC642AC80C2170155A</rdf:li>

               <rdf:li>00851DEE279751E47814F624C7D3F464</rdf:li>

               <rdf:li>00852F3629FD42D645AD7D1CD73D0C4E</rdf:li>

               <rdf:li>008704B02FF85F234D4D0F89072C6796</rdf:li>

               <rdf:li>00878D4A885675232111A258BC24458F</rdf:li>

               <rdf:li>008833914D82F173A079227F0DB988A7</rdf:li>

               <rdf:li>008AF0CF7AC7E67525301FB6AE481ADB</rdf:li>

               <rdf:li>008BC64A056514C18902F6F2CE088528</rdf:li>

               <rdf:li>008F67961E96136A1D348885E296E63F</rdf:li>

               <rdf:li>00959AD22DF8E112CC4D5D4EE7574935</rdf:li>

               <rdf:li>00988D8BF2DA968D5672B08031534596</rdf:li>

               <rdf:li>0099345CD06DDE9EE8E15AC91B4FE71C</rdf:li>

               <rdf:li>009B4FDA6C18CB8E8138D3402E4952A5</rdf:li>

               <rdf:li>009BDAEEBC2332EA4708078E3F9CF771</rdf:li>

               <rdf:li>009C343AE445CAA695C298107FFCFE65</rdf:li>

               <rdf:li>009DFBD4C9F04397A664A71A4465BE52</rdf:li>

               <rdf:li>00A946DD7AE61C92FAD4FA692989CE84</rdf:li>

               <rdf:li>00ABF1CB64AB8E17AD44227EFDE04411</rdf:li>

               <rdf:li>00AFD834575791274DF00ABA026367FD</rdf:li>

               <rdf:li>00B429296471BFB41FD5D7ADEF1E41C4</rdf:li>

etc....

These cause the file sizes to become excessively large. Is there a way to remove  this?

I used to have a script that seemed to work, but, no longer seems to remove the junk, and I cannot understand why.

It is, 

function deleteDocumentAncestorsMetadata() { 

whatApp = String(app.name);//String version of the app name 

if(whatApp.search("Photoshop") > 0)  { //Check for photoshop specifically, or this will cause errors 

//Function Scrubs Document Ancestors from Files 

if(!documents.length) { 

alert("There are no open documents. Please open a file to run this script.") 

return;  

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

var xmp = new XMPMeta( activeDocument.xmpMetadata.rawData);  

// Begone foul Document Ancestors! 

xmp.deleteProperty(XMPConst.NS_PHOTOSHOP, "DocumentAncestors"); 

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

//Now run the function to remove the document ancestors 

deleteDocumentAncestorsMetadata();

if anyone knows a way to clear out this unnecessary metadata, please share!

Thank you in advance!

TOPICS
Actions and scripting

Views

4.9K

Likes

translate

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
Guide ,
Jun 26, 2017 Jun 26, 2017

Copy link to clipboard

Copied

It might be due to the way you are saving the document, there was a problem with "Save For Web" when retaining metadata, it did not save any metadata changes that were made in Photoshop. There are simular scripts to remove this data without opening the documents for Photoshop and Bridge.

The Bridge one is here.. Bridge Script to Remove Photoshop DocumentAncestors Metadata

Likes

translate

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
New Here ,
Jun 26, 2017 Jun 26, 2017

Copy link to clipboard

Copied

Well, the images come to me, initially, with all thins junk already in them. As I get hundreds of these, when many have this junk metadata, it causes my files (including the images) to get pretty big very quickly.

I hope their is a way to purge the excess, unnecessary data easily, like an action, so I do not have to do it manually, hundreds of times.

Likes

translate

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 26, 2017 Jun 26, 2017

Copy link to clipboard

Copied

Please post an effected image.

Likes

translate

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
New Here ,
Jun 26, 2017 Jun 26, 2017

Copy link to clipboard

Copied

Here, you can see my file. It is 7.5 MBs (which is far too large). But, when I check it's size in photoshop, it is 1.02, which is what it should be....

Screen Shot 2017-06-26 at 11.40.44 AM.png

Here is a screen shot of all the garbage junk data in the Raw Data

Screen Shot 2017-06-26 at 11.41.02 AM.png

which just goes on and on...

Screen Shot 2017-06-26 at 11.41.13 AM.png

The script I posted in the original post used to clear out all this data. For example, here is the same file, from months ago, when it seemingly worked...

Screen Shot 2017-06-26 at 11.45.20 AM.png

As you can see, the hundreds of junk lines are gone. The file size is 1.3 MBs.

I hope this helps....

Likes

translate

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
Guide ,
Jun 26, 2017 Jun 26, 2017

Copy link to clipboard

Copied

Here is a script for Photoshop, it will remove the Ancestors for a folder of jpg,tif or psd files without opening them.

#target photoshop;

var inputFolder= Folder.selectDialog ("Please select folder to process");

if(inputFolder != null){

var fileList  = inputFolder.getFiles(/\.(jpg|tif|psd)$/i);

for(var a in fileList){delFileAncestorsMeta(fileList);}

}

function delFileAncestorsMeta(selectedFile) {       

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

var xmpFile = new XMPFile( selectedFile.fsName, XMPConst.FILE_UNKNOWN, XMPConst.OPEN_FOR_UPDATE | XMPConst.OPEN_USE_SMART_HANDLER );

var xmp = xmpFile.getXMP();

xmp.deleteProperty(XMPConst.NS_PHOTOSHOP, "DocumentAncestors");

if (xmpFile.canPutXMP(xmp)) {

        xmpFile.putXMP(xmp);

         xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);

         }             

}; 

Likes

translate

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 26, 2017 Jun 26, 2017

Copy link to clipboard

Copied

I have updated my blog post with this new solution from SuperMerlin:

Prepression: Metadata Bloat – photoshop:DocumentAncestors

Likes

translate

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 Employee ,
Jun 26, 2017 Jun 26, 2017

Copy link to clipboard

Copied

Moving to Photoshop Scripting

Likes

translate

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