Page 2 of 2

Re: Pad image to fit a given aspect ratio

Posted: 2009-12-03T17:48:38-07:00
by mki
Good question.
I'm not really sure what would be the most consistent behaviour.
Maybe copying, but on the other hand this also might be an unnecessary overhead.
What do you think?

btw: Is it safe to give the same input and output filename to your script? (The input file will be overwritten by the output, of course.)

Re: Pad image to fit a given aspect ratio

Posted: 2009-12-03T18:06:26-07:00
by fmw42
As far a I know you can have the input and output have the same name. The latter just overwrites the former whether there is a change or not. At least that is the way it works in IM on my Mac. Of course that is somewhat dangerous as if you make a mistake, then you lose your input image (unless you have a backup).

Re: Pad image to fit a given aspect ratio

Posted: 2009-12-04T11:20:12-07:00
by fmw42
I have updated the script now to include a tolerance relative to the absolute diff between the desired aspect ratio and the image aspect ratio. If the diff is less than or equal to the tolerance value, then no padding will take place. The input will simply be copied to the output. The default is 0 (always pad). Values are floats>=0.

Re: Pad image to fit a given aspect ratio

Posted: 2009-12-11T02:07:06-07:00
by mki
This updated version is perfect.

Thank you so much!