From b282953be5387de394b51830c0b16cabb7b49f93 Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Wed, 20 May 2009 23:26:30 +0000 Subject: [PATCH] Removed missing gladefile in src/plugins/docgen/Makefile.am for allow complete to finish. Applied large image scaling in NarrativeWeb. svn: r12554 --- src/plugins/docgen/Makefile.am | 3 +- src/plugins/webreport/NarrativeWeb.py | 77 +++++++++++++++++++-------- 2 files changed, 55 insertions(+), 25 deletions(-) diff --git a/src/plugins/docgen/Makefile.am b/src/plugins/docgen/Makefile.am index b01f9f470..5324e3e59 100644 --- a/src/plugins/docgen/Makefile.am +++ b/src/plugins/docgen/Makefile.am @@ -19,8 +19,7 @@ pkgdata_PYTHON = \ pkgpyexecdir = @pkgpyexecdir@/plugins/docgen pkgpythondir = @pkgpythondir@/plugins/docgen -GLADEFILES = \ - gtkprintpreview.glade +GLADEFILES = GRAPHICS = diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index a65800611..772cec466 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -55,6 +55,7 @@ import locale import shutil import codecs import tarfile +import tempfile import operator from TransUtils import sgettext as _ from cStringIO import StringIO @@ -115,8 +116,8 @@ _WEB_EXT = ['.html', '.htm', '.shtml', '.php', '.php3', '.cgi'] _INCLUDE_LIVING_VALUE = 99 # Arbitrary number _NAME_COL = 3 -_MAX_IMG_WIDTH = 800 # resize images that are wider than this -_MAX_IMG_HEIGHT = 600 # resize images that are taller than this +_DEFAULT_MAX_IMG_WIDTH = 800 # resize images that are wider than this (settable in options) +_DEFAULT_MAX_IMG_HEIGHT = 600 # resize images that are taller than this (settable in options) _WIDTH = 160 _HEIGHT = 50 _VGAP = 10 @@ -1339,22 +1340,43 @@ class MediaPage(BasePage): of.write('\t\t
\n') of.write('\t\t\t(%s)' % _("The file has been moved or deleted")) else: - # if the image is spectacularly large, then force the client - # to resize it, and include a "\n' % (width, height)) + url = self.report.build_url_fname(initial_image_path, None, self.up) + if initial_image_path != newpath: + of.write('

%s (%dx%d)

\n' % (_('Click on the image to see the full size version'), width, height)) + of.write('\t\t
\n\n') else: - import tempfile - dirname = tempfile.mkdtemp() thmb_path = os.path.join(dirname, "temp.png") if ThumbNails.run_thumbnailer(mime_type, @@ -3478,6 +3498,17 @@ class NavWebOptions(MenuReportOptions): nogid.set_help(_('Whether to include the Gramps ID of objects')) menu.add_option(category_name, 'nogid', nogid) + self.__maxinitialimagewidth = NumberOption(_("Max width of initial image"), _DEFAULT_MAX_IMG_WIDTH, 0, 2000) + self.__maxinitialimagewidth.set_help(_("This allows you to set the maximum width " + "of the image shown on the media page. Set to 0 for no limit.")) + menu.add_option(category_name, 'maxinitialimagewidth', + self.__maxinitialimagewidth) + self.__maxinitialimageheight = NumberOption(_("Max height of initial image"), _DEFAULT_MAX_IMG_HEIGHT, 0, 2000) + self.__maxinitialimageheight.set_help(_("This allows you to set the maximum height " + "of the image shown on the media page. Set to 0 for no limit.")) + menu.add_option(category_name, 'maxinitialimageheight', + self.__maxinitialimageheight) + def __add_privacy_options(self, menu): """ Options on the "Privacy" tab.