Page 1 of 1

Legacy DDS Support

Posted: 2014-09-01T00:20:00-07:00
by fireundubh
Per this thread, I discovered that ImageMagick's DDS coder (dds.c) does not have support for legacy DDS files.

Specifically, the DDS_PIXELFORMAT structure allows for three legacy flags that are not handled by the coder:
DDPF_ALPHA (0x2)
Used in some older DDS files for alpha channel only uncompressed data (dwRGBBitCount contains the alpha channel bitcount; dwABitMask contains valid data)

DDPF_YUV (0x200)
Used in some older DDS files for YUV uncompressed data (dwRGBBitCount contains the YUV bit count; dwRBitMask contains the Y mask, dwGBitMask contains the U mask, dwBBitMask contains the V mask)

DDPF_LUMINANCE (0x20000)
Used in some older DDS files for single channel color uncompressed data (dwRGBBitCount contains the luminance channel bit count; dwRBitMask contains the channel mask). Can be combined with DDPF_ALPHAPIXELS for a two channel DDS file.
Without support for these flags, ImageMagick fails to convert legacy DDS files.

Re: Legacy DDS Support

Posted: 2014-09-01T01:28:50-07:00
by dlemstra
I will put this on my todo list and try to add support for it.

Re: Legacy DDS Support

Posted: 2014-09-02T15:02:17-07:00
by dlemstra
Only the steelarrow_m.dds file is in the legacy format (DDPF_LUMINANCE) and it does not have the DDPF_ALPHA bit set. And the 'darkswirlsalpha.dds' file has an unsupported bit mask. I made some changes to my local development build to add support for both formats and I now get the following output: https://www.dropbox.com/sh/wxd03zif2ysn ... gMTba?dl=0.

Re: Legacy DDS Support

Posted: 2014-09-03T14:41:04-07:00
by fireundubh
Hmm, I guess I was reading the DDS header incorrectly.

Your output looks right.

Re: Legacy DDS Support

Posted: 2014-09-04T02:27:50-07:00
by dlemstra
Would you be willing to share a larger set of dds images? This will allow me to check the output and maybe add support for images that are unsupported at the moment. Feel free to send me a PM if you don't want to publicly share those images.

Re: Legacy DDS Support

Posted: 2014-09-05T21:44:25-07:00
by fireundubh
How many more images do you need? I just get them from here but I can put a package together for you.

Re: Legacy DDS Support

Posted: 2014-09-06T23:42:51-07:00
by dlemstra
I need to become a member to download something from that site. I just wanted to check a couple more files. Can you provide me with a link to the 9 other files that failed for you in the other topic?

Re: Legacy DDS Support

Posted: 2014-09-07T11:38:52-07:00
by fireundubh
Here's 9 more, but they all produce the same error:

http://www.mediafire.com/download/h58h5 ... steel_m.7z

I'll try to find more in a different texture package.

Re: Legacy DDS Support

Posted: 2014-09-07T11:58:42-07:00
by fireundubh

Re: Legacy DDS Support

Posted: 2014-09-08T11:22:01-07:00
by dlemstra
I just committed a patch that adds support for all the files you supplied, this will be available in ImageMagick 6.8.9-8.

Re: Legacy DDS Support

Posted: 2014-09-08T14:44:13-07:00
by fireundubh
Great news! Thank you. I'm looking forward to the next version.

Re: Legacy DDS Support

Posted: 2014-09-30T03:29:41-07:00
by fireundubh
Just installed the new version. Appears to be working! Thank you!