Ticket #24 (closed: fixed)

Opened 4 months ago

Last modified 3 months ago

no damage_pixels?

Reported by: guest Assigned to:
Keywords: Cc:

Description

I am trying to load an image progressively, and I think I need to use damage_pixels for this.

But, using the SVN version, I get this: AttributeError: 'ImageView' object has no attribute 'damage_pixels'

grep damage pygtkimageview/src/* gives no results...

Attachments

patch (2.1 kB) - added by guest on 08/03/08 10:38:08.

Change History

08/03/08 10:37:15 changed by guest

I added a simple wrapper for gtk_image_view_damage_pixels, using pygdk_rectangle_from_pyobject.

The problem is, apparently PixbufLoader's area-updated fires for every scanline. Coupled with the workaround for the zoom bug that doesn't seem very efficient (so I disabled that... maybe you could make it optional?). Plus, it causes gtk_image_view_image_to_widget_rect to give 0 height rectangles when zoom < 1 (I simply add 1 to zoom_rect.width/height to fix this).

It works very nicely now.

08/03/08 10:38:08 changed by guest

  • attachment patch added.

08/11/08 09:18:08 changed by guest

I noticed that I should modify the defs file instead, but you get the idea.

08/23/08 20:34:45 changed by bjourne

Hrm that's not so nice when the documentation clearly says that the function should be there...

08/23/08 21:28:54 changed by bjourne

  • status changed from new to closed.
  • resolution set to fixed.

Thanks for the bug report. damage_pixels() is now wrapped in r551.

08/25/08 17:28:37 changed by guest

  • status changed from closed to reopened.
  • resolution deleted.

Thank you.

You seem to have overlooked the gtk_image_view_image_to_widget_rect bugreport (probably my bad for not submitting it separately, and for adding a broken patch). The problem is here:

rect_in->width * zoom,
rect_in->height * zoom

If width or height == 1 and zoom < 1.0, the result is 0 because it rounds down. Adding 1 to the resulting values fixes the issue.

08/31/08 21:04:38 changed by bjourne

  • status changed from reopened to closed.
  • resolution set to fixed.

You are right. I made the fix for the rounding issue in r560 which should solve it. Also see example program in r563.