Page 1 of 1

must specify image size of GIF file

Posted: 2010-07-19T09:50:08-07:00
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?

Re: must specify image size of GIF file

Posted: 2010-07-19T10:15:39-07:00
by fmw42
try

cd sample_files/bmpfiles
display GIF:unicd3a.bgr

Re: must specify image size of GIF file

Posted: 2010-07-19T13:16:24-07:00
by tsdineen
Same error, less directories:

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

Re: must specify image size of GIF file

Posted: 2010-07-19T13:19:35-07:00
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.

Re: must specify image size of GIF file

Posted: 2010-07-20T19:24:02-07:00
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.

Re: must specify image size of GIF file

Posted: 2010-07-20T20:09:36-07:00
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?

Re: must specify image size of GIF file

Posted: 2010-07-23T14:12:28-07:00
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.

Re: must specify image size of GIF file

Posted: 2010-07-25T15:11:51-07:00
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.

Re: must specify image size of GIF file

Posted: 2010-07-27T17:21:15-07:00
by anthony
How do you plan to patch this?

Re: must specify image size of GIF file

Posted: 2010-07-27T17:36:59-07:00
by fmw42
anthony wrote:How do you plan to patch this?

The 6.6.3.1 release is now out.

Re: must specify image size of GIF file

Posted: 2010-07-27T21:01:06-07:00
by anthony
Doesn't explain how it was fixed.

Re: must specify image size of GIF file

Posted: 2010-07-28T14:09:26-07:00
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"/>

Re: must specify image size of GIF file

Posted: 2010-07-30T09:37:38-07:00
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,