Page 1 of 1

Geometry parameter parser ignores ^

Posted: 2020-02-29T09:36:09-07:00
by mbrijun
On IM 7.0.9-26, the geometry parser quietly ignores the trailing '^'. These 2 commands result in 2 different image dimensions.

The quotes are missing around 100x200^ - the trailing ^ is ignored silently.

Code: Select all

magick logo: -thumbnail 100x200^ biggerNotThinWiz.png
Please note the double quotes in the second example - this geometry setting works correctly.

Code: Select all

magick logo: -thumbnail "100x200^" biggerNotThinWiz.png
Single quotes fail to work.

Code: Select all

magick logo: -resize '100x200^' biggerNotThinWiz.png
magick: invalid argument for option '-resize' ''100x200'' at CLI arg 2 @ error/operation.c/CLISimpleOperatorImage/3204.

Re: Geometry parameter parser ignores ^

Posted: 2020-02-29T10:10:18-07:00
by snibgo
What is your platform? If Windows, then caret "^" is the escape character, and the Windows command interpreter will remove it unless it is escaped or in double quotes.

Re: Geometry parameter parser ignores ^

Posted: 2020-02-29T10:49:23-07:00
by fmw42
Either put the arguments in quotes (as you did) or escape the ^. On Unix, use \^. On Windows, as snibgo said, escape as ^^

Re: Geometry parameter parser ignores ^

Posted: 2020-02-29T11:07:50-07:00
by mbrijun
Makes sense. What confused me was that I was following 2 different guides on the IM official website. One was referring to single quotes (which does not work), and the other was not using any quotes at all.

https://imagemagick.org/script/command- ... p#geometry
https://www.imagemagick.org/Usage/thumbnails/

Re: Geometry parameter parser ignores ^

Posted: 2020-02-29T11:12:41-07:00
by snibgo
Most IM documentation assumes that bash is used. For use under Windows, see http://www.imagemagick.org/Usage/windows/