Copy link to clipboard
Copied
Hi,
So I have this wonderful script I wrote to export layers to gifs. And when I try to set opts.lossy = 0; Photoshop completley ignores me. It is also ignoring opts.interlaced = true;
It's always setting my lossy to 60 and my interlaced to false. What gives? Is this a bug? thanks,
Stan
Copy link to clipboard
Copied
Post the code where you are setting your options.
-X
Copy link to clipboard
Copied
function saveForWebGIF(toWhere,file,qual,name){
toWhere = new File(toWhere+name+".gif");
var opts = new ExportOptionsSaveForWeb();
opts.lossy = 0;
opts.interlaced = false;
opts.transparency = false;
opts.colorReduction = ColorReductionType.PERCEPTUAL;// selective is default
opts.format = SaveDocumentType.COMPUSERVEGIF;
opts.colors = qual;
opts.dither = Dither.DIFFUSION;
opts.ditherAmount = 88;
file.exportDocument(toWhere, ExportType.SAVEFORWEB, opts);
}
Copy link to clipboard
Copied
The code looks fine.
Do the SFW manually and examine the ScriptingListener output. It may provide a clue.
Copy link to clipboard
Copied
I know it does look fine right? that's why I think it's a damn bug. I guess I could use script listener and get the settings I need that way....
Copy link to clipboard
Copied
I stumbled on the same bug in CS2. ExportOptionsSaveForWeb.interlaced and ExportOptionsSaveForWeb.blur are ignored for JPEG and remembered settings from the Save For Web dialog are used instead. It definitely is a bug.
I'm starting to hate Photoshop scripting. Do I have to do everything via ActionManager?! It sucks...