convert: NegativeOrZeroImageSize when resizing / scaling
Posted: 2016-08-05T05:36:24-07:00
convert with -resize / -scale aborts with a NegativeOrZeroImageSize error if an image is reduced in size and one dimension is rounded down to zero. I'm using ImageMagick 7.0.2-6 on Ubuntu x64 16.04.
Examples:
Examples:
Code: Select all
$ convert -size 1000x1 xc:red -resize 49% /tmp/r.png
convert: NegativeOrZeroImageSize `red' @ error/resize.c/ResizeImage/2855.
$ convert -size 1000x1 xc:red -scale 49% /tmp/r.png
convert: NegativeOrZeroImageSize `red' @ error/resize.c/ScaleImage/3225.
$ convert -size 1000x10 xc:red -scale 4% /tmp/r.png
convert: NegativeOrZeroImageSize `red' @ error/resize.c/ScaleImage/3225.
$ convert -size 10x1000 xc:red -scale 4% /tmp/r.png
convert: NegativeOrZeroImageSize `red' @ error/resize.c/ScaleImage/3225.
$ convert -size 10x1000 xc:red -resize 10@ /tmp/r.png
convert: NegativeOrZeroImageSize `red' @ error/resize.c/ResizeImage/2855.