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

PNG files are saving larger than they should be on macOS through Photoshop 2021

Community Beginner ,
Mar 04, 2021 Mar 04, 2021

Copy link to clipboard

Copied

I have had an issue lately where photoshop will save what should be basic files in massive file sizes. i.e. an ongoing project I have that I update weekely typically saves to png at about 2mb. Lately it's been saving as 18-19mb with nothing changed in size or density. Any ideas?

 

 

{Thread title edited by moderator}

Views

314

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
Adobe Employee ,
Mar 05, 2021 Mar 05, 2021

Copy link to clipboard

Copied

Hi,

 

We're sorry about the trouble with Photoshop. Would you mind telling us which macOS version are you working on? How are you saving the PNG files?

 

You can try to reset the preferences of Photoshop using the steps mentioned here: https://adobe.ly/2Qzc0K3

Please backup your settings prior to resetting the preferences. You can check: https://adobe.ly/2vNz6FG

 

Let us know how it goes!

Regards,

Nikunj

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 ,
Mar 06, 2021 Mar 06, 2021

Copy link to clipboard

Copied

Thanks for the reply. I'm on the latest version of Big Sur running latest photoshop through Rosetta on an M1 MBP. However, I have also previously noticed this recently on my iMac running the final update to Catalina. I'm saving the png through 'Save As' as I usually do and it's not a problem I can consistently reproduce. 

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 Expert ,
Mar 05, 2021 Mar 05, 2021

Copy link to clipboard

Copied

It could be accumulated metadata. See the last 10 posts in this thread:

 

https://community.adobe.com/t5/indesign/file-size-is-too-big/td-p/9370587/page/3

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 Expert ,
Mar 05, 2021 Mar 05, 2021

Copy link to clipboard

Copied

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 Expert ,
Mar 06, 2021 Mar 06, 2021

Copy link to clipboard

Copied

Hi Stephen, I wrote a script that opens an InDesign document’s image links via the Bridgetalk class and runs your metadata removal function.  It runs without error but I don’t have any bloated examples to test. I think the bloat can get transferred into the ID document, so I’m guessing you would have to save the ID doc as IDML after running the script to fully clear the metadata.

 

 

 

 

/*
* Clear ancestor metadata from document images
* Version 1.0
* Rob Day 2020-2021
*/

#target indesign
#targetengine "session" 

var doc = app.documents.item(0);
var lnks = removeDuplicates(doc.links.everyItem().name)

var lPaths = [];

for (var i = 0; i < lnks.length; i++){
    var l = doc.links.itemByName(lnks[i])
    if (l.parent.constructor.name == "Image" && l.status != 1819109747) {
        lPaths.push(l.filePath)
    } 
};   

//Send the array of file paths to Photoshop
runPhotoshop(lPaths);


/**
* Update the ID links after Photoshop saves 
* @Return void 
* 
*/
function upDate(){
    var lks = doc.links;
    
    for (var i = 0; i < lks.length; i++){
        //$.writeln(lks[i].name + " Uppdate")
        while (lks[i].status != LinkStatus.NORMAL) {
            lks[i].update();
        }
    };   
}


/**
* Opens Photoshop via Bridgetalk and run psScript() function
* @Param the array of file paths to open 
* @Return value void
* 
*/
function runPhotoshop(a){
    var bt = new BridgeTalk();  
    bt.target = "photoshop";  
    bt.body = "var a = "+a.toSource()+";"  
    bt.body += psScript.toString() + "psScript();";

    bt.onResult = function(resObj) {
        upDate()
    }  

    bt.onError = function( inBT ) { alert(inBT.body); };  
    bt.send(8);  
      
    function psScript() {  
        for (var i = 0; i < a.length; i++){
        var d = open(File(a[i]));
        //https://community.adobe.com/t5/indesign/file-size-is-too-big/td-p/9370587/page/2
        if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");   
            var xmp = new XMPMeta( activeDocument.xmpMetadata.rawData);   
            xmp.deleteProperty(XMPConst.NS_PHOTOSHOP, "DocumentAncestors");   
            d.xmpMetadata.rawData = xmp.serialize(); 
            d.save();
            //$.writeln(d.name + " Saved")
            d.close();
        }; 
    }  
}


/**
* Removes duplicates from the array
* @Param an array to edit 
* @Return an array with no duplicates 
* https://community.adobe.com/t5/indesign/js-how-to-remove-duplicate-items-from-an-array/td-p/3044978
*/

