I am trying to record a script that will resize pictures of varying sizes to a particular dimension, in this case, 1920 pixels wide. Any ideas how I can do this?
If I use "resample" to resize a photo to the desired size, and record that action as a script, the resulting script will only work on other images that are the identical size of the image I used when recording the script. How can I write a script that will resize images to the same width, regardless of their original size?
bob said:Hi, I have been using http://www.irfanview.com/for many years. It does all you want and then some. It's free, check it out
Love Irfanview. I've used it as my default image viewer for years. And it is much faster on resizing a large amount of images. The thing about Photo-Paint's batch is that it opens all the images in house and I worry that PP will choke before it's done. What would be ideal is if Corel would make the batch dialog have more options -- and do them efficiently. I think there should be built-in settings to resample images. We shouldn't have to write scripts to do a task like that.
All that said, I do like the challenge of working out a script that will work. ;)
Patti
pranderson said:WITHOBJECT "CorelPHOTOPAINT.Automation.17" h& = .GetDocumentHeight() w& = .GetDocumentWidth() IF h > w THEN p# = 250 / h w = w * p .ImageResample w, 250, 72, 72, TRUE ELSE p# = 250 / w h = h * p .ImageResample 250, h, 72, 72, TRUE END IFEND WITHOBJECT
IF h > w THEN p# = 250 / h w = w * p .ImageResample w, 250, 72, 72, TRUE
ELSE p# = 250 / w h = h * p .ImageResample 250, h, 72, 72, TRUE END IFEND WITHOBJECT
Hi Patti
I just tried this script (saved as .csc in the same folder as the other .csc files) but I get an error message saying the file 'contains an error and could not be run.'