What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Square Thumbnails in PS8 (CS1)


lasa

Power User
Messages
300
Likes
0
Hi,
I've been away for some time... good to be back.
I need to batch a good number of thumbnails for a website.
What I need are square 75x75 thumbnails make of various different image dimensions 640x480 and 480x640.
I found some PS scripts on the internet but they all use newer versions of PS. Right now I have two ACTIONS that I apply if the image has a vertical or horizontal orientation, but I have to hand separate them.
I really would like to use a script to determine the shortest side, then crop off the long side to make a centered 75x75

I've attached what I've found on the internet... but it gives me errors because I think its built for cs2?
error it says is here: var sfwOptions = new ExportOptionsSaveForWeb();

Any help would be appreciated.

Lasa

oc = app.activeDocument;
var saveFile = new File(decodeURI(activeDocument.fullName.fsName).slice(0,-4) +"-thumb.jpg");
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
fitImageShortSide(75);
app.activeDocument.resizeCanvas(75, 75, AnchorPosition.TOPLEFT);
SaveForWeb(saveFile,60);
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
app.preferences.rulerUnits = startRulerUnits;

function fitImageShortSide(newImgSize) {
if (doc.width > doc.height) {
doc.resizeImage(undefined, newImgSize, undefined, ResampleMethod.BICUBICSHARPER);
}
if (doc.width < doc.height) {
doc.resizeImage(newImgSize, undefined, undefined, ResampleMethod.BICUBICSHARPER);
}
if (doc.width == doc.height) {
doc.resizeImage(newImgSize, newImgSize, undefined, ResampleMethod.BICUBICSHARPER);
}
SaveForWeb(saveFile,60); //change to 100 for 100%
}
function SaveForWeb(saveFile,jpegQuality) {
var sfwOptions = new ExportOptionsSaveForWeb();
sfwOptions.format = SaveDocumentType.JPEG;
sfwOptions.includeProfile = false;
sfwOptions.interlaced = 0;
sfwOptions.optimized = true;
sfwOptions.quality = jpegQuality;
app.activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);
}
 
I am not sure if this will work with your version but it is worth a try.

Open up 1 of your image and record an action resizing it to your required dimensions then file save it press stop on the action recording making sure you have saved it to something like image resize

close that image then go to file>automate>Batch it will let you choose 1 of the preset actions or 1 that you have recorded so select your resize action locate the folder to where all your images are making sure they are all in the same folder.

and tell it to save the output images in another folder or create 1

Start it off go and make yourself a coffee then it should all be done for you before you dunked your last cookie in your coffee.
 
Thanks hoogle,
My problem is that I have a criteria I want it always cropped to the short side..then trimmed to make a square.
It's for consistant thumbnails and most important info tends to me in the center.
Right now I use two actions one for vertical and one for horizontal... I'd like PS to figure out which is which and then crop accordingly.

The only way I see is with a script...
 

Back
Top