Skip navigation
Home/Support/

Forums

316 Views 3 Replies Latest reply: Nov 2, 2011 10:40 AM by Mzlaki RSS
biancapbd Calculating status... 3 posts since
Mar 11, 2010
Currently Being Moderated

Mar 11, 2010 1:02 AM

Export layers to files - png

When I run the Export layers to Files script to save my layers as .pngs, it automatically changes the files to 72 dpi. I need them to stay at 300 dpi, like in the original file. Can anyone help me, how do I change the script in order to do this? Thanks in advance!

  • Michael L Hale Contributor 1,370 posts since
    Feb 22, 2005
    Currently Being Moderated
    1. Mar 11, 2010 9:40 AM (in response to biancapbd)
    Re: Export layers to files - png

    It uses a scriptlistner version of save for web for both png8 and png24. To change the png24 so it uses a normal save and retains the dpi find this line of code  "case png24Index:" It should be about line 840. Comment everything between that line and "break:", about line 890. Then add the following lines.


         pngSaveOptions = new PNGSaveOptions();
         pngSaveOptions.interlaced = dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Inter.value;
         app.activeDocument.saveAs( new File( exportInfo.destination + "/" + fileNameBody + ".png") , pngSaveOptions, true, Extension.LOWERCASE );

     

    I have not tested this, you may also have to add checks for 8bit, no extra layers, no alpha or spot channels, etc. SFW does most of that by default. But by using the saveAs method and setting copy to true I think it will be ok.

  • Mzlaki Calculating status... 1 posts since
    Nov 2, 2011
    Currently Being Moderated
    3. Nov 2, 2011 10:40 AM (in response to biancapbd)
    Re: Export layers to files - png

    Can you attach the script file, so I can replace it? I can seem to make it work when I change the code...

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points