# HG changeset patch # User nadvornik # Date 1254139475 0 # Node ID dc065c04a6887e3c278b3764442429b63e0b7725 # Parent 5276dabe836f7b9107ecc803fabab8187dbafc83 do not cache incomplete thumbnails diff -r 5276dabe836f -r dc065c04a688 src/thumb_standard.c --- a/src/thumb_standard.c Mon Sep 28 09:57:06 2009 +0000 +++ b/src/thumb_standard.c Mon Sep 28 12:04:35 2009 +0000 @@ -419,6 +419,7 @@ if (sw > cache_w || sh > cache_h || shrunk) { gint thumb_w, thumb_h; + struct stat st; if (pixbuf_scale_aspect(cache_w, cache_h, sw, sh, &thumb_w, &thumb_h)) @@ -432,7 +433,14 @@ g_object_ref(G_OBJECT(pixbuf_thumb)); } - thumb_loader_std_save(tl, pixbuf_thumb); + /* do not save the thumbnail if the source file has changed meanwhile - + the thumbnail is most probably broken */ + if (stat_utf8(tl->fd->path, &st) && + tl->source_mtime == st.st_mtime && + tl->source_size == st.st_size) + { + thumb_loader_std_save(tl, pixbuf_thumb); + } } } else if (tl->cache_hit &&