Skip to content

Cannot open DDS file (file generated by GIMP) #5432

Open
@mcDandy

Description

@mcDandy
  • .NET Core Version: (e.g. 3.0 Preview1, or daily build number, use 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)
  • Windows version: (winver)
  • Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes/No Cannot compile - CSC uses C# 7.2 features
  • Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? If yes, please file the issue via the instructions here.
  • 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:


  | Name | Value | Type
-- | -- | -- | --
◢ | $exception | {"Zobrazení nelze dekódovat. Může být poškozená jeho hlavička."} | System.IO.FileFormatException
  | ◢ Data | {System.Collections.ListDictionaryInternal} | System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
  | Count | 0 | int
  | IsFixedSize | false | bool
  | IsReadOnly | false | bool
  | IsSynchronized | false | bool
  | ▶ Keys | {System.Collections.ListDictionaryInternal.NodeKeyValueCollection} | System.Collections.ICollection {System.Collections.ListDictionaryInternal.NodeKeyValueCollection}
  | ▶ SyncRoot | {System.Collections.ListDictionaryInternal} | object {System.Collections.ListDictionaryInternal}
  | ▶ Values | {System.Collections.ListDictionaryInternal.NodeKeyValueCollection} | System.Collections.ICollection {System.Collections.ListDictionaryInternal.NodeKeyValueCollection}
  | ▶ Non-Public members |   |  
  | ▶ Results View | Expanding the Results View will enumerate the IEnumerable |  
  | HResult | -2146233033 | int
  | HelpLink | null | string
  | ◢ InnerException | {"Hlavička obrázku nebyla rozpoznána. (0x88982F61)"} | System.Exception {System.Runtime.InteropServices.COMException}
  | ▶ Data | {System.Collections.ListDictionaryInternal} | System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
  | ErrorCode | -2003292319 | int
  | HResult | -2003292319 | int
  | HelpLink | null | string
  | ▶ InnerException | null | System.Exception
  | Message | "Hlavička obrázku nebyla rozpoznána. (0x88982F61)" | string
  | Source | null | string
  | StackTrace | null | string
  | TargetSite | null | System.Reflection.MethodBase
  | ▶ Static members |   |  
  | ▶ Non-Public members |   |  
  | 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 40" | 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}
  | Attributes | Assembly \| Static \| HideBySig | System.Reflection.MethodAttributes
  | CallingConvention | Standard | System.Reflection.CallingConventions
  | ContainsGenericParameters | false | bool
  | CustomAttributes | Method System.Reflection.MemberInfo.get_CustomAttributes cannot be called in this context. | System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData>
  | ▶ DeclaringType | {Name = "BitmapDecoder" FullName = "System.Windows.Media.Imaging.BitmapDecoder"} | System.Type {System.RuntimeType}
  | IsAbstract | false | bool
  | IsAssembly | true | bool
  | IsCollectible | Method System.Reflection.RuntimeMethodInfo.get_IsCollectible cannot be called in this context. | bool
  | IsConstructedGenericMethod | Method System.Reflection.MethodBase.get_IsConstructedGenericMethod cannot be called in this context. | bool
  | IsConstructor | false | bool
  | IsFamily | false | bool
  | IsFamilyAndAssembly | false | bool
  | IsFamilyOrAssembly | false | bool
  | IsFinal | false | bool
  | IsGenericMethod | false | bool
  | IsGenericMethodDefinition | false | bool
  | IsHideBySig | true | bool
  | IsPrivate | false | bool
  | IsPublic | false | bool
  | IsSecurityCritical | Method System.Reflection.RuntimeMethodInfo.get_IsSecurityCritical cannot be called in this context. | bool
  | IsSecuritySafeCritical | Method System.Reflection.RuntimeMethodInfo.get_IsSecuritySafeCritical cannot be called in this context. | bool
  | IsSecurityTransparent | Method System.Reflection.RuntimeMethodInfo.get_IsSecurityTransparent cannot be called in this context. | bool
  | IsSpecialName | false | bool
  | IsStatic | true | bool
  | IsVirtual | false | bool
  | MemberType | Method | System.Reflection.MemberTypes
  | MetadataToken | 100684918 | int
  | ▶ MethodHandle | {System.RuntimeMethodHandle} | System.RuntimeMethodHandle
  | MethodImplementationFlags | Method System.Reflection.MethodBase.get_MethodImplementationFlags cannot be called in this context. | System.Reflection.MethodImplAttributes
  | ▶ Module | {PresentationCore.dll} | System.Reflection.Module {System.Reflection.RuntimeModule}
  | Name | "SetupDecoderFromUriOrStream" | string
  | ▶ ReflectedType | '((System.Reflection.RuntimeMethodInfo)($exception).TargetSite).ReflectedType' threw an exception of type 'System.NotSupportedException' | System.Type {System.NotSupportedException}
  | ▶ ReturnParameter | {System.Windows.Media.SafeMILHandle } | System.Reflection.ParameterInfo
  | ▶ ReturnType | {Name = "SafeMILHandle" FullName = "System.Windows.Media.SafeMILHandle"} | System.Type {System.RuntimeType}
  | ReturnTypeCustomAttributes | Method System.Reflection.RuntimeMethodInfo.get_ReturnTypeCustomAttributes cannot be called in this context. | System.Reflection.ICustomAttributeProvider
  | ▶ Non-Public members |   |  
  | ▶ Static members |   |  
  | ▶ Non-Public members |   |  

Expected behavior:
transtest.zip would open

Minimal repro:

WpfApp2.zip

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions