Opened 4 months ago
Last modified 3 months ago
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...
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.
I noticed that I should modify the defs file instead, but you get the idea.
Hrm that's not so nice when the documentation clearly says that the function should be there...
Thanks for the bug report. damage_pixels() is now wrapped in r551.
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.
You are right. I made the fix for the rounding issue in r560 which should solve it. Also see example program in r563.