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

Crash when saving an RSI that is missing a png #55

Open
ShadowCommander opened this issue Jul 9, 2024 · 0 comments
Open

Crash when saving an RSI that is missing a png #55

ShadowCommander opened this issue Jul 9, 2024 · 0 comments

Comments

@ShadowCommander
Copy link
Member

Crashes when saving an RSI that contains a state that has been deleted/does not exist.

Reproduction:

  • Create new RSI
  • Add a sprite in the editor
  • Save
  • Close the tab
  • Delete the .png from the newly created RSI folder
  • Open the RSI in the editor
  • Save
  • Editor crashes
Unhandled exception. System.ArgumentOutOfRangeException: Parameter "width" (System.Int32) must be greater than 0, was 0 (Parameter 'width')
   at SixLabors.ThrowHelper.ThrowArgumentOutOfRangeException(String name, String message)
   at SixLabors.ThrowHelper.ThrowArgumentOutOfRangeExceptionForMustBeGreaterThan[T](T value, T minimum, String name)
   at SixLabors.ImageSharp.ImageFrame`1..ctor(Configuration configuration, Int32 width, Int32 height, TPixel backgroundColor, ImageFrameMetadata metadata)
   at SixLabors.ImageSharp.ImageFrame`1..ctor(Configuration configuration, Int32 width, Int32 height, TPixel backgroundColor)
   at SixLabors.ImageSharp.ImageFrameCollection`1..ctor(Image`1 parent, Int32 width, Int32 height, TPixel backgroundColor)
   at SixLabors.ImageSharp.Image`1..ctor(Configuration configuration, Int32 width, Int32 height, ImageMetadata metadata)
   at SixLabors.ImageSharp.Image`1..ctor(Configuration configuration, Int32 width, Int32 height)
   at SixLabors.ImageSharp.Image`1..ctor(Int32 width, Int32 height)
   at SpaceWizards.RsiLib.RSI.RsiState.GetFullImage(RsiSize size) in /home/runner/work/RSIEdit/RSIEdit/RSI.NET/SpaceWizards.RsiLib/RSI/RsiState.cs:line 99
   at SpaceWizards.RsiLib.RSI.Rsi.SaveImagesToFolder(String rsiFolder) in /home/runner/work/RSIEdit/RSIEdit/RSI.NET/SpaceWizards.RsiLib/RSI/Rsi.cs:line 118
   at SpaceWizards.RsiLib.RSI.Rsi.SaveToFolder(String rsiFolder) in /home/runner/work/RSIEdit/RSIEdit/RSI.NET/SpaceWizards.RsiLib/RSI/Rsi.cs:line 108
   at Editor.ViewModels.RsiItemViewModel.Save() in /home/runner/work/RSIEdit/RSIEdit/Editor/ViewModels/RsiItemViewModel.cs:line 628
   at Editor.ViewModels.MainWindowViewModel.Save() in /home/runner/work/RSIEdit/RSIEdit/Editor/ViewModels/MainWindowViewModel.cs:line 268
   at Avalonia.Data.Converters.MethodToCommandConverter.Execute(Object parameter) in /_/src/Avalonia.Base/Data/Converters/MethodToCommandConverter.cs:line 82
   at Avalonia.Input.KeyBinding.TryHandle(KeyEventArgs args) in /_/src/Avalonia.Input/KeyBinding.cs:line 41
   at Avalonia.Input.KeyboardDevice.ProcessRawEvent(RawInputEventArgs e) in /_/src/Avalonia.Input/KeyboardDevice.cs:line 241
   at Avalonia.Input.InputManager.ProcessInput(RawInputEventArgs e) in /_/src/Avalonia.Input/InputManager.cs:line 37
   at Avalonia.Win32.WindowImpl.AppWndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in /_/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs:line 524
   at Avalonia.Win32.WindowImpl.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in /_/src/Windows/Avalonia.Win32/WindowImpl.WndProc.cs:line 33
   at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
   at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken) in /_/src/Windows/Avalonia.Win32/Win32Platform.cs:line 210
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) in /_/src/Avalonia.Base/Threading/Dispatcher.cs:line 65
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 120
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 209
   at Editor.Program.Main(String[] args) in /home/runner/work/RSIEdit/RSIEdit/Editor/Program.cs:line 20
@ShadowCommander ShadowCommander changed the title Crash when saving an RSI that is missing a sprite Crash when saving an RSI that is missing a png Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant