Summary: | ksvgtopng crashes with some svg files | ||
---|---|---|---|
Product: | [Unmaintained] kdelibs | Reporter: | Martin Jansa <Martin.Jansa> |
Component: | general | Assignee: | kdelibs bugs <kdelibs-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | ksvgtopng.initQApplication.patch |
Description
Martin Jansa
2009-06-15 17:09:49 UTC
Created attachment 34549 [details]
ksvgtopng.initQApplication.patch
Initialize Qt application, otherwise for some svg files it can segfault with:
ASSERT failure in QFontDatabase: "A QApplication object needs to be constructed before FontConfig is used."
SVN commit 982740 by cfeck: Use QApplication (for SVG files with text) Patch by Martin Jansa, thanks! BUG: 196634 M +6 -0 ksvgtopng.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=982740 (In reply to comment #2) > SVN commit 982740 by cfeck: > > Use QApplication (for SVG files with text) > > Patch by Martin Jansa, thanks! > BUG: 196634 > > > M +6 -0 ksvgtopng.cpp > > > WebSVN link: http://websvn.kde.org/?view=rev&revision=982740 It has unwanted side effect, that it needs X11 connection, so batch converting of png files, like when compiling referenced navit suffers from this change, when run from commandline without X11 :(. SRCDIR=. ./navit_svg2png "/usr/bin/ksvgtopng" "gui_inactive.png" ksvgtopng: cannot connect to X server Strange that this bug appears only on certain SVG files with text. https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit/navit/xpm/cursor_still.svg worked ok, even before my change and has text with some font too. What's even stranger, is that when I replaced whole <text> element in bank.svg with <text> element from cursor_still.svg than resulting svg segfaults again :(. Maybe there is still some hidden bug in qt code after all... (In reply to comment #3) https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit/navit/xpm/cursor_still.svg > worked ok, even before my change and has text with some font too. What's even > stranger, is that when I replaced whole <text> element in bank.svg with <text> > element from cursor_still.svg than resulting svg segfaults again :(. Ah my fault to notice.. cursor_still.svg has <text> but in layer with style="display:none", so it wasn't rendered at all. It would be nice to have qt function like bool QSvgRenderer::animated () const for check if svg has <text> elements and only then init QApplication. |