Crop-To-Selection fails with System.DividByZeroException:Division by Zero

Bug #1244489 reported by G4JC
60
This bug affects 12 people
Affects Status Importance Assigned to Milestone
Pinta
Fix Released
High
Don McComb

Bug Description

Open or create a new image. Use rectangle select. Image > Crop to Selection. Crashes every time. Reproducible.
On x86_64 with Pinta 1.4.

Error prompts:
System.DividByZeroException:Division by Zero
at Pinta.Gui.Widgets.CellRendererSurface.RenderCell (Cario.Context g, Int32 width, Int32 height [0x00000] in <filename unknown>:0
at Pinta.Gui.Widgets.CellRenderSurface.Render (Gdk.Drawable window, Gtk.Widget widget, Rectangle backgroundArea, Rectangle cellArea, Rectangle expose Area, CellRendererState flags) [0x00000] in <filename unkown>:0
at Gtk.CellRenderer.Render_cb (IntPrt item, IntPtr window, IntPtr widget, Gdk.Rectangle& background_area, Gdk.Rectangle& cell_area, Gdk.Rectangle& expose_area, CellRendererState flags) [0x00000] <filename unknown>:0

Unhandled exception:
must be greater than 0
Parameter name: numberator.
at Pinta.Core.ScaleFactor..ctor (Int32 numerator, Int32 denominator) [0x00000] in <filename unkown>:0
at Pinta.Gui.Widgets.CanvasRenderer.Initalize (Size sourceSize, Size destinationSize) [0x00000] in <filename unknown>:0
at Pinta.Gui.Widgets.PintaCanvas.OnExposeEvent (Gdk.EventExpose e) [0x00000] in <filename unknown>:0
at Gtk.Widget.exposeevent_cb (IntPtr widget, IntPtr evnt) [0x00000] in <filename unkown>:0

Revision history for this message
grofaty (grofaty) wrote :

Can you please install 1.5 development release. It is very stable and near production release. Download from: https://groups.google.com/forum/?hl=en&fromgroups=#!topic/pinta/fUttSBGPBRU (first post in thread) and install.

Please also write what is your operating system name and version.

Revision history for this message
G4JC (gaming4jc2) wrote :

Parabola (Arch) Linux 3.10.17-1-LIBRE-LTS x86_64.

Partially fixed but still able to reproduce in latest git:
https://aur.archlinux.org/packages.php?ID=34391

Error log occurs when using Circle Select Tool > Image > Crop to Selection.
Attaching newer log.

Changed in pinta:
importance: Undecided → High
milestone: none → 1.6
status: New → Confirmed
Revision history for this message
Mike Slinn (mslinn) wrote :

This bit me too, exactly as previously reported

Revision history for this message
Stano Paska (stano-paska) wrote :

Me too
System.DivideByZeroException: Division by zero
  at Pinta.Gui.Widgets.CellRendererSurface.RenderCell (Cairo.Context g, Int32 width, Int32 height) [0x00000] in <filename unknown>:0
  at Pinta.Gui.Widgets.CellRendererSurface.Render (Gdk.Drawable window, Gtk.Widget widget, Rectangle backgroundArea, Rectangle cellArea, Rectangle exposeArea, CellRendererState flags) [0x00000] in <filename unknown>:0
  at Gtk.CellRenderer.Render_cb (IntPtr item, IntPtr window, IntPtr widget, Gdk.Rectangle& background_area, Gdk.Rectangle& cell_area, Gdk.Rectangle& expose_area, CellRendererState flags) [0x00000] in <filename unknown>:0

and

System.ArgumentOutOfRangeException: must be greater than 0
Parameter name: numerator
  at Pinta.Core.ScaleFactor..ctor (Int32 numerator, Int32 denominator) [0x00000] in <filename unknown>:0
  at Pinta.Gui.Widgets.CanvasRenderer.Initialize (Size sourceSize, Size destinationSize) [0x00000] in <filename unknown>:0
  at Pinta.Gui.Widgets.PintaCanvas.OnExposeEvent (Gdk.EventExpose e) [0x00000] in <filename unknown>:0
  at Gtk.Widget.exposeevent_cb (IntPtr widget, IntPtr evnt) [0x00000] in <filename unknown>:0

Ubuntu 14.04, Pinta 1.3 from repistory

Revision history for this message
WinEunuchs2Unix (ricklee518) wrote :

Same problem. Ironically the reason for downloading Pinta tonight was to crop a picture.

Don McComb (don-mccomb)
Changed in pinta:
assignee: nobody → Don McComb (don-mccomb)
status: Confirmed → In Progress
Revision history for this message
Cameron White (cameronwhite91) wrote :

As with bug #1313773, I cannot reproduce this with the latest daily build of 1.6. If you're a Ubuntu user, please try installing the latest build from https://launchpad.net/~pinta-maintainers/+archive/ubuntu/pinta-daily to verify.

Changed in pinta:
status: In Progress → Fix Committed
Revision history for this message
André Peters (andryyy) wrote :

Yes, this was fixed in 1.6 a while ago.

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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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