Date: | Wed, 25 Aug 2004 18:21:12 +1000 |
From: | tonyc [...] cpan.org |
To: | bug-imager [...] rt.cpan.org |
Subject: | segfault in Imager 0.43 |
Show quoted text
----- Forwarded message from tony -----
Date: Wed, 25 Aug 2004 09:50:28 +1000
To: imager-devel@molar.is
Subject: Re: [Imager-devel]: segfault in Imager 0.43
Mail-Followup-To: imager-devel@molar.is
> When converting to GIF the image is first converted to a paletted
> image, first a scan is done to produce a color table, then Imager
> does a translation from RGB to paletted using that table.
>
> It's crashing in the translation stage.
>
> I get the same result if I use a PNG file as input.
>
> I also get a crash if I call $thumb->to_paletted, so it's not a libungif
> problem.
>
> I'll try to debug this and put a fix in CVS.
Ok, this is three different bugs:
1) scale() doesn't ensure that the output image is at least 1 pixel by 1
pixel. The scale(type=>'min', xpixels=>1, ypixels=>1) resulted in an
image 0 pixels high (since 1/118 = 0.00847 truncates to 0).
2) the low level image creation code doesn't ensure images are at least
1 x 1 pixels
3) the translation code (which takes an RGB image and a palette),
doesn't handle the case when an empty palette is passed in. Since the
image generated by scale has no pixels, the generated palette is empty,
and so the translation stage fails because it expects at least one color
in the palette.
I'll fix these as time permits.
Tony
----- End forwarded message -----