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 479423 - 100% CPU on some photos/zoom levels
100% CPU on some photos/zoom levels
Status: VERIFIED FIXED
Product: f-spot
Classification: Other
Component: Browsing
SVN
Other Linux
: Normal normal
: ---
Assigned To: F-spot maintainers
F-spot maintainers
Depends on:
Blocks:
 
 
Reported: 2007-09-23 03:41 UTC by Wade Menard
Modified: 2007-09-26 10:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
avoid infinite loop if thumbnail is 1px too small. (818 bytes, patch)
2007-09-23 03:43 UTC, Wade Menard
reviewed Details | Review

Description Wade Menard 2007-09-23 03:41:59 UTC
This /was/ going to be a report about how the two photos linked below were causing me 100% CPU usage when their thumbnails were onscreen.

http://www.geekport.com/files/sf-wadesnow.jpg
http://www.geekport.com/files/walt_concept_map.jpg

Scrolling those particular image thumbnails offscreen and the CPU went back to normal. However as I was writing the report I noticed that zooming made f-spot happy and the CPU return to idle.

You should be able to reproduce this but importing one of those images, giving it a unique tag and search on that tag so it's thumbnail is being viewed alone. If you aren't getting high CPU usage already, if you adjust the zoom to certain points -- usually at the exact point after the padding recalculates and the image quickly jumps to a new size -- the CPU will spike.

So a lot of --trace and WriteLines later, i've determined that there are some unlucky pixel ratio images that at certain sizes don't produce a thumbnail at exactly the size IconView wants, it's -- at those particular zoom points -- one pixel too small. IconView redraws, sees the thumbnail (still) needs updating because of the size difference, and re-requests it. Again and again. Infinite loop!

My newness to f-spot and C# means I am not sure on the best way to avoid this loop. Maybe someone can look at that section of code in IconView again to see if there is someplace else this needs to be fixed, but what I did is add two additional conditions to check for the thumbnail only being 1px too small.

Feedback welcome and let me know if I need to rephrase the steps to reproduce.
Comment 1 Wade Menard 2007-09-23 03:43:27 UTC
Created attachment 96040 [details] [review]
avoid infinite loop if thumbnail is 1px too small.
Comment 2 Christoffer Sørensen 2007-09-23 17:12:23 UTC
I can't reproduce this using latest SVN snapshot on Ubuntu 6.10 (edgy).

Could you list which OS and mono version you are using?
Comment 3 Wade Menard 2007-09-23 20:22:55 UTC
I am using Ubuntu 7.10 (Gutsy)

gnome 2.20 desktop release libs
mono            1.2.4 
gtk-sharp-2.0   2.10.2
gnome-sharp-2.0 2.16.0

I have made an Ogg Theora screencast demonstrating the bug

http://www.geekport.com/files/resize.ogg (852 KB)
Comment 4 Wade Menard 2007-09-24 08:30:15 UTC
I was able to reproduce using the same two photos on the Mono+OpenSUSE 10.2 VMWare image

f-spot 0.2.2
gnome 2.16.1 desktop libs
mono 1.2.5
gtk-sharp-2.0 2.10.2
gnome-sharp-2.0 2.16.0


Comment 5 Stephane Delcroix 2007-09-26 10:02:13 UTC
committed a slightly different version in r3410
Comment 6 Wade Menard 2007-09-26 10:08:18 UTC
Awesome. Verified Fixed! Thanks