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.)
Pad image to fit a given aspect ratio
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Pad image to fit a given aspect ratio
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).
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Pad image to fit a given aspect ratio
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
This updated version is perfect.
Thank you so much!
Thank you so much!