After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 317641 - eog doesn't refresh image section (small bug)
eog doesn't refresh image section (small bug)
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: image viewer
2.12.x
Other Linux
: Normal normal
: ---
Assigned To: EOG Maintainers
EOG Maintainers
: 325222 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-09-30 20:03 UTC by Sebastien Bacher
Modified: 2006-01-10 04:29 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
propossed patch (1.82 KB, patch)
2005-11-05 12:45 UTC, Claudio Saavedra
none Details | Review
enhanced patch (909 bytes, patch)
2005-11-06 22:53 UTC, Felix Riemann
none Details | Review
even more enhanced patch with zoom lock (3.60 KB, patch)
2005-11-14 17:09 UTC, Felix Riemann
none Details | Review

Description Sebastien Bacher 2005-09-30 20:03:24 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"
Comment 1 Lucas Rocha 2005-10-01 15:05:36 UTC
I confirm this bug in EOG 2.12.0.
Comment 2 Felix Riemann 2005-10-29 21:19:56 UTC
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.
Comment 3 Claudio Saavedra 2005-11-05 12:45:06 UTC
Created attachment 54351 [details] [review]
propossed patch

Checking if the scaled width and height are strictly less than 1 fixes the bug.
Comment 4 Felix Riemann 2005-11-05 14:46:06 UTC
It's still failing when the zoom falls below 50%, because scaled_{width,height}
are then rounded down to 0.
Comment 5 Felix Riemann 2005-11-06 22:53:48 UTC
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().
Comment 6 Claudio Saavedra 2005-11-07 21:03:48 UTC
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.
Comment 7 Felix Riemann 2005-11-10 15:29:05 UTC
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).
Comment 8 Felix Riemann 2005-11-14 17:09:00 UTC
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.
Comment 9 Claudio Saavedra 2005-12-11 00:28:19 UTC
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.
Comment 10 Lucas Rocha 2005-12-20 15:38:52 UTC
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.
Comment 11 Lucas Rocha 2006-01-06 02:27:41 UTC
*** Bug 325222 has been marked as a duplicate of this bug. ***
Comment 12 Lucas Rocha 2006-01-10 04:29:03 UTC
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>.