HI
Here is my code to fix image size but it is not working fine
doc = app.activeDocument;
doc.changeMode(ChangeMode.CMYK);
var Width = 600;
var Height = 500;
var RulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.POINTS;
if (doc.width> Width)
{
doc.resizeImage(width,null,null,ResampleMethod.NONE);
}
else if(doc.height> height)
{
doc.resizeImage(null,Height,null,ResampleMethod.NONE);
}
in above code i get error in the line (doc.resizeImage(width,null,null,ResampleMethod.NONE);)
now i want to untick the ResampleMethod, i want to size the image in points, not in pixels and resolution of the image
please any one help me
Thanks
Appu
Resample image
-
Mike Hale
Resample image
One reason for the error is javascript is case sensitive. You define Width but use width.
Even with that corrected you can't supply the width or height unless you resample. If you want to change either of those without resampling you need to do the math to determine at what ppi will give you the desired size then set only the resolution in the imageResize.
doc.resizeImage(undefined,undefined,175,ResampleMethod.NONE);
Even with that corrected you can't supply the width or height unless you resample. If you want to change either of those without resampling you need to do the math to determine at what ppi will give you the desired size then set only the resolution in the imageResize.
doc.resizeImage(undefined,undefined,175,ResampleMethod.NONE);