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