Jump to content

Can't open certain .dds files in newer version, but can in 3.5.11


Go to solution Solved by Rick Brewster,

Recommended Posts

Hello. I need to open .dds files of texture from Flatout 2, but it only allows me to open them in paint.net 3.5.11. On newer/latest versions it always gives me this error:

 

Exception:

System.FormatException: The DDS file is invalid.
   at DdsFileTypePlus.DdsNative.Load(Stream stream, DDSLoadInfo& info) in D:\Dev_projects\DdsFileTypePlus\DdsNative.cs:line 57
   at DdsFileTypePlus.DdsReader.Load(Stream input, IServiceProvider services) in D:\Dev_projects\DdsFileTypePlus\DdsReader.cs:line 30
   at PaintDotNet.FileType.Load(Stream input) in D:\src\pdn\src\Data\FileType.cs:line 495
   at PaintDotNet.FileType.Load(Stream input) in D:\src\pdn\src\Data\FileType.cs:line 495
   at PaintDotNet.Functional.Func.Eval[T1,TRet](Func`2 f, T1 arg1) in D:\src\pdn\src\Fundamentals\Functional\Func.cs:line 58


Is there any way to fix that in latest version and not hop between old and new paint.net-s?

Here's one of dds files for example: https://drive.google.com/file/d/1EaiJrKMvIbP2rUccKVnGs2mJL4mZsRDo/view?usp=sharing

(couldn't attach it because of file size)

Link to comment
Share on other sites

That file has the DDS_PIXELFORMAT size is set to 24 bytes when it should be 32, whatever tool created it is writing invalid DDS files.

 

Edit: I forgot that the DDS format includes the main image in the mipmap field count, so 11 mipmaps in a 1024x1024 pixel file is the expected number.

  • You're a Smart Cookie! 1

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

Does this happen with all of the DDS images in Fallout 2? (wait, doesn't FO2 predate DDS?)

 

@null54, how feasible/reasonable would it be to support these incorrectly formatted files?

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

1 hour ago, Rick Brewster said:

Does this happen with all of the DDS images in Fallout 2? (wait, doesn't FO2 predate DDS?)

 

The game is FlatOut 2, some kind of demolition derby racing game. I downloaded a few mods for the game from moddb to investigate this issue, and many of the modded DDS images have the DDS_PIXELFORMAT issue I mentioned above.

Fallout 2 uses its own custom image formats, not dds.

 

1 hour ago, Rick Brewster said:

how feasible/reasonable would it be to support these incorrectly formatted files?

 

It would be simple to patch the header size issue, it is just one line of code to modify.

It turns out I was wrong about the mipmap issue. I had forgotten that the DDS format includes the main image in the mipmap field count, so 11 mipmaps in a 1024x1024 pixel file is the expected number.

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

  • Solution

Oh right, Flatout 2. I was reading too fast :) Thanks for fixing so quickly!

 

@MilesFox92, you can install the updated DDS plugin over here or you can wait for the v5.0.8 update of Paint.NET which will include it. Should be out soon. 

 

 

 

  • Hugs 1

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

  • 8 months later...

Hello, 

 

I believe I am having a similar issue with Flatout: Ultimate Carnage

(Unless I'm doing something wrong elsewhere, which is entirely possible as I am just trying this for the first time)

 

Exception:

System.FormatException: The DDS file is invalid.
   at DdsFileTypePlus.DdsNative.Load(Stream stream, DDSLoadInfo& info) in D:\Dev_projects\DdsFileTypePlus\src\DdsNative.cs:line 57
   at DdsFileTypePlus.DdsReader.Load(Stream input, IServiceProvider services) in D:\Dev_projects\DdsFileTypePlus\src\DdsReader.cs:line 30
   at PaintDotNet.FileType.Load(Stream input) in D:\src\pdn\src_5_0_x\Data\FileType.cs:line 491
   at PaintDotNet.FileType.Load(Stream input) in D:\src\pdn\src_5_0_x\Data\FileType.cs:line 491
   at PaintDotNet.Functional.Func.Eval[T1,TRet](Func`2 f, T1 arg1) in D:\src\pdn\src_5_0_x\Fundamentals\Functional\Func.cs:line 60
 

https://drive.google.com/file/d/1CZujVw0g5brHYvsl22-QqtyNbXi7Paum/view?usp=sharing

 

Link to comment
Share on other sites

1 hour ago, Jed Eastgrove said:

I believe I am having a similar issue with Flatout: Ultimate Carnage

 

That is not a DDS file, it seems to be encrypted or some other format entirely.

  • Upvote 1

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...