GNOME Bugzilla – Bug 663611
Blank space shown for SVG icons with large comments
Last modified: 2021-07-05 14:11:41 UTC
Created attachment 200975 [details] GNOME Sudoku SVG icon with large comment block at the top When an SVG icon contains a large comment block, such as license header, before the <svg> tag, it fails to show up. A blank area appears in its place. The icon remains viewable in image viewers and editable in Inkscape. An example image created by adding comment lines to gnome-sudoku.svg is attached. When the comment is moved below the <svg> tag, it works fine. Inkscape places the comment above the <svg> tag by default.
What distribution are you using? What version of librsvg?
(In reply to comment #1) > What distribution are you using? What version of librsvg? Ubuntu 11.10 and the following packages are installed. librsvg2-2: 2.34.1-2 librsvg2-common: 2.34.1-2
That's kind of expected ... reading the whole file to determine its type would be too expensive. A long license header does not allow to identify the file as SVG.
(In reply to comment #3) > That's kind of expected ... reading the whole file to determine its type would > be too expensive. A long license header does not allow to identify the file as > SVG. Why do we need to identify its MIME type? It's not like calling 'file' on it: we know from the extension it must be a SVG, and we just need to skip the part that librsvg can detect as a comment. How is it that I can open the attached file in Firefox without trouble?
(In reply to comment #4) > (In reply to comment #3) > > That's kind of expected ... reading the whole file to determine its type would > > be too expensive. A long license header does not allow to identify the file as > > SVG. > Why do we need to identify its MIME type? It's not like calling 'file' on it: > we know from the extension it must be a SVG, and we just need to skip the part > that librsvg can detect as a comment. How is it that I can open the attached > file in Firefox without trouble? gdk-pixbuf identifies by MIME type using shared-mime-info, so that you can just display a bunch of bytes laying around somewhere.
If this works in eog, it should work in the shell. Both use gdk-pixbuf to load files.
Sunil, is this still a problem?
I just retested, the problem exists (with much less severity). Here is what I did to reproduce the error: 1) Open /usr/share/icons/hicolor/scalable/apps/gnome-sudoku.svg and copy the comment line that is above the <svg> tag and duplicate it many times (test to fail for 27 lines). 2) Logout and log back in. 3) Search for Gnome Sudoku in application search and see that the icon for it blank. 4) Open Gnome Sudoku. Press Alt-Tab and see a blank icon in the alt-tab overlay. 5) Icon looks okay on the favourite application launchers area. The problem is less severe because the gnome-sudoku icon does not come with lots of comments tags at the top like it used to. Possibly due to a fix in Inkspace. Also the icon (with lots of comments tags at the top) is properly visible in eog.
(In reply to comment #8) > I just retested, the problem exists (with much less severity). With which gnome-shell version? Please always provide version information.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/ Thank you for your understanding and your help.