Cannot view thumbnail of wallpapers

Bug #227611 reported by cathyli
4
Affects Status Importance Assigned to Milestone
Moblin Applets
Fix Released
Medium
ToddBrandt
Ubuntu Mobile Edition
Fix Released
Medium
Unassigned

Bug Description

Description:
----------------
Cannot view thumbnail of wallpapers, it only shows file name.Found the issue in moblin-applets 0.59-0ubuntu1.

Reproduced steps:
----------------
1. Launch photo from "multimedia" category then close, and you will find /home/ume/media/photo folder generated.
2. Copy some photos to /home/ume/media/photo/, launch photo again, you will see thumbnails of these photos.
3. Launch Desktop background from "Preferences" category.

Expect result:
----------------
In step3, it should show thumbnail of each wallpaper, only show file name.

Current result:
----------------
In step3, no thumbnail for each wallpaper, only show file name.

cathyli (cathy-li)
Changed in moblin-applets:
assignee: nobody → todd-e-brandt
importance: Undecided → Medium
Revision history for this message
ToddBrandt (todd-e-brandt) wrote :

It's supposed to populate in layers, first the text only entries, then the thumbnails. This makes the load go faster. However I just reproduced the error. The thumbnails are populating but they are invisible. I'll root cause it.

Chris Gregan (cgregan)
Changed in ubuntu-mobile:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
ToddBrandt (todd-e-brandt) wrote :

I've tried reproducing the behavior and I see it in every package from 0.55 to the latest (I didn't test any earlier than 0.55). Something outside moblin-applets has changed and messed up the background applet. I'm going to look at the gnome-control-center code to see if they had to make any changes to work with libgnomeui (the library where the busted function is).

Changed in moblin-applets:
status: New → Confirmed
Revision history for this message
ToddBrandt (todd-e-brandt) wrote :

Ok, the problem comes down to this. When libgnomeui-2.20.0 was used (in gutsy and early hardy), the gnome_thumbnail_factory_generate_thumbnail function worked to generate a thumbnail from an image file. However when the libgnomeui package was upgraded to libgnomeui-2.22.1.0, the gnome_thumbnail_factory_generate_thumbnail function suddenly and inexplicable began to fail.

When I looked at the new gnome-control-center (2.22.1, where moblin-applets is based on 2.18.0), I found first that they've merged the font, background, and theme applets into a single applet called "appearance". But the functionality is largely same, except in place of the gnome_thumbnail_factory_generate_thumbnail calls they use a single all-inclusive function called: gnome_bg_create_thumbnail, which is intended to do all the stuff that the background applet's gnome_wp_item_get_thumbnail function did in a single call. I tried upgrading moblin-background to this method and I discovered that it worked, but the performance dropped to about a tenth its former value. So I decided not to follow gnome's lead and to find a solution for our existing method.

After trying to dig through the libgnomeui library code and root cause the problem I gave up in favor of simply replacing this gnome_thumbnail_factory_generate_thumbnail call with the lower level gdk_pixbuf_new_from_file_at_size call. I've tested this arrangement and, lo and behold, it works and just as fast as before.

So now, before I commit this change, I'm seeing what other gnome overhead I can trim out to make this applet even better.

Changed in moblin-applets:
milestone: none → m11
Revision history for this message
ToddBrandt (todd-e-brandt) wrote :

Fix committed to moblin-applets 0.64, it will be online in the PPA in about an hour

Changed in moblin-applets:
status: Confirmed → Fix Released
Revision history for this message
ToddBrandt (todd-e-brandt) wrote :

I also optimized the first load phase so that the whole process will be less intrusive to the user. Basically this is how it works:

On shortcut click, the GUI is created and the treeview is empty.

Pre Phase 1: the background color, cancel, and ok buttons are usable. If the user wants to leave, they can, or if they want to change the background color and leave, they can.

Phase 1: Spawned in a thread and doesn't affect the GUI. Takes about 1 second for 4000 images. The gconf keys are searched to determine what directories to look at to find images. Only the directory entries themselves are read and a master list of image file names/paths is created.

Phase 2: Run in the main thread, so the GUI is temporarily unresponsive. Takes about 1/5 of a second for 4000 images. The image list created in phase 1 is added to the GUI's treeview. Each entry has the text name of the image file, and a note saying "Thumbnail loading...". A vertical scrollbar is also added if there are more than 20 images.

Phase 3: Spawned in a thread and doesn't affect the GUI. While this thread runs, in addition to the pre-phase 1 features, the user can change the background by touching any of the entries in the list. This phase is the longest taking anywhere from 10-20 seconds for 4000 images. Here all the image files are read, their height/width and type info are retrieved, and thumbnails are created for each. When this phase is complete a list exists in memory with all this data for every image file.

Phase 4: Run in the main thread, so the GUI is temporarily unresponsive. Takes about 1/2 a second for 4000 images. The thumbnail and description list created in phase 3 is added to the GUI's treeview. Each entry now has a thumbnail, a name, a type, and dimensions. After this phase the dialog is done loading and the user now has a full list of all the images.

All in all the background applet now functions better than the moblin-media photo viewer. It takes less time and is easier to use. It's also faster than the gnome-control-center alternative.

cathyli (cathy-li)
Changed in moblin-applets:
status: Fix Released → Fix Committed
Revision history for this message
cathyli (cathy-li) wrote :

Verified in applets 0.64, can view thumbnail of wallpapers, furthermore, wallpaper added to wallpaper without launching photo firstly, close the issue.

Changed in moblin-applets:
status: Fix Committed → Fix Released
Revision history for this message
Emmet Hikory (persia) wrote :

Fix included in Ubuntu Mobile builds since inclusion of moblin-applets 0.64-0ubuntu1

Changed in ubuntu-mobile:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.