Curlyman72
Curlyman72

Reputation:

ImageMagick and Geometry Issue - resizing with >

using the latest version of imageMagick for windows (downloaded today)
small_image.jpg = 16x16
large_image.jpg = 800x600

convert small_image.jpg -gravity Center -resize '208x120>' -background white -extent 208x120 s_icon.gif

produces: "convert: invalid geometry `'208x120' @ geometry.c/ParseRegionGeometry/1322" yet it still produces a 208x120 image with the tiny 16x16 image perfectly centered within the new image. Perfect.

However, if I try it with the larger image, it gives me the same error but it actually seems to crop rather than scale down as the "208x120>" implies.

What is that error, how do I fix it and why doesn't this command line work for larger images?

The documentation is less than stellar :(

Upvotes: 1

Views: 4065

Answers (1)

Ole
Ole

Reputation: 289

I had the same issue. Apparently it's because you are using single quotes instead of double (normal) quotes. Your string should be like this:

convert small_image.jpg -gravity Center -resize "208x120>" -background white -extent 208x120 s_icon.gif

Don't know if this is allowed on *nix, since the documentation doesn't mention it...

Upvotes: 2

Related Questions