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' % (new_width, new_height)) # Feature #2634; display the mouse-selectable regions. # See the large block at the top of this function where @@ -1374,17 +1396,15 @@ class MediaPage(BasePage): # display the image of.write('\t\t\t') - if scale != 1.0: - of.write('' % url) - of.write('%s' % (width, height, url, html_escape(self.page_title))) - if scale != 1.0: + if initial_image_path != newpath: + of.write('' % self.report.build_url_fname(newpath, None, self.up)) + of.write('%s' % (new_width, new_height, url, html_escape(self.page_title))) + if initial_image_path != newpath: of.write('') of.write('\n') 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.