]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/GuiApplication.cpp
Work around limited SVG support (bug #9778)
[features.git] / src / frontends / qt4 / GuiApplication.cpp
index 1513636867f85e794d5e0557eb657256946cae11..7d6ca0b730b5147ba7ef1e08d2b7919552e3a8c6 100644 (file)
@@ -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<string> 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);
        }