From 6bd5263405340b00ddd14305f697f99240696cea Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Sat, 4 Jun 2016 09:09:33 +0200 Subject: [PATCH] Work around limited SVG support (bug #9778) Qt only supports SVG 1.2 tiny, so we prefer to convert on our own if an explicit converter is defined and the converter cache is used (otherwise the conversion would be too expensive). --- src/frontends/qt4/GuiApplication.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 1513636867..7d6ca0b730 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -35,6 +35,7 @@ #include "BufferView.h" #include "CmdDef.h" #include "Color.h" +#include "Converter.h" #include "CutAndPaste.h" #include "ErrorList.h" #include "Font.h" @@ -246,6 +247,16 @@ vector loadableImageFormats() if (jpeg_found) continue; } + else if (lyxrc.use_converter_cache && + (ext == "svg" || ext == "svgz") && + theConverters().isReachable("svg", "png")) + // Qt only supports SVG 1.2 tiny. See #9778. We prefer displaying + // the SVG as in the output. However we require that the converter + // cache is enabled since this is expensive. We also require that + // an explicit svg->png converter is defined, since the default + // converter could produce bad quality as well. This assumes that + // png can always be loaded. + continue; fmts.push_back(ext); } -- 2.39.5