* src/ImgManip.py: update thumbnail if out of date

svn: r5207
This commit is contained in:
Don Allingham 2005-09-21 03:58:10 +00:00
parent 6e5c529ba1
commit 089a8c4d06
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,6 @@
2005-09-20 Don Allingham <don@gramps-project.org>
* src/ImgManip.py: update thumbnail if out of date
2005-09-20 Alex Roitman <shura@gramps-project.org> 2005-09-20 Alex Roitman <shura@gramps-project.org>
* INSTALL: Provide correct examples for the local install. * INSTALL: Provide correct examples for the local install.
* gramps.sh.in: Revert escaping the arguments, as this lumps all * gramps.sh.in: Revert escaping the arguments, as this lumps all

View File

@ -142,9 +142,12 @@ def set_thumbnail_image(path,mtype=None):
def get_thumbnail_image(path,mtype=None): def get_thumbnail_image(path,mtype=None):
filename = _build_thumb_path(path) filename = _build_thumb_path(path)
if not os.path.isfile(filename):
set_thumbnail_image(path,mtype)
try: 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) return gtk.gdk.pixbuf_new_from_file(filename)
except gobject.GError: except gobject.GError:
if mtype: if mtype:
@ -155,6 +158,5 @@ def get_thumbnail_image(path,mtype=None):
def get_thumbnail_path(path,mtype=None): def get_thumbnail_path(path,mtype=None):
filename = _build_thumb_path(path) filename = _build_thumb_path(path)
if not os.path.isfile(filename): if not os.path.isfile(filename):
print "setting",filename
set_thumbnail_image(path,mtype) set_thumbnail_image(path,mtype)
return filename return filename