Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The official version of the image resources may cause the program to fail to open in certain Windows environments. #4578

Open
Gaia-X-Alter opened this issue Oct 1, 2024 · 5 comments
Labels

Comments

@Gaia-X-Alter
Copy link

Expected Behavior

startup program

Actual Behavior

trigger Framework error:System.ArithmeticException->KERNELBASE.dll HearthstoneDeckTracker.execannot start

Steps to reproduce behavior

startup program

Log/Screenshots

No response

@Gaia-X-Alter
Copy link
Author

Due to this strange error, I wasted an entire afternoon and evening reinstalling the .NET version several times and upgrading Windows to the latest version. Then I decided to rebuild a new version of the program myself. I pulled the source code from GitHub and reproduced the issue in Visual Studio. In the end, I found that there was a problem with the images in the app icon, such as Resources/ClassIcons/Round/neutral.png, stas.png, stats_permium.png, venomous.png, and many others. Finally, I wrote a script to replace all the images, and now the program is working fine. I strongly recommend that the developers carefully check these resource images

@Gaia-X-Alter
Copy link
Author

Application: HearthstoneDeckTracker.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Information: System.ArithmeticException

Exception Information: System.OverflowException
at System.Windows.Media.Imaging.ColorConvertedBitmap.FinalizeCreation()
at System.Windows.Media.Imaging.ColorConvertedBitmap..ctor(System.Windows.Media.Imaging.BitmapSource, System.Windows.Media.ColorContext, System.Windows.Media.ColorContext, System.Windows.Media.PixelFormat)
at System.Windows.Media.Imaging.BitmapSource.CreateCachedBitmap(System.Windows.Media.Imaging.BitmapFrame, System.Windows.Media.Imaging.BitmapSourceSafeMILHandle, System.Windows.Media.Imaging.BitmapCreateOptions, System.Windows.Media.Imaging.BitmapCacheOption, System.Windows.Media.Imaging.BitmapPalette)
at System.Windows.Media.Imaging.BitmapFrameDecode.FinalizeCreation()
at System.Windows.Media.Imaging.BitmapFrameDecode..ctor(Int32, System.Windows.Media.Imaging.BitmapCreateOptions, System.Windows.Media.Imaging.BitmapCacheOption, System.Windows.Media.Imaging.BitmapDecoder)
at System.Windows.Media.Imaging.BitmapDecoder.SetupFrames(System.Windows.Media.Imaging.BitmapDecoder, System.Collections.ObjectModel.ReadOnlyCollection1<System.Windows.Media.Imaging.BitmapFrame>) at System.Windows.Media.Imaging.BitmapDecoder.get_Frames() at System.Windows.Media.Imaging.BitmapFrame.CreateFromUriOrStream(System.Uri, System.Uri, System.IO.Stream, System.Windows.Media.Imaging.BitmapCreateOptions, System.Windows.Media.Imaging.BitmapCacheOption, System.Net.Cache.RequestCachePolicy) at System.Windows.Media.ImageSourceConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.Object) at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateObjectWithTypeConverter(MS.Internal.Xaml.ServiceProviderContext, System.Xaml.Schema.XamlValueConverter1<System.ComponentModel.TypeConverter>, System.Object)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateFromValue(MS.Internal.Xaml.ServiceProviderContext, System.Xaml.Schema.XamlValueConverter1<System.ComponentModel.TypeConverter>, System.Object, System.Xaml.XamlMember) at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.CreateFromValue(MS.Internal.Xaml.ServiceProviderContext, System.Xaml.Schema.XamlValueConverter1<System.ComponentModel.TypeConverter>, System.Object, System.Xaml.XamlMember)
at System.Xaml.XamlObjectWriter.Logic_CreateFromValue(MS.Internal.Xaml.Context.ObjectWriterContext, System.Xaml.Schema.XamlValueConverter`1<System.ComponentModel.TypeConverter>, System.Object, System.Xaml.XamlMember, System.String, MS.Internal.Xaml.Runtime.IAddLineInfo)

Exception Information: System.Windows.Markup.XamlParseException
at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri)
at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean)
at System.Windows.Application.LoadComponent(System.Object, System.Uri)
at Hearthstone_Deck_Tracker.App.InitializeComponent()
at Hearthstone_Deck_Tracker.App.Main()

@Gaia-X-Alter
Copy link
Author

It's very strange that this issue only occurs on one of my computers, while my other newly installed computer works fine. These image resources appear to be packed into the HearthstoneDeckTracker.exe file, and regular players can't manually replace them. Is it really necessary to pack them in?

@Gaia-X-Alter
Copy link
Author

Gaia-X-Alter commented Oct 1, 2024

the Image files I regenerated earlier are below
Resources.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants
@Gaia-X-Alter and others