[ZBX-10267] images from icon-sprite.svg may be not displayed in browser Created: 2016 Jan 14  Updated: 2025 May 30

Status: Reopened
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 3.0.0alpha6
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: James Sperry Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: headers, icons, mime, svg
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CentOS release 5.11 (Final)
Server version: Apache/2.2.3
PHP 5.4.45



 Description   

no icons were loading after initial install of Zabbix 3.0.0alpha6

Resolution was add 2 lines to /etc/mime.types
image/svg+xml svg
image/svg+xml svgz

and 2 lines to the top of img/icon-sprite.svg
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

and restart httpd



 Comments   
Comment by Oleksii Zagorskyi [ 2016 Jan 18 ]

Interesting, what error/message did you see in Apache log?
How Apache could not provide a file requested by browser?
In my Debian 8 I have single line in /etc/mime.types:

image/svg+xml                                   svg svgz

And in browsers I see the icon well without svg file modification.
Theoretically unknown mime type file content should be be be related to Apache behavior ...

Comment by James Sperry [ 2016 Jan 18 ]

I didn't see any error in error_log or access_log

The icons just wouldn't show up. If I used chromes development tools to inspect element, I saw that it was referring to the .svg file in img/
When I pointed my browser to the img/icon-sprite.svg file, I would only see the text that makes up the file.

I tried in both Chrome and Firefox, and was not able to load the icons.

This is probably due to the fact that I'm on Centos 5.11 or something, but wanted to put it out there in case anyone else ran into this issue.

Comment by Oleksii Zagorskyi [ 2016 Jan 18 ]

My experiments show that with commented out the line in /etc/mime.types, then "Content-Type: image/svg+xml" header is missing in response, as expected.
In frontend all images from the sprite, including ZABBIX logo on top, will be NOT displayed.
If open img/icon-sprite.svg file in another tab - as you said, we will see a text of the file content.
It's actual for Chrome and Opera under Linux.

Interesting that Firefox under Linux shows the logo and all the pictures in any case!
When inspecting traffic, Firefox shows just "svg" for type, when other browsers show "text/plain" type (when the header is missing) and show "svg+xml" type (when the header exists).

I don't think we have to do here anything with zabbix code.
I think this report may be closed by PHP devs.

Comment by Kaspars Andersons [ 2025 May 30 ]

closed due to inactivity. If the issue is still active please create new request

Generated at Thu Jun 05 22:21:27 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.