From 089a8c4d063265be05be1726847546ceedd29073 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 21 Sep 2005 03:58:10 +0000 Subject: [PATCH] * src/ImgManip.py: update thumbnail if out of date svn: r5207 --- gramps2/ChangeLog | 3 +++ gramps2/src/ImgManip.py | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 4eba9c37d..da9ca1425 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2005-09-20 Don Allingham + * src/ImgManip.py: update thumbnail if out of date + 2005-09-20 Alex Roitman * INSTALL: Provide correct examples for the local install. * gramps.sh.in: Revert escaping the arguments, as this lumps all diff --git a/gramps2/src/ImgManip.py b/gramps2/src/ImgManip.py index 09388f692..9730039eb 100644 --- a/gramps2/src/ImgManip.py +++ b/gramps2/src/ImgManip.py @@ -142,9 +142,12 @@ def set_thumbnail_image(path,mtype=None): def get_thumbnail_image(path,mtype=None): filename = _build_thumb_path(path) - if not os.path.isfile(filename): - set_thumbnail_image(path,mtype) + try: + if not os.path.isfile(filename): + set_thumbnail_image(path,mtype) + elif os.path.getmtime(path) > os.path.getmtime(filename): + set_thumbnail_image(path,mtype) return gtk.gdk.pixbuf_new_from_file(filename) except gobject.GError: if mtype: @@ -155,6 +158,5 @@ def get_thumbnail_image(path,mtype=None): def get_thumbnail_path(path,mtype=None): filename = _build_thumb_path(path) if not os.path.isfile(filename): - print "setting",filename set_thumbnail_image(path,mtype) return filename