Comment 1 for bug 1191390

Revision history for this message
grofaty (grofaty) wrote :

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.