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 310833 - Zoom In button in EOG can get stuck at 99%
Zoom In button in EOG can get stuck at 99%
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: image viewer
2.12.x
Other All
: Normal minor
: ---
Assigned To: EOG Maintainers
EOG Maintainers
: 332286 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-07-19 05:10 UTC by dolphinling
Modified: 2006-02-27 17:14 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
attempt to patch it (903 bytes, patch)
2006-01-24 18:49 UTC, Felix Riemann
none Details | Review
improved patch (1.17 KB, patch)
2006-01-24 19:20 UTC, Felix Riemann
none Details | Review

Description dolphinling 2005-07-19 05:10:18 UTC
Please describe the problem:
The Zoom In button in eye of gnome can get stuck at 99%. It appears to be a
rounding error coupled with one part of the program thinking it's below 100%, so
the next step is 100, while another part thinks it's already at 100, so nothing
changes.

Steps to reproduce:
1. Open a picture. 
2. Use the scroll wheel on the mouse to zoom out 6 or more times, then back in.
3. Click the Zoom In button on the toolbar or hit ctrl++. 


Actual results:
When you zoom back in, the status bar shows 99% instead of 100% as it should.
When you try to zoom in farther with the toolbar button or the keyboard, nothing
happens (the scroll wheel works fine)

Expected results:
The image should be zoomed back to 100%, not 99%, and the status bar should
correctly report that. The Zoom In button should function correctly.

Does this happen every time?
This happens every time.

Other information:
Both 2.8.2 and 2.10.0 show the problem, not tested on anything else. Gentoo
Linux, nothing strange about the builds.
Comment 1 Boris de Laage 2005-07-21 13:40:41 UTC
I can't reproduce this bug with EOG 2.10.0
Comment 2 Lucas Rocha 2005-11-18 02:40:15 UTC
I cannot reproduce this with EOG 2.13.2.
Comment 3 Lucas Rocha 2006-01-10 04:04:27 UTC
Thanks for the report. I still cannot reproduce this bug in EOG 2.13.3. It seems this problem is somewhat fixed in latest EOG releases. Closing as obsolete then.

Please feel free to reopen this bug if you can add more information (i.e. a
valid stack trace) or if you still experience this problem in latest versions.
Comment 4 dolphinling 2006-01-10 06:23:35 UTC
This still occurs in 2.12.2, which is the latest in Gentoo's portage, although the status bar now says 100% while it's stuck, not 99%.

Again, steps to reproduce:
1. Open a picture in eog
2. Zoom out with the scroll wheel 6 times (or more)
3. Zoom in with the scroll wheel 6 times (or as many as above)
4. Click the Zoom In button on the toolbar

The zoom in will not happen, but it should.

I'm using Gentoo, with Gnome 2.10.1 but eog 2.12.2. My make.conf is as follows:

CHOST="i686-pc-linux-gnu"
CFLAGS="-O3 -march=pentium4 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j2"
USE="gnome gtk2 alsa cdr jack unicode sse sse2 mmx ogg flac speex theora vorbis xvid aac win32codecs ffmpeg -kde -qt -kdexdeltas -arts -oss -evo -dvd -dvdr"

Other than that I don't know what information to give. If you make a requst, though, I can try to provide it. 
Comment 5 Felix Riemann 2006-01-22 13:13:21 UTC
I can confirm it with current HEAD (using Gentoo too though) using the steps in comment #4. You have to start at a zoom level of 100 and zoom out to at least 75% or it won't show up. When zooming in again we don't get the exact same numbers/zoom factors as when zooming out, although the difference is only at the 16th decimal place.
Comment 6 Felix Riemann 2006-01-24 18:43:43 UTC
I can trigger this bug for zooming out as well. When I start at 300% and zoom in (with my mouse) to about 402% and then back out to 300% (with mouse as well) I cannot zoom out further with my keyboard or the toolbar button. The problem is exactly the same.
Comment 7 Felix Riemann 2006-01-24 18:49:32 UTC
Created attachment 58039 [details] [review]
attempt to patch it

This patch should fix the problem for both zooming in and out.
It simply makes sure that the next zoom level chosen is far enough away (currently 1e-6) from the current level that set_zoom() will actually do something.
Comment 8 Felix Riemann 2006-01-24 19:20:49 UTC
Created attachment 58042 [details] [review]
improved patch

This one is probably better. It removes the in this case unneeded calls to fabs() and integrates itself into the existing zoom checks.
Comment 9 Felix Riemann 2006-02-06 18:41:58 UTC
I tried it with current ubuntu dapper (eog 2.13.5/2.13.90). I can reproduce it there too, so it shouldn't be a Gentoo-only problem.
Comment 10 Lucas Rocha 2006-02-27 17:12:48 UTC
Applied in HEAD and gnome-2-12 branches. Thanks!

2006-02-27  Lucas Rocha  <lucasr@gnome.org>

        * eog-scroll-view.c (eog_scroll_view_zoom_in,
        eog_scroll_view_zoom_out): correct handling of zoom
        double precision with mouse wheel (Fixes bug #310833).
        Patch from Felix Riemann <felix@hsgheli.de>.
Comment 11 Lucas Rocha 2006-02-27 17:14:20 UTC
*** Bug 332286 has been marked as a duplicate of this bug. ***