question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot open DDS file created by gimp

See original GitHub issue

Description

I discovered that .net should be able to open dds files. I tested it with file I created and I cannot open the file.

steps to reproduce 1 unzip the file 2 create project and paste code snippet into it (and add usings) 3 run program and open unzipped file 4 messange box from catch should appear

Configuration

. net version 6.0.100-rc.1.21463.6 (also tested .net 5.0.0 runtime with 5.0.400 SDK) Windows 21H2 (22000.194) architecture x64

Regression?

Other information

Code to replicate (begins at line 28)

OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Test|*.dds";
try
{
     if (ofd.ShowDialog() == true)
     {
          string path = ofd.FileName;
          BitmapSource bmp = new BitmapImage(new Uri(path));
    }
}
catch (FileFormatException ffe) { MessageBox.Show("Cannot open image file: " + ffe.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); }

ffe object values:

  | Name | Value | Type
-- | -- | -- | --
▶ | Data | {System.Collections.ListDictionaryInternal} | System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
  | HResult | -2146233033 | int
  | HelpLink | null | string
▶ | InnerException | {"Hlavička obrázku nebyla rozpoznána. (0x88982F61)"} | System.Exception {System.Runtime.InteropServices.COMException}
  | Message | "Zobrazení nelze dekódovat. Může být poškozená jeho hlavička." | string
  | Source | "PresentationCore" | string
▶ | SourceUri | null | System.Uri
  | StackTrace | "   at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri uri, Stream stream, BitmapCacheOption cacheOption, Guid& clsId, Boolean& isOriginalWritable, Stream& uriStream, UnmanagedMemoryStream& unmanagedMemoryStream, SafeFileHandle& safeFilehandle)\r\n   at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy, Boolean insertInDecoderCache)\r\n   at System.Windows.Media.Imaging.BitmapImage.FinalizeCreation()\r\n   at System.Windows.Media.Imaging.BitmapImage.EndInit()\r\n   at System.Windows.Media.Imaging.BitmapImage..ctor(Uri uriSource, RequestCachePolicy uriCachePolicy)\r\n   at System.Windows.Media.Imaging.BitmapImage..ctor(Uri uriSource)\r\n   at WpfApp2.MainWindow..ctor() in C:\\Users\\Daniel Martinek\\source\\repos\\WpfApp2\\WpfApp2\\MainWindow.xaml.cs:line 36" | string
▶ | TargetSite | {System.Windows.Media.SafeMILHandle SetupDecoderFromUriOrStream(System.Uri, System.IO.Stream, System.Windows.Media.Imaging.BitmapCacheOption, System.Guid ByRef, Boolean ByRef, System.IO.Stream ByRef, System.IO.UnmanagedMemoryStream ByRef, Microsoft.Win32.SafeHandles.SafeFileHandle ByRef)} | System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}

File I have problems with (zipped). It can be openned in visual studio and GIMP which was used to create this file transtest.zip

No workarounds known

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
svickcommented, Oct 8, 2021

I think this should be closed as duplicate of https://github.com/dotnet/wpf/issues/5432.

0reactions
vishalmsftcommented, Oct 13, 2021

Thanks @svick and @mcDandy Let us close this one and follow the issue on original thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DDS file wont open
DDS files cannot be opened in GIMP. When this occurs Error message reads: "DDS Image Message / Unsupported DXGI format (98)".
Read more >
GIMP Error: DDS Image Plugin Could Not Open Image
GIMP Error: DDS Image Plugin Could Not Open Image. I get this error when I try to open .dds texture files from Kingdom...
Read more >
GIMP DDS Plug-in
The DDS images can not be opened by the general image viewer. To open a DDS image, we must have a DDS Viewer...
Read more >
GIMP wont open .dds files for DCS (#6259) · Issues - GitLab
So im trying to edit .dds files to reskin an aircraft in DCS and I am unable to open any .dds file in...
Read more >
Cannot open DDS file (file generated by GIMP) · Issue #5432
Problem description: I discovered that .net should be able to open dds files. I tested it with file I created and it cannot...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found