I managed to reproduce the crash on master on Windows XP:
1. New image.
2. Pencil from Tools and on canvas just click to create one dot.
3. Image | Auto crop and crash appears with the following error:
=============
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DivideByZeroException: Attempted to divide by zero.
at Pinta.Core.DocumentWorkspace.set_Scale(Double value) in c:\Zaloga\Pinta-master\Pinta.Core\Classes\DocumentWorkspace.cs:line 100
at Pinta.Core.ImageActions.CropImageToRectangle(Document doc, Rectangle rect) in c:\Zaloga\Pinta-master\Pinta.Core\Actions\ImageActions.cs:line 286
at Pinta.Core.ImageActions.HandlePintaCoreActionsImageAutoCropActivated(Object sender, EventArgs e) in c:\Zaloga\Pinta-master\Pinta.Core\Actions\ImageActions.cs:line 268
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at GLib.Signal.ClosureInvokedCB(Object o, ClosureInvokedArgs args)
at GLib.SignalClosure.Invoke(ClosureInvokedArgs args)
at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
=============
P.S. I am removing easy-to-fix tag. This code requires some knowledge how auto crop works and easy-to-fix is tag for total beginners.
I managed to reproduce the crash on master on Windows XP: Reflection. TargetInvocatio nException: Exception has been thrown by the target of an invocation. ---> System. DivideByZeroExc eption: Attempted to divide by zero. DocumentWorkspa ce.set_ Scale(Double value) in c:\Zaloga\ Pinta-master\ Pinta.Core\ Classes\ DocumentWorkspa ce.cs:line 100 ImageActions. CropImageToRect angle(Document doc, Rectangle rect) in c:\Zaloga\ Pinta-master\ Pinta.Core\ Actions\ ImageActions. cs:line 286 ImageActions. HandlePintaCore ActionsImageAut oCropActivated( Object sender, EventArgs e) in c:\Zaloga\ Pinta-master\ Pinta.Core\ Actions\ ImageActions. cs:line 268 RuntimeMethodHa ndle._InvokeMet hodFast( IRuntimeMethodI nfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) RuntimeMethodHa ndle.InvokeMeth odFast( IRuntimeMethodI nfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) Reflection. RuntimeMethodIn fo.Invoke( Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityC hecks) Delegate. DynamicInvokeIm pl(Object[ ] args) ClosureInvokedC B(Object o, ClosureInvokedArgs args) ure.Invoke( ClosureInvokedA rgs args) ure.MarshalCall back(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
1. New image.
2. Pencil from Tools and on canvas just click to create one dot.
3. Image | Auto crop and crash appears with the following error:
=============
System.
at Pinta.Core.
at Pinta.Core.
at Pinta.Core.
--- End of inner exception stack trace ---
at System.
at System.
at System.
at System.
at GLib.Signal.
at GLib.SignalClos
at GLib.SignalClos
=============
P.S. I am removing easy-to-fix tag. This code requires some knowledge how auto crop works and easy-to-fix is tag for total beginners.