Bug 336436 - Switch to webkit or blink when rendering SVG files
Summary: Switch to webkit or blink when rendering SVG files
Status: ASSIGNED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 20.08.3
Platform: Gentoo Packages Linux
: VHI wishlist
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
: 307331 353085 359550 364534 405660 417815 423655 432330 448110 451554 478505 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-06-19 13:30 UTC by rgb.mldc
Modified: 2023-12-14 17:36 UTC (History)
25 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Sample SVG with complet layout (75.08 KB, image/svg+xml)
2014-06-19 13:34 UTC, rgb.mldc
Details
Gwenview renedering issue of a SVG. (154.28 KB, image/png)
2019-12-06 13:28 UTC, postix
Details
Sample file of the above post. (211.75 KB, image/svg+xml)
2019-12-06 13:29 UTC, postix
Details
SVG file produced by LibreOffice Draw (127.54 KB, application/zip)
2023-03-20 15:02 UTC, medin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rgb.mldc 2014-06-19 13:30:21 UTC
On this document 

http://qt-project.org/doc/qt-5/svgrendering.html

you can read "Qt supports the static features of SVG 1.2 Tiny. ECMA scripts and DOM manipulation are currently not supported."

That means that several SVG features like text on paths are not rendered by Qt based applications. On several Qt bug reports like this one 

https://bugreports.qt-project.org/browse/QTBUG-12588

(closed as "out of scope") is recommended to use webkit when rendering complex SVG files. 

Maybe Gwenview needs to switch to webkit or blink when rendering SVG files.

Reproducible: Always




I do not see a way to attach a sample SVG file now, so I'll attach one on the comments. That file opens without a problem on rekonq, inkscape, chromium and OpenOffice, but display several problems on Gwenview and karbon14, like missing text, lines that should be invisible are displayed, etc.
Comment 1 rgb.mldc 2014-06-19 13:34:12 UTC
Created attachment 87279 [details]
Sample SVG with complet layout

The attached SVG file opens fine on webkit based applications like rekonq and on other applications like inkscape or OpenOffice is displayed without errors too, but shows several problems on Gwenview and karbon14 due to non complete SVG support.
Comment 2 Christoph Feck 2016-06-27 23:18:00 UTC
*** Bug 307331 has been marked as a duplicate of this bug. ***
Comment 3 Christoph Feck 2016-06-27 23:18:25 UTC
*** Bug 353085 has been marked as a duplicate of this bug. ***
Comment 4 Christoph Feck 2016-06-27 23:18:50 UTC
*** Bug 359550 has been marked as a duplicate of this bug. ***
Comment 5 Christoph Feck 2016-06-27 23:19:16 UTC
*** Bug 364534 has been marked as a duplicate of this bug. ***
Comment 6 Holger 2018-10-07 10:42:45 UTC
*** This bug has been confirmed by popular vote. ***
Comment 7 Christoph Feck 2019-03-19 21:43:24 UTC
*** Bug 405660 has been marked as a duplicate of this bug. ***
Comment 8 postix 2019-12-06 13:28:17 UTC
Created attachment 124338 [details]
Gwenview renedering issue of a SVG.

I guess I experience the same bug(s).

KDE Plasma Version: 5.17.4
KDE Frameworks Version: 5.65.0
Qt Version: 5.13.2
Comment 9 postix 2019-12-06 13:29:28 UTC
Created attachment 124339 [details]
Sample file of the above post.
Comment 10 Nate Graham 2020-02-18 05:24:29 UTC
*** Bug 417815 has been marked as a duplicate of this bug. ***
Comment 11 ebray187 2020-11-12 14:54:56 UTC
And more than 10 years after, the same bug persist... Is there any plan so that KDE's default image viewer can properly render SVG images in 2020?

 OS: Gentoo 
 Kernel: x86_64 Linux 5.4.72-gentoo
 DE: KDE 5.74.0 / Plasma 5.19.5
 WM: KWin

