Discussion:
Converters: Skip Qt's loadable svg function
Vincent van Ravesteijn
2014-05-06 08:57:36 UTC
Permalink
Previewing of some (most) svg files does not work anymore even if Inkscape
and the converters has been set correctly. This is because Qt claims to be
able to load svg files natively. However, Qt does a bad job doing that.
Therefore, I want to use my configured converter. How can I do that ?

I now applied the attached patch, but it might not be everyone's choice.

Vincent
Richard Heck
2014-05-06 13:41:18 UTC
Permalink
Post by Vincent van Ravesteijn
Previewing of some (most) svg files does not work anymore even if
Inkscape and the converters has been set correctly. This is because Qt
claims to be able to load svg files natively. However, Qt does a bad
job doing that. Therefore, I want to use my configured converter. How
can I do that ?
I now applied the attached patch, but it might not be everyone's choice.
I guess my only thought, if Qt really does such a bad job with these,
would be to put this hack in loadableImageFormats(), to ensure
consistency. At the moment, that is only used here anyway, so it is
equivalent.

A more general, non-hard-coding solution would be to add a flag to the
formats, one that meant: Do not use native loading capabilities, then
check that flag.

Richard
Vincent van Ravesteijn
2014-05-06 18:10:07 UTC
Permalink
Post by Richard Heck
Post by Vincent van Ravesteijn
Previewing of some (most) svg files does not work anymore even if
Inkscape and the converters has been set correctly. This is because Qt
claims to be able to load svg files natively. However, Qt does a bad job
doing that. Therefore, I want to use my configured converter. How can I do
that ?
Post by Richard Heck
Post by Vincent van Ravesteijn
I now applied the attached patch, but it might not be everyone's choice.
I guess my only thought, if Qt really does such a bad job with these,
would be to put this hack in loadableImageFormats(), to ensure consistency.
At the moment, that is only used here anyway, so it is equivalent.
Yes, agreed.
Post by Richard Heck
A more general, non-hard-coding solution would be to add a flag to the
formats, one that meant: Do not use native loading capabilities, then check
that flag.
Post by Richard Heck
Richard
Shouldn't we always favor an explicit format->PNG converter over built-in
ones.

It doesn't make sense that the configure script specifies those converters
but are silently not used. Then, don't have the configure script set them.

Vincent
Vincent van Ravesteijn
2014-05-06 20:25:09 UTC
Permalink
Post by Richard Heck
Post by Vincent van Ravesteijn
Previewing of some (most) svg files does not work anymore even if
Inkscape and the converters has been set correctly. This is because
Qt claims to be able to load svg files natively. However, Qt does a
bad job doing that. Therefore, I want to use my configured converter.
How can I do that ?
I now applied the attached patch, but it might not be everyone's choice.
I guess my only thought, if Qt really does such a bad job with these,
would be to put this hack in loadableImageFormats(), to ensure
consistency. At the moment, that is only used here anyway, so it is
equivalent.
Now I remember why I didn't do that. We might want the Qt-automatic-way
as a fallback when no custom converter is defined.

Vincent
Pavel Sanda
2014-05-07 07:08:30 UTC
Permalink
Now I remember why I didn't do that. We might want the Qt-automatic-way as
a fallback when no custom converter is defined.
If user wants to have svg he has to install something to get pdf output,
so the fallback does not look critical here.

Pavel
Abdelrazak Younes
2014-05-10 09:18:13 UTC
Permalink
Post by Pavel Sanda
Now I remember why I didn't do that. We might want the Qt-automatic-way as
a fallback when no custom converter is defined.
Exactly.
Post by Pavel Sanda
If user wants to have svg he has to install something to get pdf output,
so the fallback does not look critical here.
The user might want to use LyX for HTML export... or someother tools are
able to handle SVG? This is probably good enough for a lot of people
that doesn't use advanced SVG tools.

Anyway, from the doc: http://qt-project.org/doc/qt-5/svgrendering.html
"Qt supports the static features
<http://www.w3.org/Graphics/SVG/feature/1.2/#SVG-static> of SVG 1.2 Tiny
<http://www.w3.org/TR/SVGMobile12>."

By the way, it seems that Qt5 has a new QtSvg module, not sure we can or
want to use that...

Abdel.
Georg Baum
2014-05-12 18:48:19 UTC
Permalink
Post by Vincent van Ravesteijn
Post by Richard Heck
Post by Vincent van Ravesteijn
Previewing of some (most) svg files does not work anymore even if
Inkscape and the converters has been set correctly. This is because
Qt claims to be able to load svg files natively. However, Qt does a
bad job doing that. Therefore, I want to use my configured converter.
How can I do that ?
I now applied the attached patch, but it might not be everyone's choice.
I guess my only thought, if Qt really does such a bad job with these,
would be to put this hack in loadableImageFormats(), to ensure
consistency. At the moment, that is only used here anyway, so it is
equivalent.
Now I remember why I didn't do that. We might want the Qt-automatic-way
as a fallback when no custom converter is defined.
The Qt builtin converters should not be special IMHO: They should get
entries in the preferences file (we would probably need something like a new
keyword for that), and configure.py could then set them as a last resort
fallback if nothing else is available. Then users could also switch it off
if needed, and nothing is hardcoded.


Georg

Loading...