Jump to content

Some DDS files fail to load (examples included)


Recommended Posts

The following error is consistently displayed by Paint.NET 3.5.8 when loading some DXT-compressed files (ones with the DDS extension), even though tools such as Nvidia's ReadDXT and ATI's The Compressonator can read them just fine:

"There was an unspecified error while opening the file."

I've attached a couple of example files that produce the error (with three different S3TC formats: DXT1, DXT3 and DXT5).

It seems that other users previous also reported similar issues, as mentioned in:

* Problem with *some* .DDS files

http://forums.getpai...some-dds-files/

* DDS File Support for Paint.NET now available [link was okay earlier today, but is now gone]

http://forums.getpai...-now-available/

Hopefully the examples would help to find a cause, since a lot of my DDS files have this problem.

Thanks in advance for any help, and also for the great software that Paint.NET is!

example-dds-files.zip

Link to post
Share on other sites

Hmm, that's no good. Do you know what format those DDS images are saved in? I only recently found out (because I don't watch The Daily DirectX News* apparently!) that there are new formats in Direct3D 11 which Paint.NET certainly doesn't support. Those formats are "BC6" and "BC7".

* I made that TV show up

Link to post
Share on other sites

Hmm, that's no good. Do you know what format those DDS images are saved in? I only recently found out (because I don't watch The Daily DirectX News* apparently!) that there are new formats in Direct3D 11 which Paint.NET certainly doesn't support. Those formats are "BC6" and "BC7".

* I made that TV show up

The header on those files is written incorrectly, everything in the DDS_PIXELFORMAT except the dwFourCC member and anything after it is set to zero.

Link to post
Share on other sites

Hmm, that's no good. Do you know what format those DDS images are saved in? I only recently found out (because I don't watch The Daily DirectX News* apparently!) that there are new formats in Direct3D 11 which Paint.NET certainly doesn't support. Those formats are "BC6" and "BC7".

* I made that TV show up

These examples were generated by Unreal Engine 2.5 (Unreal Tournament 2004), so they're unlikely to use the new Direct3D 11 formats.

The header on those files is written incorrectly, everything in the DDS_PIXELFORMAT except the dwFourCC member and anything after it is set to zero.

If the headers are written incorrectly, I suppose it is a bug of Unreal Technology that has been around for a while. The Nvidia and ATI tools probably have better fault-tolerant logic than Paint.NET, since they can handle the files; I wonder how they do it? Would it be possible to make an educated guess about the missing DDS_PIXELFORMAT data, perhaps using other DDS_HEADER info (if any) and total file size, or something like that?

Link to post
Share on other sites

These examples were generated by Unreal Engine 2.5 (Unreal Tournament 2004), so they're unlikely to use the new Direct3D 11 formats.

If the headers are written incorrectly, I suppose it is a bug of Unreal Technology that has been around for a while. The Nvidia and ATI tools probably have better fault-tolerant logic than Paint.NET, since they can handle the files; I wonder how they do it? Would it be possible to make an educated guess about the missing DDS_PIXELFORMAT data, perhaps using other DDS_HEADER info (if any) and total file size, or something like that?

Those other tools probably just check the dwFourCC field for a valid compressed texture without checking the dwFlags field for the DDPF_FOURCC flag.

The textures load fine in Paint.NET if the DDPF_FOURCC flag is set with a hex editor. :)

Link to post
Share on other sites

Those other tools probably just check the dwFourCC field for a valid compressed texture without checking the dwFlags field for the DDPF_FOURCC flag.

The textures load fine in Paint.NET if the DDPF_FOURCC flag is set with a hex editor. :)

Yes, indeed, the main problem seems to be with the dwFlags value of the DDS_PIXELFORMAT structure. I also noticed the remarks in the MSDN documentation about both dwFlags and dwCaps from the DDS_HEADER structure, saying "when you read a .dds file, you should not rely on the [...] flags being set because some writers of such a file might not set these flags". I suppose, for a similar reason, one could follow a more lenient approach with readers for the dwFlags in the DDS_PIXELFORMAT structure, and, when loading DDS files, also accept files that have dwFourCC set to an expected value (such as, DXT1, DXT3, DXT5 or DX10).

Link to post
Share on other sites
  • 2 weeks later...
  • 3 weeks later...
  • 3 weeks later...

Alright, we'll see if 3.5.9 will fix this for you. It's 1 line of code.

Speaking of 3.5.9: http://forums.getpai...eta-build-4278/

The 3 sample files above now load in Paint.NET. Please try it out on any others you have had trouble with.

Thank you, Rick! I tested Paint.NET version 3.5.9 with several hundreds of DDS files -- it works much better. Only two failed to load (same error message), but these files are included with two other commercial products (such that I won't attach the files on the forum). I'd guess the two problematic files have other weirdness with their headers. (Compressonator can read both, but ReadDXT also fails on one.)

However, all the Unreal DDS files load fine in the new Paint.NET version. Thanks again!

Link to post
Share on other sites
  • 2 years later...

Hi guys!

 

It seems me and a friend of mine who tested it too have the same problem again. I can't open certain *.dds files (Normal Maps) and everytime I try I get the following error:

System.FormatException: File is not a supported DDS format   at PaintDotNet.Data.Dds.DdsFile.Load(Stream input) in D:\src\pdn\paintdotnet\src\PaintDotNet\Data\Dds\DdsFile.cs:Line 473.   at PaintDotNet.Data.Dds.DdsFileType.OnLoad(Stream input) in D:\src\pdn\paintdotnet\src\PaintDotNet\Data\Dds\DdsFileType.cs:Line 227.   at PaintDotNet.FileType.Load(Stream input) in D:\src\pdn\paintdotnet\src\Data\FileType.cs:Line 459.   at PaintDotNet.Functional.Func.Eval[T1,TRet](Func`2 f, T1 arg1) in D:\src\pdn\paintdotnet\src\Base\Functional\Func.cs:Line 156.

or its just 'There was an unspecified error while opening the file'

 

The first error occurs with painetNET4.0.b5 and the second with 3.5.11 and 3.5.9. I can't even open Oxyzarium's sample files even though this should be possible...

Thanks for you help :-)

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Guest
This topic is now closed to further replies.
×
×
  • Create New...