Conditional Image Size
HeyGuys I have this script that I'm realizing for adobe photoshop which will create an artistic picture from a photo. The starting image must have at least one of the sizes of 3000px so that the effects taken from the Filter Gallery are consistent for all the photos.
The script I have down here works but the only problem is that for images bigger than 3000px he will resize them: I need a part at some point which says "if >3000 pixels then don't do anything" because I want the software to Increase the Image Size only in the case both height and width are < to 3000 pixels
#target photoshop
doc = app.activeDocument;
// setting the ruler unit to pixels
app.preferences.rulerUnits = Units.PIXELS;
// these are our values for the end result width and height (in pixels) of our image
var fWidth = 3000;
var fHeight = 3000;
if(doc.height < 3000 || doc.width < 3000) {
if (doc.height > doc.width) {
doc.resizeImage(null,UnitValue(fHeight,"px"),null,ResampleMethod.BICUBIC);
}
else {
doc.resizeImage(UnitValue(fWidth,"px"),null,null,ResampleMethod.BICUBIC);
}
}
