Opened 9 years ago

Closed 9 years ago

#3509 closed defect (fixed)

Paint OS8 - invert colors tears image

Reported by: tonyforster Owned by: humitos
Priority: Unspecified by Maintainer Milestone: Unspecified
Component: Paint Version: Unspecified
Severity: Unspecified Keywords: 12.1.0
Cc: humitos Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description

OS8 XO-1.75

select an area and apply the invert colors tool, the image becomes skewed, looks like its got the number of pixels per row wrong

Attachments (2)

paint-invert-colors.jpeg (99.7 KB) - added by humitos 9 years ago.
0001-Avoid-using-numpy-1.6.1-in-invert_colors-function.patch (1.9 KB) - added by humitos 9 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 9 years ago by tonyforster

  • Component changed from untriaged to Paint
  • Owner set to godiard

comment:2 Changed 9 years ago by humitos

It works for me in jhbuild with git version of Paint.

Changed 9 years ago by humitos

comment:3 Changed 9 years ago by humitos

  • Cc humitos added

I could reproduce this bug in XO 1.5 12.1.0 with git version of Paint

comment:4 follow-up: Changed 9 years ago by godiard

Can be a bug related in any way to different selections?

There are no differences in the fill code between the v42 and git HEAD

comment:5 in reply to: ↑ 4 Changed 9 years ago by humitos

Replying to godiard:

Can be a bug related in any way to different selections?

I don't think. I tested it several times in XO and sugar-jhbuild. In XO I always had the problem.

I think it's related with some version of a library. We are using:

  • numpy / string
  • gtk.gdk.Pixbuf
  • gtk.gdk.pixbuf_new_from_array / gtk.gdk.pixbuf_new_from_data
  • gtk.gdk.COLORSPACE_RGB
  • gtk.gdk.RGB_DITHER_NORMAL

I would compare versions of those libs.

comment:6 Changed 9 years ago by humitos

Tested again with the correct version of the Git Repository. Same results.

comment:7 Changed 9 years ago by humitos

numpy:

  • jhbuild: 1.5.1
  • XO 1.5 12.1.0: 1.6.1

After upgrading the "numpy" version in my jhbuild to "1.6.1" I can reproduce the error on my jhbuild instance.

So, it's a library version problem. numpy 1.6.1 has a bug.

Here is the function that uses numpy:

What should we do in this case?

comment:8 follow-up: Changed 9 years ago by humitos

  • cat ~/.sugar/default/logs/org.laptop.Oficina-6.log
    /home/humitos/Activities/Paint.activity/Desenho.py:660: GtkWarning: _gdk_pixmap_new: assertion `(width != 0) && (height != 0)' failed
      widget.pixmap_sel = gtk.gdk.Pixmap(widget.window, dx, dy, -1)
    Traceback (most recent call last):
      File "/home/humitos/Activities/Paint.activity/Area.py", line 591, in mouseup
        self.d.selection(widget, coords, False)
      File "/home/humitos/Activities/Paint.activity/Desenho.py", line 660, in selection
        widget.pixmap_sel = gtk.gdk.Pixmap(widget.window, dx, dy, -1)
    RuntimeError: could not create GdkPixmap object
    

comment:9 Changed 9 years ago by humitos

  • Owner changed from godiard to humitos
  • Status changed from new to accepted

comment:10 in reply to: ↑ 8 Changed 9 years ago by humitos

Replying to humitos:

  • cat ~/.sugar/default/logs/org.laptop.Oficina-6.log
    ----
    RuntimeError: could not create GdkPixmap object
    

This error happens when you click with the "selection" tool and release the button without moving the mouse. But it isn't related with the invert colors issue

comment:11 Changed 9 years ago by humitos

There are two ways to do the inversion: using string and using numpy. The "string" version works properly. Maybe we can just comment the numpy version if we are going to release a new version of sugar in the following days.

comment:12 Changed 9 years ago by godiard

  • Keywords 12.1.0 added
  • Resolution set to fixed
  • Status changed from accepted to closed

Thanks humitos, pushed as cc044ab4fa08b8e0e143f251ef634322e4f81b40

Available in Paint 43

Note: See TracTickets for help on using tickets.