Page 1 of 1

rgba codec mishandles images without alpha channel

Posted: 2012-05-07T11:56:49-07:00
by eevee
http://trac.imagemagick.org/browser/Ima ... gb.c#L1111

Code: Select all

  if (LocaleCompare(image_info->magick,"RGBA") == 0)
    {
      quantum_type=RGBAQuantum;
      image->matte=MagickTrue;
    }
  // ...
  do
  {
    if ((LocaleCompare(image_info->magick,"RGBA") == 0) &&
        (image->matte == MagickFalse))
      (void) SetImageAlphaChannel(image,ResetAlphaChannel);
This second `if` will never fire, because `image->matte` is set to true above without initializing the alpha channel. The result is an rgba file with seeming garbage in the alpha channel.

This appears to have been fixed in 7, but it still affects 6.7.6.

Re: rgba codec mishandles images without alpha channel

Posted: 2012-05-07T15:38:51-07:00
by magick
Thanks for the bug report. We will have a patch to fix it within a day or two.