modding the Export Layers to Files script to preserve .jpg quality
Please forgive me if I am posting this incorrectly, but as the thread I initially replied to is marked as Answered I started to wonder whether my question would be seen or not so I started this new thread. My original question is located in the thread http://forums.adobe.com/message/2795719#2795719 because Kari was having a similar issue to mine, but with a different file format. My original text:
--------------------------------------------
I am having a similar issue, except that I need to save each layer as a .jpg, and the Export Layers to Files script is compressing the images in some fashion so that a previously seamlessly tiling layer now has a border that ruins the tile. If I save each layer individually using either the Save As command or Save for Web and Devices with the proper settings (Maximum Quality, Progressive, and Baseline Standard), the resulting images don't acquire this border, so I feel pretty certain it is something in the script that is messing up (changing the compression of) the layers, but I honestly don't know what. I have tried modifiying the jpeg portion of the script this way, hoping to prevent it from deviating from the usual Save As options:
case jpegIndex:
docRef.bitsPerChannel = BitsPerChannelType.EIGHT;
var saveFile = new File(exportInfo.destination + "/" + fileNameBody + ".jpg");
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = jpegQuality; // 12
docRef.saveAs(saveFile, jpgSaveOptions, true, Extension.LOWERCASE);
break;
but this doesn't seem to affect whatever setting is being changed. Layers saved to .jpg this way still acquire the border. I don't see what line might control whether the image is saved as progressive or not, nor anything to affect the text setting "Maximum" that I use when I successfully save each layer individually.
I am a complete novice at scripting, so please excuse/explain the obvious mistakes I may be making here.
----------------------------
I have since installed the script listener plug in and isolated a bit of script for saving the intended way, and hope to insert this snippet into the Export Layers as Files script, but I can tell that some of the lines are extraneous (like where it points to the file path I took), but I don't know what is safe to trim out. I sincerely appreciate any assistance with this!