kde-apps/gwenview-20.08.3:5::gentoo  USE="X activities handbook kipi mpris semantic-desktop -debug -fits -raw -share -test"
Comment 12 Madhav Kanbur 2021-02-04 08:17:29 UTC
*** Bug 432330 has been marked as a duplicate of this bug. ***
Comment 13 Madhav Kanbur 2021-02-04 08:24:28 UTC
(In reply to ebray187 from comment #11)
> And more than 10 years after, the same bug persist... Is there any plan so
> that KDE's default image viewer can properly render SVG images in 2020?
> 
>  OS: Gentoo 
>  Kernel: x86_64 Linux 5.4.72-gentoo
>  DE: KDE 5.74.0 / Plasma 5.19.5
>  WM: KWin
> 
> kde-apps/gwenview-20.08.3:5::gentoo  USE="X activities handbook kipi mpris
> semantic-desktop -debug -fits -raw -share -test"

I'm gonna take a shot at switching over to Qt WebEngine (based on Chromium/Blink). I'm still getting acquainted with Gwenview's code base so I can't make any promises but I'm definitely going to give it a try.
Comment 14 Christoph Feck 2021-02-04 16:44:33 UTC
No need to look at Gwenview's source, check kimageformats/qimageformats instead. These have code to load a file into a QImage.
Comment 15 Madhav Kanbur 2021-02-04 18:17:28 UTC
(In reply to Christoph Feck from comment #14)
> No need to look at Gwenview's source, check kimageformats/qimageformats
> instead. These have code to load a file into a QImage.

I'll have a look at it. Thanks a ton.
Comment 16 Bug Janitor Service 2021-02-19 11:45:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/gwenview/-/merge_requests/41
Comment 17 postix 2021-07-10 15:12:35 UTC
Is this still assigned?
Is the solution to switch to webkit or blink still considered to be the best choice after the discussion at https://invent.kde.org/graphics/gwenview/-/merge_requests/41 ? 
Are there any smaller alternative libraries which could be used and are easier to maintain?
Comment 18 postix 2021-07-10 15:25:54 UTC
*** Bug 270838 has been marked as a duplicate of this bug. ***
Comment 19 postix 2021-07-10 15:27:00 UTC
*** Bug 423655 has been marked as a duplicate of this bug. ***
Comment 20 Shlomi Fish 2021-07-18 08:06:49 UTC
(In reply to postix from comment #17)
> Is this still assigned?
> Is the solution to switch to webkit or blink still considered to be the best
> choice after the discussion at
> https://invent.kde.org/graphics/gwenview/-/merge_requests/41 ? 
> Are there any smaller alternative libraries which could be used and are
> easier to maintain?

just FYI: there are librsvg and cairo, and we can try piggybacking on CLI inkscape - with a fallback.
Comment 21 Holger 2022-01-09 19:03:01 UTC
*** Bug 448110 has been marked as a duplicate of this bug. ***
Comment 22 Nate Graham 2022-03-25 18:42:32 UTC
*** Bug 451554 has been marked as a duplicate of this bug. ***
Comment 23 medin 2023-03-20 15:02:09 UTC
Created attachment 157447 [details]
SVG file produced by LibreOffice Draw

For now, even SVG files produced by LibreOffice Draw (7.5) cannot be viewed correctly with Gwenview while LibreOffice Writer, Firefox, Scribus and Inkscape show them perfectly.
Comment 24 Holger 2023-06-26 00:00:09 UTC
Will KSVG be a valid alternative library to properly draw fullscreen pictures, or can it only display icons?
Will KSVG support e.g. SVG 2 features in development since 2018 (or anything newer than 1.2 tiny from 2008)?
Is version 1.0 production ready and suitable for inclusion in Gwenview?

https://invent.kde.org/frameworks/ksvg
https://www.w3.org/TR/SVG2/
https://www.w3.org/TR/SVGTiny12/
Comment 25 Nate Graham 2023-07-25 19:25:41 UTC
No, because KSvg sits on top of the Qt SVG renderer, which is what suffers from this problem.

The solutions are:
1. Improve the Qt SVG renderer
2. Use different SVG renderer
Comment 26 Nate Graham 2023-12-14 17:36:55 UTC
*** Bug 478505 has been marked as a duplicate of this bug. ***