Negative or zero image size

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Negative or zero image size

Post by magick »

The problem you reported is fixed in the latest release of ImageMagick, 6.3.4-10.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Negative or zero image size

Post by anthony »

Also the '@' flag for resize only makes sense for ONE number. the maximum number of pixels over the whole image.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
erhhung

Re: Negative or zero image size

Post by erhhung »

I encountered the same problem in 6.3.2, and noticed that it has been fixed, so I've just installed the latest release.

Code: Select all

C:\Media\Images>convert -version
Version: ImageMagick 6.3.6 10/19/07 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2007 ImageMagick Studio LLC

C:\Media\Images>convert 1-pixel.gif -thumbnail 160x1 test.jpg
convert: Negative or zero image size `1-pixel.gif'.
However, I'm still getting the same error. 1-pixel.gif has a dimension of 474x1, and I just want to shorten it.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Negative or zero image size

Post by magick »

The problem you reported is fixed in ImageMagick 6.3.6-4 Beta. Thanks.
Chandrashekar Bhat

Re: Negative or zero image size

Post by Chandrashekar Bhat »

Hi all,
I am using image magick utility for converting images.Inside Perl script i am calling " mogrify " like this,

system("mogrify mogrify -resize 200x150 -quality 70 \"test\/*.jpg\"");

i.e, i want to convert all images inside a folder single shot, that is why i don't use convert

But for some images this returning, "mogrify: Negative or zero image size", By viewing this post i thought problem may be with my Image Magick utility, so i checked the version of image Magic, it says,

Chandrashekar@chandra:/home/chandra/scripts> mogrify -version
Version: ImageMagick 6.4.1 09/18/08 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC

Can anybody tell me any issue with my code or image magic utility?

Thanks,
Chandrashekar
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Negative or zero image size

Post by magick »

When a resize takes place and it reduces one of the dimensions to 0, an exception is throw. We have fixed some places within ImageMagick to recognize this problem and return a dimension of 1 instead of 0. To investigate further we will need you to isolate the problem for a particular image and ImageMagick command. Once we can reproduce the problem we will look towards a patch to ImageMagick so the command completes without complaint.
Chandrashekar Bhat

Re: Negative or zero image size

Post by Chandrashekar Bhat »

Hi,
As I was busy with something else , i could not respond to Post. Yes , i am getting this error (negative or zero size) frequently, can you come again what extra info i need to provie, please let me know.

Thanks,
Chandrashekar
Post Reply