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 351991 - control-center background capplet thumbnails can get stale
control-center background capplet thumbnails can get stale
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Background
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Rodney Dawes
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-08-18 21:50 UTC by Ray Strode [halfline]
Modified: 2007-01-08 18:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
remove some code that looks fishy (1.34 KB, patch)
2006-08-18 21:55 UTC, Ray Strode [halfline]
none Details | Review
speed things up a bit (1.86 KB, patch)
2006-08-22 15:00 UTC, Ray Strode [halfline]
needs-work Details | Review
a better patch (4.75 KB, patch)
2006-11-16 04:36 UTC, Ray Strode [halfline]
committed Details | Review

Description Ray Strode [halfline] 2006-08-18 21:50:18 UTC
Occasionally the thumbnails in the background capplet are of old copies of images   on the system.
Comment 1 Ray Strode [halfline] 2006-08-18 21:55:39 UTC
Created attachment 71194 [details] [review]
remove some code that looks fishy

I briefly scanned throug the code and noticed this bit:

>     new->thumburi = gnome_thumbnail_factory_lookup (thumbs,
>                                                    escaped_path,
>                                                    info->mtime);
>    if (new->thumburi == NULL) {
>      gchar * md5sum;
>
>      md5sum = gnome_thumbnail_md5 (escaped_path);
>
>      new->thumburi = g_strconcat (g_get_home_dir (),
>                                  "/.thumbnails/normal/",
>                                  md5sum,
>                                  ".png",
>                                  NULL);
>
>      g_free (md5sum);
>    }

It seems wrong because if the mtime doesn't match it will pull a stale thumbnail from the cache.
Comment 2 Ray Strode [halfline] 2006-08-22 15:00:47 UTC
Created attachment 71371 [details] [review]
speed things up a bit

attachment 71194 [details] [review] makes things load quite a bit slower because it rethumbnails each image several times.  This one works better.
Comment 3 Rodrigo Moya 2006-08-22 15:08:21 UTC
The patch looks good to me. Rodney, does it for you?
Comment 4 Rodney Dawes 2006-08-22 15:19:02 UTC
Not really. It just doesn't seem right to me. I'll have to actually go look at the full code I wrote for thumbnailing, again first.
Comment 5 Ray Strode [halfline] 2006-11-15 19:25:21 UTC
Hi Rodney,

any progress on your review?
Comment 6 Ray Strode [halfline] 2006-11-15 20:52:56 UTC
So one obvious problem with this patch looking back at it, is that I try to use the escaped_path variable immediately after freeing it.
Comment 7 Ray Strode [halfline] 2006-11-16 04:36:41 UTC
Created attachment 76694 [details] [review]
a better patch

So this patch 
1) removes the code that tries to pull from ~/.thumbnails directly                 without checking mtime
2) will only generate a new thumbnail if a lookup shows there isn't one already
3) reloads the thumbnail after saving it to pick up any metadata it added to the image
4) never loads a full background just to find out its size
5) moves a g_object_unref (pixbuf) so that it won't ever get passed NULL
Comment 8 Rodney Dawes 2007-01-08 17:42:46 UTC
Looks ok now. Please commit this Ray. Thanks.
Comment 9 Rodrigo Moya 2007-01-08 18:27:49 UTC
Patch committed