From 2b1606a6628c5a24df264c15613491e8a4c16b23 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 23 Feb 2002 00:59:19 +0000 Subject: [PATCH] Error checking for PIL thumbnail svn: r792 --- src/RelImage.py | 10 ++++++++-- src/gramps.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/RelImage.py b/src/RelImage.py index 33f9f565c..3ed68639a 100644 --- a/src/RelImage.py +++ b/src/RelImage.py @@ -85,7 +85,7 @@ def import_media_object(filename,path,base): try: shutil.copy(filename,name) except IOError,msg: - GnomeErrorDialog(_("Error copying %s") + "\n" + msg) + GnomeErrorDialog(_("Error copying %s") % filename + "\n" + msg) return "" else: @@ -129,6 +129,10 @@ def scale_image(path,size): #------------------------------------------------------------------------- def mk_thumb(source,dest,size): dir = os.path.dirname(dest) + + source = os.path.normpath(source) + dest = os.path.normpath(dest) + try: if not os.path.exists(dir): os.mkdir(dir) @@ -154,7 +158,9 @@ def mk_thumb(source,dest,size): img = ImgManip.ImgManip(source) img.jpg_thumbnail(dest,size,size) except: - GnomeErrorDialog(_("Could not create a thumbnail for %s") % source) + import sys + msg = "%s\n%s %s" % (source,sys.exc_type,sys.exc_value) + GnomeErrorDialog(_("Could not create a thumbnail for %s") % msg) return #------------------------------------------------------------------------- diff --git a/src/gramps.py b/src/gramps.py index bde2a8278..9e0d587a0 100755 --- a/src/gramps.py +++ b/src/gramps.py @@ -31,7 +31,7 @@ try: import StartupDialog if StartupDialog.need_to_run(): - StartupDialog.StartupDialog(gramps_main.main,arg) + StartupDialog.StartupDialog(gramps_main.Gramps,arg) else: gramps_main.Gramps(arg) except: