Page 1 of 1

DDS rgb_bitcount

Posted: 2010-06-22T12:59:53-07:00
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.

Re: DDS rgb_bitcount

Posted: 2010-06-22T17:20:17-07:00
by magick
Thanks for the problem report and patch. We'll get it into ImageMagick 6.6.2-8 Beta available by sometime tomorrow.