Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

How to make a script to resize image to fit exact frame?

$
0
0

Good afternoon,

 

My friend is working on a task to make multiple images fit the frame size 500x700 px.

 

We work out this script, though it sometimes makes Height above 700 px.

 

Can anyone help to edit it?

___

doc = app.activeDocument; 

 

doc.changeMode(ChangeMode.RGB); 

 

var fWidth = 500;

var fHeight = 700;

 

 

if (doc.width > fWidth,"px") {

    doc.resizeImage(UnitValue(fWidth,"px"),null,null,null,ResampleMethod.BICUBIC);

}

else {

    doc.resizeImage(null,UnitValue(fHeight,"px"),null,null,ResampleMethod.BICUBIC);

}

___


Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>