Bug 99395 - SVG Desktop Icon Rendering Issues in Qt
Summary: SVG Desktop Icon Rendering Issues in Qt
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
5.0.5.1 rc
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-19 13:24 UTC by Larry Price
Modified: 2016-07-09 01:59 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
On the left is the icon for oasis mimes. On the right is the icon from the "hicolor" theme. (25.13 KB, image/png)
2016-04-19 13:24 UTC, Larry Price
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Larry Price 2016-04-19 13:24:29 UTC
Created attachment 124502 [details]
On the left is the icon for oasis mimes. On the right is the icon from the "hicolor" theme.

I am programatically selecting icons for LibreOffice to display in a Qt application while favoring SVG for higher quality images. Qt requires SVG files to follow the SVG Tiny 1.2 spec. When loading any of the libreOffice desktop icons from "hicolor", "locolor", or "gnome" theme directories into my actual application or a Qt test application, I see these black rectangles appear in the corners of the SVG (which I assume are rendering errors). This icons load properly in Chromium and Firefox. I believe this is because Qt requires following the SVG Tiny 1.2 specification.

I've attached an example of what I'm seeing. On the left is the icon for mimes, and on the right is the desktop icon loaded into a Qt sample SVG rendering application. This affects all LibreOffice icons. I also found a large SVG with all LibreOffice icons that does work in my Qt applications: https://wiki.documentfoundation.org/images/d/d4/LibreOffice_Initial_Icons-pre_final.svg.

Qt 5.4
Ubuntu 15.10
LibreOffice 5.0.5.1 and LibreOffice 5.1.2
Comment 1 Aron Budea 2016-07-06 11:33:27 UTC
Is the file size 562181 bytes for the Impress icon? Or maybe 562202 bytes?

In the git source tree these files are in sysui/desktop/icons/hicolor/scalable/apps and .../mimetypes, and from the looks of it, were saved from Inkscape. However, the previously linked, Qt-friendly image is also saved from Inkscape (there's a difference in the svg tag's version field, 1.1 compared to 1.0, I don't know if that matters).
Also, I haven't found any information on Inkscape being able to produce SVG Tiny output.
Comment 2 Larry Price 2016-07-06 13:58:57 UTC
Thanks for looking into this.

The file size of libreoffice-impress.svg on my current build is 562181 bytes, and I've verified it does not render properly when using the SVG Viewer example from Qt (https://github.com/qt/qtsvg/tree/dev/examples/svg/svgviewer).

On another note, I've since circumvented this problem by using the freedesktop.org standard of searching for icon files (https://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html). This could be a Qt issue more than an LO issue, so I would understand if it were to be closed.
Comment 3 Aron Budea 2016-07-09 01:59:36 UTC
I'm glad you managed to find the kind of icons you were looking for in the end. While I can't claim the SVGs are correct for sure, based on your feedback, I'm closing this as NOTOURBUG.

If an issue is reported concerning their use as icons, then it'll be investigated in further detail. Additionally, if you or someone else can put up an argument why a different SVG format would be better suited for these files, then it can be pursued as an enhancement request.