Open mcDandy opened 2 years ago
@mcDandy As stated in the issue: "I discovered that .net should be able to open dds files" Can you please help us by providing where is the information available?
It may be easier to implement this by using converter, instead of framework changes. And if it is supported in .NET Core, then, it is even quicker to write the converter.
I used code which reads it from registry. http://james-ramsden.com/get-file-types-supported-by-bitmapimage/
If it is only unsupported codec then why does it tells about wrong header
Ok probably unsupported codec
Hey @mcDandy, if you look at the code of BitmapImageCheck.recalculateExtensions()
from the blog post, you'll see that .DDS is manually added to the list of supported formats, it's not from the registry (nativeExtensions = new string[] { ".BMP", ".GIF", ".ICO", ".JPEG", ".PNG", ".TIFF", ".DDS", ".JPG", ".JXR", ".HDP", ".WDP" };
). I looked at the documentation from Microsoft and it doesn't say anything about the support of DDS files (https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.media.imaging.bitmapimage?view=winrt-22000#remarks).
A feature request would be more appropriate. Since WPF uses DirectX internally for its rendering, supporting DirectDraw Surface, a DirectX technology, does not seem like an invalid request.
Okay so the hardcoded list is most likely based on this documentation: https://docs.microsoft.com/en-us/windows/win32/wic/dds-format-overview which suggests DDS should indeed be a natively supported format in WIC and therefore WPF.
However, it also lists only 3 pixel formats that are supported for decoding:
DXGI_FORMAT_BC1_UNORM
DXGI_FORMAT_BC2_UNORM
DXGI_FORMAT_BC3_UNORM
These are all 565 bitmap formats, see https://docs.microsoft.com/en-us/windows/win32/direct3d11/texture-block-compression-in-direct3d-11.
The format of the attached file however is DDPF_ALPHAPIXELS | DDPF_RGB
- uncompressed 0xAARRGGBB format and therefore unsupported by the native codec.
As a feature request it should go to the owner of the WIC DDS codec.
dotnet --info
) . net version 6.0.100-rc.1.21463.6 (also tested with .net core 3.0 and .net 5.0.0 runtime with 5.0.400 SDK)winver
)Security issues and bugs should be reported privately, learn more via our responsible disclosure guidelines.
Problem description: I discovered that .net should be able to open dds files. I tested it with file I created and it cannot open the file. It opens in visual studio just fine.
Actual behavior:
Expected behavior: transtest.zip would open
Minimal repro:
WpfApp2.zip