0xC0000054 / pdn-ddsfiletype-plus

A Paint.NET filetype plugin that adds support for some of the DDS formats introduced in DirectX 10 and later.
https://forums.getpaint.net/topic/111731-dds-filetype-plus/
MIT License
69 stars 5 forks source link

DDS files with a header size of 24 #16

Closed 0xC0000054 closed 11 months ago

0xC0000054 commented 11 months ago

Hello! I have a similar problem with textures from the game STALKER SHoC.

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\Data\FileType.cs:line 491
   at PaintDotNet.Data.FileTypeProxy.OnLoad(Stream input) in D:\src\pdn\src\PaintDotNet\Data\FileTypeProxy.cs:line 60
   at PaintDotNet.FileType.Load(Stream input) in D:\src\pdn\src\Data\FileType.cs:line 491
   at PaintDotNet.Functional.Func.Eval[T1,TRet](Func`2 f, T1 arg1) in D:\src\pdn\src\Fundamentals\Functional\Func.cs:line 60

Diagnostics:

Application                                          paint.net версия 5.0.10 (Stable 5.10.8674.32967)
Build Date                                           1 октября 2023 г.
Install type                                         Classic

These textures are displayed in the game and opened in Photoshop: textures.zip

Originally posted by @xrSimpodin in https://github.com/0xC0000054/pdn-ddsfiletype-plus/issues/14#issuecomment-1745769176

0xC0000054 commented 11 months ago

The problem is those DDS file have a DDS_HEADER size of 24 (0x18) instead of 124 (0x7C).