diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 985202117..3bab4bfb2 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2005-08-31 Martin Hawlisch + * src/ReportUtils.py (insert_images): Warn about non existing files + 2005-08-30 Alex Roitman * src/po/ru.po: Translation update for 2.0.7. diff --git a/gramps2/src/ReportUtils.py b/gramps2/src/ReportUtils.py index 57fede416..ad1216a4d 100644 --- a/gramps2/src/ReportUtils.py +++ b/gramps2/src/ReportUtils.py @@ -30,7 +30,9 @@ import Date import DateHandler import RelLib from NameDisplay import displayer as _nd +from QuestionDialog import WarningDialog import time +import os from gettext import gettext as _ #------------------------------------------------------------------------- @@ -486,7 +488,11 @@ def insert_images(database, doc, person, w_cm=4.0, h_cm=4.0): mime_type = media_object.get_mime_type() if mime_type and mime_type.startswith("image"): filename = media_object.get_path() - doc.add_media_object(filename,"row",w_cm,h_cm) + if os.path.exists(filename): + doc.add_media_object(filename,"row",w_cm,h_cm) + else: + WarningDialog(_("Could not add photo to page"), + "%s: %s" % (filename, _('File does not exist'))) #------------------------------------------------------------------------- #