Copy link to clipboard
Copied
I've got a VB script that uses Save For Web to make thumbnail images from a folder of larger images. Most perplexing is the file size difference of these thumbnails using the script versus making them one by one manually.
The thumbnails are 180x120 pixels. Using Save for Web from the file menu to manually create jpegs (50 quality, optimized, no profile, no progressive) the typical resultant file sizes are 9 to 14 KB. Using the script, the file sizes end up from 20KB to 30KB! Additionally, if the original file has any metadata (caption, contact info, copyright, etc) the manual process strips all the metadata out except the copyright notice, which is fine. Using the script however, all metadata remains intact!!
Can anyone explain why this is occurring? I'd sure like the smallest file size possible. Am I missing a parameter in the ExportSaveForWeb options?
Here's this save section of the code:
Dim sfwOptions As New ExportOptionsSaveForWeb
sfwOptions.Format = psJPEGSave
sfwOptions.Quality = 50
sfwOptions.Optimized = True
sfwOptions.IncludeProfile = False
SaveFile = OutputFolder & ImageNumber & ".jpg"
docRef.Export SaveFile, PsExportType.psSaveForWeb, sfwOptions
Thanks in advance for any insights and guidance.
(BTW, I get a similar file size disparity with javascript too although they end up a tad smaller than the VB script, go figure...)
Tom
PS - The VB Scripting Guide has the wrong name for the Export Document method. It is not "ExportDocument" but rather, simply "Export". Hopefully this tip will save someone hours and hours of frustration and confusion 😉
Copy link to clipboard
Copied
Eureka, I found the issue! Now pass the Propecia...
In the options in the Save for Web window (the two small gray arrows next to the Preset drop down list), on one of the panels there is a checkbox to Preserve Metadata. This was unchecked. Apparently, it was not seen as unchecked when running the script yet behaved accordingly when I did a manual save. Checking this box and clicking apply, run a manual save, then unchecking the box and clicking apply appeared to "reset" it to not save metadata (other than copyright info) either when saving manually or then using the script.
Case closed.
Copy link to clipboard
Copied
That must be a VB issue. It doesn't seem to happen with JS
Find more inspiration, events, and resources on the new Adobe Community
Explore Now