]> git.lyx.org Git - lyx.git/commitdiff
Backport fix for #9778.
authorEnrico Forestieri <forenr@lyx.org>
Sun, 15 Oct 2017 16:12:34 +0000 (12:12 -0400)
committerRichard Heck <rgheck@lyx.org>
Sun, 15 Oct 2017 16:15:52 +0000 (12:15 -0400)
From Enrico.

src/frontends/qt4/GuiApplication.cpp

index 58065585374cb39fcfdac5d6626ca3c95746d3b2..36d692650b90b83f3775fa8ed3f620e2b50c3850 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"
@@ -241,6 +242,17 @@ vector<string> loadableImageFormats()
                // special case
                if (ext == "jpeg")
                        ext = "jpg";
+               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);
        }