Copy/paste between two images and crop crashes the Pinta

Bug #1179280 reported by grofaty
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Pinta
Fix Released
Medium
Cameron White

Bug Description

Pinta latest development pinta-1.5-preview-20130512 on Windows XP:
1. Open Pinta and leave new image opened.
2. Create a print-screen and paste it into new image with CTRL+ALT+V.
3. Rectangle Select and mark some are on canvas.
4. Copy market area in clipboard by CTRL+C.
5. In Images pad click on first image (from step 1).
6. Paste the image with CTRL+V.
7. Move Selected Pixels is automatically selected, click on pasted image selection and move the mouse to move the pasted image.
8. Click Crop to selection from toolbar. 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)
   at Pinta.Core.ImageActions.CropImageToRectangle(Document doc, Rectangle rect)
   at Pinta.Core.ImageActions.HandlePintaCoreActionsImageCropToSelectionActivated(Object sender, EventArgs e)
   --- 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)
==============

Tags: crash
Revision history for this message
Cameron White (cameronwhite91) wrote :

Confirmed. It also happens if e.g. you take a screenshot, paste into a new image, and then crop to selection.

Changed in pinta:
importance: Undecided → Medium
status: New → Confirmed
tags: added: crash
Changed in pinta:
milestone: none → 1.5
Revision history for this message
Cameron White (cameronwhite91) wrote :

FYI: I tracked this down to a regression from https://github.com/PintaProject/Pinta/commit/4a2b5ce .

Revision history for this message
Cameron White (cameronwhite91) wrote :
Changed in pinta:
assignee: nobody → Cameron White (cameronwhite91)
status: Confirmed → Fix Committed
Revision history for this message
grofaty (grofaty) wrote :

Tested on master on Windows XP and I can confirm it is fixed (like reported in bug report).

Changed in pinta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.