Mar 11, 2010 1:02 AM
Export layers to files - png
-
Like (0)
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!
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.
Thanks, everything worked as I wished!!
Can you attach the script file, so I can replace it? I can seem to make it work when I change the code... ![]()
North America
Europe, Middle East and Africa
Asia Pacific
Copyright © 2011 Adobe Systems Incorporated. All rights reserved.
Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy (updated 07-14-2009).