GNOME Bugzilla – Bug 317641
eog doesn't refresh image section (small bug)
Last modified: 2006-01-10 04:29:03 UTC
This bug has been opened here: https://bugzilla.ubuntu.com/show_bug.cgi?id=15620 "A tiny inaccuracy (in the refresh-handling?): When opening http://tweakers.net/g/px.gif (1x1 pixel image) with eog, a very small window is shown. Upon enlarging the window, the part of the window where the image is to be shown gets really messy. See the screenshot. Zooming fixes this, resizing from large window to small and back again messes it up again. See the screenshot in the URL. eog version 2.12.0. http://atlas.et.tudelft.nl/1200348/pub/bugs/eog.png"
I confirm this bug in EOG 2.12.0.
The problem here is that the redrawing function paint_rectangle() is aborted at the beginning because of the following assertion at eog-scroll-view.c:475 if (scaled_width <= 1 || scaled_height <= 1) return; scaled_{width,height} have values <= 1 at zoom levels <= 100%. But I don't know if the check can be removed painlessly.
Created attachment 54351 [details] [review] propossed patch Checking if the scaled width and height are strictly less than 1 fixes the bug.
It's still failing when the zoom falls below 50%, because scaled_{width,height} are then rounded down to 0.
Created attachment 54400 [details] [review] enhanced patch I enhanced Claudio Saavedra's patch a bit. When scaled_width or _height now become 0 (-> the image isn't visible anymore) the background is redrawn before exiting paint_rectangle().
Yes, Felix patch fixes completely the bug. But I wonder, it's ok to allow users to keep on zooming down even when the image is no longer visible? I am not sure about it.
Yes, this could be a way, too. It could be implemented as a lock prohibiting zooming below 1px (width || height). It's quite pointless to zoom a 1px image out to 50%(or just 99%) as the result is still 1 px wide. But this would require EOG's zoom levels to be constant or easily calculable (don't know how this is done currently).
Created attachment 54742 [details] [review] even more enhanced patch with zoom lock Okay, I made a patch implementing the idea with the minimum zoom prohibition. It calculates a minimum zoom factor for the image and stops zooming out once it's reached (with mouse or keyboard). This patch should be HEAD-only, the smaller patch above (patch 54400) should be good for stable.
Poking... Lucas, Ok to commit patch #54400 in gnome-2.12 branch? I think it is a plausible fix without changing API nor the eog behauvior.
Patch #54400 applied in gnome-2-12 branch. Thanks dudes! 2005-12-20 Lucas Rocha <lucasr@gnome.org> * libeog/eog-scroll-view.c (paint_rectangle): refresh image section for very small images (Fixes bug #317641). Patch from Felix Riemann <felix@hsgheli.de> with contribution from Claudio Saavedra <csaavedra@alumnos.utalca.cl>. I'll revise patch #54742 and commit it (if it's ok) soon.
*** Bug 325222 has been marked as a duplicate of this bug. ***
Ok, applied in HEAD. Thanks dudes! 2006-01-10 Lucas Rocha <lucasr@gnome.org> * libeog/eog-scroll-view.c (paint_rectangle, set_minimum_zoom_factor, set_zoom, set_zoom_fit, eog_scroll_view_get_zoom_is_min, eog_scroll_view_instance_init): refresh image section for very small images (Fixes bug #317641). Also, the zoom out is locked when the image gets 1px wide. Patch from Felix Riemann <felix@hsgheli.de> with contribution from Claudio Saavedra <csaavedra@alumnos.utalca.cl>.