DDS rgb_bitcount

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
morth

DDS rgb_bitcount

Post by morth »

It seems very common for dds images to have a rgb_bitcount of 32 even when they do not contain an alpha channel. Unfortunately I do not have a sample that I'm allowed to distribute but I have lots of them in the game files on my local hd. When this happens you have to skip one byte in ReadUncompressedRGB for every pixel, since it has to read 4 bytes instead of 3 for each pixel, as such:

Code: Select all

      if (dds_info->pixelformat.rgb_bitcount == 32)
              ReadBlobByte(image);
(after q->red = ...) This is of course not the most proper fix but a very quick one.

Actually the code should probably look at r_bitmask et al as well, though I've yet to encounter a file where those does not match the presumed ones.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: DDS rgb_bitcount

Post by magick »

Thanks for the problem report and patch. We'll get it into ImageMagick 6.6.2-8 Beta available by sometime tomorrow.
Post Reply