]> git.lyx.org Git - features.git/commitdiff
Allow SVGs in HTML output (#7441)
authorScott Kostyshak <skostysh@lyx.org>
Wed, 27 May 2015 15:25:06 +0000 (11:25 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Wed, 27 May 2015 15:25:06 +0000 (11:25 -0400)
This is only a specific part of #7441.

Patch from Julien Rioux.

src/insets/InsetGraphics.cpp

index 7e18ec67c208315d76c4cbbddfbe9887f47b00e5..25726690f8fa23247a2af4e2e873247fa1eab208 100644 (file)
@@ -119,8 +119,14 @@ string findTargetFormat(string const & format, OutputParams const & runparams)
        }
        // for HTML, we leave the known formats and otherwise convert to png
        if (runparams.flavor == OutputParams::HTML) {
+               Format const * const f = formats.getFormat(format);
+               // Convert vector graphics to svg
+               if (f && f->vectorFormat() && theConverters().isReachable(format, "svg"))
+                       return "svg";
+               // Leave the known formats alone
                if (format == "jpg" || format == "png" || format == "gif")
                        return format;
+               // Convert everything else to png
                return "png";
        }
        // If it's postscript, we always do eps.