I have successfully resized the image without preserving aspect ratio using the following:
-resize 800x400!
...but I am unable to get any result using the image size information instead. There is no change in image using this:
-resize "%%[fx:w]"x"%%[fx:w/2]!
Is this a syntax issue?
Thanks for any help.
-resize using image size information
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: -resize using image size information
No, IM 6 does not support inline fx computations for any geometry (other than in -distort via -define distort:viewport). You need to find the width and height in a separate command from for example
Then use the variable in the -resize.
IM 7 is supposed to allow what you are trying to do.
Code: Select all
width=`convert image -format "%w" info:`
IM 7 is supposed to allow what you are trying to do.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: -resize using image size information
As Fred says, this isn't valid syntax in IM v6. But you can use percentages:-resize "%%[fx:w]"x"%%[fx:w/2]!
Code: Select all
-resize 100%%x50%%
snibgo's IM pages: im.snibgo.com