I'm batch processing a folder of image to a uniform width with GraphicsMagick (though I assume the same would apply to ImageMagick):
$ gm convert -resize 1000x in.jpg out.jpg
But when I inspect some of the images, I get 999px
instead of 1000px
.
$ gm identify -verbose out.jpg
==> Image: out.jpg
==> Format: JPEG (Joint Photographic Experts Group JFIF format
==> Geometry: 999x591
Is there a way to enforce the right width? I assume it's doing some estimation to preserve aspect ratios.
Best Answer
Figured this out, you use an exclamation mark to enforce the elected size. From the GraphicsMagick docs:
So from the example above:
This results in an image that's exactly 1000 pixels wide: