commit 26c0bb9bea487c7d1a3ab4583e1e131581ebae97
Author: Georg Baum <b...@lyx.org>
Date:   Thu Jul 7 21:45:12 2016 +0200

    Export svg in xhtml, not svgz (bug 10160)
    
    LyX did not distinguish compressed and uncompressed svg files previously.
    Therefore XHTML export of vector graphics did use svgz images directly, 
which
    is not supported by browsers. If svg and svgz are treated as two formats 
then
    all works fine. This is also consistent with the loadable image formats
    reported by qt: It reports both svg and svgz.
    The gunzip dependency in converters is not new (it is already used 
internally),
    but the gzip dependency is new, so it might not be available on windows.
    This is not important at the moment, since we do not yet need to convert svg
    to svgz, I only added the converter for completeness.
---
 lib/configure.py |   18 ++++++++++++++----
 status.22x       |    2 ++
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/lib/configure.py b/lib/configure.py
index 3d54423..8b0c563 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -581,7 +581,8 @@ def checkFormatEntries(dtl_tools):
         rc_entry = [r'\Format fen        fen     FEN                    "" 
"%%"        "%%"    ""      ""'])
     #
     checkViewerEditor('a SVG viewer and editor', [inkscape_name],
-        rc_entry = [r'\Format svg        "svg, svgz" SVG                "" 
"%%" "%%"   "vector,zipped=native"  "image/svg+xml"'],
+        rc_entry = [r'''\Format svg        "svg" SVG                "" "%%" 
"%%"       "vector"        "image/svg+xml"
+\Format svgz       "svgz" "SVG (compressed)" "" "%%" "%%"      
"vector,zipped=native"  ""'''],
         path = [inkscape_path])
     #
     imageformats = r'''\Format bmp        bmp     BMP                    "" 
"%s"       "%s"    ""      "image/x-bmp"
@@ -978,18 +979,27 @@ def checkConverterEntries():
     # odg->png and odg->pdf converters, since the bb would be too large as 
well.
     checkProg('an OpenDocument -> EPS converter', ['libreoffice -headless 
-nologo -convert-to eps $$i', 'unoconv -f eps --stdout $$i > $$o'],
         rc_entry = [ r'\converter odg        eps2       "%%"   ""'])
+    #
+    checkProg('a SVG (compressed) -> SVG converter', ['gunzip -c $$i > $$o'],
+        rc_entry = [ r'\converter svgz       svg        "%%"   ""'])
+    #
+    checkProg('a SVG -> SVG (compressed) converter', ['gzip -c $$i > $$o'],
+        rc_entry = [ r'\converter svg        svgz       "%%"   ""'])
     # Only define a converter to pdf6 for graphics
     # Prefer rsvg-convert over inkscape since it is faster (see 
http://www.lyx.org/trac/ticket/9891)
     checkProg('a SVG -> PDF converter', ['rsvg-convert -f pdf -o $$o $$i', 
inkscape_name + ' --file=$$i --export-area-drawing --without-gui 
--export-pdf=$$o'],
-        rc_entry = [ r'\converter svg        pdf6       "%%"    ""'],
+        rc_entry = [ r'''\converter svg        pdf6       "%%"    ""
+\converter svgz       pdf6       "%%"    ""'''],
         path = ['', inkscape_path])
     #
     checkProg('a SVG -> EPS converter', ['rsvg-convert -f ps -o $$o $$i', 
inkscape_name + ' --file=$$i --export-area-drawing --without-gui 
--export-eps=$$o'],
-        rc_entry = [ r'\converter svg        eps        "%%"    ""'],
+        rc_entry = [ r'''\converter svg        eps        "%%"    ""
+\converter svgz       eps        "%%"    ""'''],
         path = ['', inkscape_path])
     #
     checkProg('a SVG -> PNG converter', ['rsvg-convert -f png -o $$o $$i', 
inkscape_name + ' --without-gui --file=$$i --export-png=$$o'],
-        rc_entry = [ r'\converter svg        png        "%%"    ""'],
+        rc_entry = [ r'''\converter svg        png        "%%"    "",
+\converter svgz       png        "%%"    ""'''],
         path = ['', inkscape_path])
 
     #
diff --git a/status.22x b/status.22x
index dd7c297..0da23a5 100644
--- a/status.22x
+++ b/status.22x
@@ -77,6 +77,8 @@ What's new
 
 - Make sure we output all XHTML table cells, even the empty ones (bug 10153).
 
+- .svgz images are now converted to .svg for XHTML export (bug 10160).
+
 - Ask where to export file if not yet saved (bug 8814).
 
 - Fix size issue with outliner icons on HiDPI monitors (bug 10125).

Reply via email to