Le 16/04/2016 16:33, Guillaume Munch a écrit :
Le 15/04/2016 09:12, Scott Kostyshak a écrit :
On Fri, Apr 15, 2016 at 01:53:03AM +0200, Shankar Giri Venkita Giri
wrote:
I tried to incluide an SVG graphic in a LyX file and it appears
horribly corrupted (black triangles everywhere in the image
boundary). PDF output is fine. LyX 2.1 did not have this issue and
SVG looks correct.
I think this is:
http://www.lyx.org/trac/ticket/9778
Your SVG file is probably not "SVG 1.2 Tiny".
We don't currently have a fix in mind. The only possible fix now would
be to not use Qt to do the conversion.
I have been having the same issues. The svg preview in lyx is very far
from what it looks like in the PDF (even unrecognisable). The debug
output shows that it is rendered directly by qt without conversion (from
what I understood from the ticket). Moreover there is not improvement by
switching to qt5 (5.4.1).
It would make sense to preview using the same converter as is used to
generate the pdf. Georg wrote "If the Qt implementation of SVG rendering
is really that limited, then it would be easy to switch it off in LyX".
I am willing to test such a patch.
The following solves the display issues with svg, though it takes a
longer to display because of the forced conversion:
diff --git a/src/frontends/qt4/GuiApplication.cpp
b/src/frontends/qt4/GuiApplication.cpp
index 6fb5499..0170778 100644
--- a/src/frontends/qt4/GuiApplication.cpp
+++ b/src/frontends/qt4/GuiApplication.cpp
@@ -232,9 +232,11 @@ vector<string> loadableImageFormats()
LYXERR(Debug::GRAPHICS, (const char *) *it << ", ");
string ext = ascii_lowercase((const char *) *it);
- // special case
+ // special cases
if (ext == "jpeg")
ext = "jpg";
+ if (ext == "svg")
+ continue;
fmts.push_back(ext);
}