Bug 389091 - incorrect rendering of a svg image
Summary: incorrect rendering of a svg image
Status: RESOLVED WORKSFORME
Alias: None
Product: kate
Classification: Applications
Component: plugin-preview (show other bugs)
Version: 16.08
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-17 05:35 UTC by Igor Zhuravlov
Modified: 2021-04-23 06:29 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
this file is displayed incorrectly (10.77 KB, image/svg+xml)
2018-01-17 05:35 UTC, Igor Zhuravlov
Details
screenshot of Kate window (245.88 KB, image/png)
2018-01-17 05:38 UTC, Igor Zhuravlov
Details
this file is displayed incorrectly, too (6.89 KB, image/svg+xml)
2018-01-18 01:32 UTC, Igor Zhuravlov
Details
my Plasma settings (87.92 KB, image/png)
2018-01-18 01:35 UTC, Igor Zhuravlov
Details
Plasma svg services available (79.42 KB, image/png)
2018-01-18 01:37 UTC, Igor Zhuravlov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Zhuravlov 2018-01-17 05:35:45 UTC
Created attachment 109923 [details]
this file is displayed incorrectly

The svg file applied is displayed as black area by plugin, see screenshot.
This svg file is extracted from html page http://www.chilton-computing.org.uk/acl/applications/cc/p007.htm .
Comment 1 Igor Zhuravlov 2018-01-17 05:38:38 UTC
Created attachment 109924 [details]
screenshot of Kate window
Comment 2 Kai Uwe Broulik 2018-01-17 08:34:55 UTC
Can you check whether it conforms to SVG Tiny 1.2? See https://doc.qt.io/qt-5/svgrendering.html
Comment 3 Friedrich W. H. Kossebau 2018-01-17 09:10:14 UTC
Thanks for the report.

First some technical background:
The preview plugin relays the rendering in the respective format to a matching KParts plugin, based on the MIME type. Currently that KParts plugin is used which is the default one for the given MIME type. And right now the default can be only controlled via the Plasma System Settings ("Applications" > "File Assocications" > Select "image/svg+xml" > tab "Embedded").

Chance is that the KParts plugin "svgpart" is the currently top one there. Which internally uses Qt SVG (https://doc.qt.io/qt-5/qtsvg-index.html), which "s[S]upports a subset of the SVG 1.2 Tiny standard.". So might not be enough for your SVG files.

To improve your situation, see if there is the KParts plugin webenginepart or kwebkitpart installed and then choose that one as the most preferred in the mentioned settings dialoig. These parts will use the SVG rendering engine of web*, which possibly supports more parts of the standard.

Please tell if you could make this work and if it improved the preview for you.

Future plan is to allow selecting the KParts plugin to use in Kate settings itself.

So this is actually not a direct bug of the preview plugin, but a problem of the svgpart KParts plugin only supporting a subset of SVG. Seems that one has not yet an entry in bugs.kde,org, will see to create one and then move this bug report over there.
Comment 4 Igor Zhuravlov 2018-01-18 01:32:48 UTC
Created attachment 109958 [details]
this file is displayed incorrectly, too

Version of original file reduced to conform SVG 1.1 Tiny
Comment 5 Igor Zhuravlov 2018-01-18 01:33:44 UTC
(In reply to Kai Uwe Broulik from comment #2)
> Can you check whether it conforms to SVG Tiny 1.2?

No, it's not. But reduced version conforming SVG 1.1 Tiny is not displayed correctly too, result seems the same. Reduced svg version is attached.
Comment 6 Igor Zhuravlov 2018-01-18 01:35:20 UTC
Created attachment 109959 [details]
my Plasma settings

Plasma System Settings ("Applications" > "File Assocications" > Select "image/svg+xml" > tab "Embedded")
Comment 7 Igor Zhuravlov 2018-01-18 01:37:00 UTC
Created attachment 109960 [details]
Plasma svg services available

Plasma System Settings ("Applications" > "File Assocications" > Select "image/svg+xml" > tab "Embedded" > Press "+ Add" button
Comment 8 Igor Zhuravlov 2018-01-18 01:46:19 UTC
(In reply to Friedrich W. H. Kossebau from comment #3)
> To improve your situation, see if there is the KParts plugin webenginepart
> or kwebkitpart installed and then choose that one as the most preferred in
> the mentioned settings dialoig. These parts will use the SVG rendering
> engine of web*, which possibly supports more parts of the standard.

I have kwebkitpart of version 1.3.4-1.1 installed. But there is no similar name neither in settings dialog you mentioned nor among possible alternative services (under "Add" button), see screenshots. I guess it is labeled "KHTML", but it is already atop.
Comment 9 Friedrich W. H. Kossebau 2018-01-18 08:28:37 UTC
(In reply to Igor Zhuravlov from comment #8)
> I have kwebkitpart of version 1.3.4-1.1 installed. But there is no similar
> name neither in settings dialog you mentioned nor among possible alternative
> services (under "Add" button), see screenshots. I guess it is labeled
> "KHTML", but it is already atop.

Okay, so welcome to convoluted matters :)

KHTML is a separate plugin from kwebkitpart(*), so the latter is still missing here. 

When it comes to kwebkitpart, I just saw that there is some issue with the version numnber: kwebkitpart got ported to qt5, but seems it never got officially released, with a new version number. Still at least openSUSE has packages of the ported code, but also using 1.3.4 as version. That needs some poking of people.
For you it needs to check if your version of kwebkitpart is having qt4 or qt5 as dependency. If qt4 (which I assume), it sadly cannot be used, not compatible. Try to check if you can get hold of a package with the ported version.

For webenginepart, that one is developed as part of Konqueror libraries/plugins. On openSUSE it is packaged into a separate package "webenginepart", other distributions might have thas as part of some konq-* package.

(*) KHTML still being the original code of what once was forked into webkit by Apple engineers, which then again was wrapped in that separate kpart by some other KDE developers, who put their trust rather into webkit devs than the kthml devs... and we do not know who is more right, so both exist :) )
Comment 10 Justin Zobel 2020-11-05 04:39:23 UTC
Igor I've just tested this on the latest Kate and with svgpart installed the "Early Translator Writing Systems" image works as expected, the same as it does in my browser.

Can you please confirm if this is still an issue, thanks.
Comment 11 Bug Janitor Service 2020-11-20 04:33:45 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 12 Bug Janitor Service 2020-12-05 04:34:07 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 13 Igor Zhuravlov 2021-04-23 06:29:56 UTC
The problem was fixed in the following environment:
- openSUSE Leap 15.2
- Kate 20.04.2
- KDE Frameworks 5.71.0
- Qt 5.12.7 (built with version 5.12.7)
- window system xcb

by the steps you advised:
1) packages webenginepart and svgpart were installed (after that, a svgpart view component was appeared in the Plasma System Settings: "Applications" > "File Assocications" > Select "image/svg+xml" > tab "Embedded"),
2) the svgpart view component was moved to the top in the list.

Thank you!