must specify image size of GIF file

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
tsdineen
Posts: 81
Joined: 2007-01-18T08:45:31-07:00

must specify image size of GIF file

Post by tsdineen »

I am receiving this following error when trying to view a GIF87 file with a bgr extension in the latest ImageMagick of 6.6.3-0.

>display sample_files/bmpfiles/unicd3a.bgr
display: must specify image size `sample_files/bmpfiles/unicd3a.bgr' @ error/rgb.c/ReadRGBImage/155.

There is nothing special with the file other than the extension. If I rename it, display works fine. Unfortunately, this extension is required as it is used to bench images for comparison. This also, used to work in my older version of ImageMagick, 6.3.6, though I have to upgrade to fix some pdf bugs.

I didn't see where this extension is a new supported format. Is there anything special now with this extension?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: must specify image size of GIF file

Post by fmw42 »

try

cd sample_files/bmpfiles
display GIF:unicd3a.bgr
tsdineen
Posts: 81
Joined: 2007-01-18T08:45:31-07:00

Re: must specify image size of GIF file

Post by tsdineen »

Same error, less directories:

display: must specify image size `unicd3a.bgr' @ error/rgb.c/ReadRGBImage/155.
tsdineen
Posts: 81
Joined: 2007-01-18T08:45:31-07:00

Re: must specify image size of GIF file

Post by tsdineen »

Adding the prefix does fix the problem, but that isn't an option. I am actually using the c interface, which my tool has been using since before 6.0.5 timeframe.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: must specify image size of GIF file

Post by anthony »

The problem is that bgr is one of the 'raw' image file formats that has no 'magic' other than the suffix to determine what file format it should use. It can NOT rely on file 'magick' (a special sting embedded in the file) as it is a raw data file that could contain ANY string.

In other words this can NOT be fixed globally for everyone.

The best solution is what Fred (fwm42) has given. Add a GIF: image file format prefix to the argument (not the filesname) in the convert command.

However perhaps it is posible to modify your ImageMagick to make your version understand that "bgr" is really a "gif" file format. However Cristy would be the one to tell you for certain.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
tsdineen
Posts: 81
Joined: 2007-01-18T08:45:31-07:00

Re: must specify image size of GIF file

Post by tsdineen »

This extension isn't list in the formats list, nor was this a problem in 6.3.6. I can't use the prefix, because 1) I am using the c interface, not display and 2) my tools doesn't have knowledge of the format being passed to it. I have relied on ImageMagick to tell me which format I have. Why is there a magic.xml and a delegates.xml if ImageMagick isn't going to use it?
tsdineen
Posts: 81
Joined: 2007-01-18T08:45:31-07:00

Re: must specify image size of GIF file

Post by tsdineen »

Is there a way to remove this coder from ImageMagick? I really have to have this extension images to use 'magic' and determine the coder.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: must specify image size of GIF file

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.6.3-1 Beta available by sometime tomorrow. Thanks.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: must specify image size of GIF file

Post by anthony »

How do you plan to patch this?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: must specify image size of GIF file

Post by fmw42 »

anthony wrote:How do you plan to patch this?

The 6.6.3.1 release is now out.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: must specify image size of GIF file

Post by anthony »

Doesn't explain how it was fixed.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
tsdineen
Posts: 81
Joined: 2007-01-18T08:45:31-07:00

Re: must specify image size of GIF file

Post by tsdineen »

I installed the patch, and it fixes the initial problem. Thanks. Although, now it breaks a PCL variant I added to magic.xml file. It is trying to decode the format as hpgl, which it isn't.

<delegate decode="hpgl" command="if [ -e hp2xx -o -e /usr/bin/hp2xx ]; then hp2xx -q -m eps -f `basename "%o"` "%i"; mv -f `basename "%o"` "%o"; else echo "You need to install hp2xx to use HPGL files with ImageMagick."; exit 1; fi"/>

The pcl file header is of this type

<magic name="PCL" offset="0" target="\033E\033"/>
tsdineen
Posts: 81
Joined: 2007-01-18T08:45:31-07:00

Re: must specify image size of GIF file

Post by tsdineen »

It would appear ImageMagick decides on coders before looking at the magick.xml file and ignores any entry. I'm not sure when this started, but the code is mapping the the file to the wrong coder. This particular file format is from legacy times when only <Esc>E was required to reset the printer. This is pre-pjl days. I need to be able to map this as pcl, otherwise, ImageMagick tries to use hp2xx to decode it.

Yes, prefixing the file with PCL: works, but that isn't an option, plus the extension is pcl. Is there any reason this was changed to ignore magic.xml, and how can I fix this? I really need a quick fix, since it preventing any test run that has legacy pcl data in it.

Thanks,
Post Reply