Image Geometry ^ tag

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
RLGyde

Image Geometry ^ tag

Post by RLGyde »

Test file: hatching_orig.jpg
Version of ImageMagick: ImageMagick-6.5.4-6-Q16-windows-dll.exe

Trying to use the Cut the Image to Fit as described in the link.
I did start out using syntax for Cut the Image to Fit, but then I did start to try other things...

This two lines of code give me the same output picture (witch is 100x75).

Code: Select all

convert hatching_orig.jpg -thumbnail 100x100 thumbnail.png
convert hatching_orig.jpg -thumbnail 100x100^ thumbnail.png
command-line-options wrote:widthxheight^ Minimum values of width and height given, aspect ratio preserved.
As I understand this, the output from 100x100^ out to be bigger than 100 on both sides?

While testing I did find out that moving "-gravity center" up before "-thumbnail", that got the "-gravity center" to work.

Code: Select all

convert hatching_orig.jpg -gravity center -thumbnail 100x100^ -extent 100x100 thumbnail.png
Is it a bug or am I just not using convert the right way?

regards
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Image Geometry ^ tag

Post by Bonzo »

Try:

Code: Select all

convert hatching_orig.jpg -thumbnail 100x100^^ thumbnail.png
http://www.imagemagick.org/Usage/windows/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image Geometry ^ tag

Post by fmw42 »

The double ^ is only needed on Windows as ^ is an escape. On Unix, it would be \^.

The resize flag 100x100^, tells resize to make the smaller dimension of the input be 100. So it depends upon which is smaller the width or height of the input what you will get. If both width and height are the same, then this flag is not needed.

see http://www.imagemagick.org/script/comma ... p#geometry
RLGyde

Re: Image Geometry ^ tag

Post by RLGyde »

Tanks, the escape where the problem!

Not use to working on a windows server, tnx for the help!
Post Reply