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", but it still creates a 208x120 image with a tiny 16x16 image, completely centered in the new image. Perfect.

However, if I try it with a large image, it will give me the same error, but in fact it seems that it is cropped and not downscaling, as follows from "208x120".

What is this error, how to fix it, and why does this command line not work for large images?

The documentation is less than stellar :(

+1
source share
1 answer

I had the same problem. Apparently this is because you are using single quotes instead of double (normal) quotes. Your line should look something like this:

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

I don't know if this is allowed on * nix, as the documentation does not mention this ...

+2
source

Source: https://habr.com/ru/post/898254/


All Articles