function removeDuplicates(a){
    var ra = new Array();
    var o = new Object()
    for( i=0 ; i<a.length ; ++i ){
        o[a[i]] = null;
    }
    for( a[i] in o ){
        ra.push(a[i]);
    }
    return ra;
}

 

 

 

 

 

 

 

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 Expert ,
Mar 06, 2021 Mar 06, 2021

Copy link to clipboard

Copied

Hi Rob, this is mentioned in solution #6 in the link previously provided at my Prepression blog.

 

After updating the links, all one needs to do is a Save as of the .indd file to clean out any garbage (overwriting the original or to a new file, not a simple save). No need for .idml which should probably be avoided unless absolutely necessary.

 

Full credit to the original script authors, all I have done is to collect and host these various scripts.

 

I can share some images that contain excessive metadata if you like, these were example files from others reporting the issue in years gone by.

 

 

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 Expert ,
Mar 07, 2021 Mar 07, 2021

Copy link to clipboard

Copied

Hi Rob, this is mentioned in solution #6 in the link previously provided at my Prepression blog. No need for .idml

 

Yes, I saw that. When I was testing the problem in the 2018 thread Save As did not work for me on OSX—I had to Save As IDML. My InDesign/Bridgetalk script  cleans the ID document’s linked images and updates. I’m using the BridgeTalk object to get at the InDesign document’s image links without leaving ID.

 

 

I can share some images that contain excessive metadata if you like, these were example files from others reporting the issue in years gone by.

Thanks, I would like to test the script with files that have actual ancestor metadata.

 

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 Expert ,
Mar 08, 2021 Mar 08, 2021

Copy link to clipboard

Copied

LATEST

Thanks for the files.

 

The InDesign file with the 3 images placed was just under 200MB, and the script reduced the file size to 1.4MB—the runtime was a few seconds. You are right a simple Save As seems to work, so I added a save line to the script:

 

 

 

/*
* Clear ancestor metadata from document images
* Version 1.0
* Rob Day 2020-2021
*/

#target indesign
#targetengine "session" 

var doc = app.documents.item(0);
var fp = doc.filePath;
var lnks = removeDuplicates(doc.links.everyItem().name)

var lPaths = [];

for (var i = 0; i < lnks.length; i++){
    var l = doc.links.itemByName(lnks[i])
    if (l.parent.constructor.name == "Image" && l.status != 1819109747) {
        lPaths.push(l.filePath)
    } 
};   

//Send the array of file paths to Photoshop
runPhotoshop(lPaths);


/**
* Update the ID links and save as after Photoshop script runs 
*  void 
* 
*/
function upDate(){
    var lks = doc.links;
    
    for (var i = 0; i < lks.length; i++){
        while (lks[i].status != LinkStatus.NORMAL) {
            lks[i].update();
        }
    }
    doc.save (File(fp + "/" + doc.name))
}


/**
* Opens Photoshop via Bridgetalk and run psScript() function
*  the array of file paths to open 
*  value void
* 
*/
function runPhotoshop(a){
    var bt = new BridgeTalk();  
    bt.target = "photoshop";  
    bt.body = "var a = "+a.toSource()+";"  
    bt.body += psScript.toString() + "psScript();";

    bt.onResult = function(resObj) {
        upDate()
    }  

    bt.onError = function( inBT ) { alert(inBT.body); };  
    bt.send(8);  
      
    function psScript() {  
        for (var i = 0; i < a.length; i++){
        var d = open(File(a[i]));
        //https://community.adobe.com/t5/indesign/file-size-is-too-big/td-p/9370587/page/2
        if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");   
            var xmp = new XMPMeta( activeDocument.xmpMetadata.rawData);   
            xmp.deleteProperty(XMPConst.NS_PHOTOSHOP, "DocumentAncestors");   
            d.xmpMetadata.rawData = xmp.serialize(); 
            d.save();
            //$.writeln(d.name + " Saved")
            d.close();
        }; 
    }  
}


/**
* Removes duplicates from the array
*  an array to edit 
*  an array with no duplicates 
* https://community.adobe.com/t5/indesign/js-how-to-remove-duplicate-items-from-an-array/td-p/3044978
*/

function removeDuplicates(a){
    var ra = new Array();
    var o = new Object()
    for( i=0 ; i<a.length ; ++i ){
        o[a[i]] = null;
    }
    for( a[i] in o ){
        ra.push(a[i]);
    }
    return ra;
}

 

 

 

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