NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Scalable Vector Graphics (SVG) Support

Solved!
Go to solution

Good Morning,

During the last two weeks we have been enhacing the charateristics (color, user-friendly appearance) of a web HMI installed in a CRio 9068 where the Linux version 3.2.35-rt52-2.10.0f0 is running.

Instead of employing jpg files, we have taken advantage of svg icons and images, which offers more interactivity and animation. Nevertheless, we have found that the svg images can not been seen, once the web HMI is opened. We have installed the same Web HMI in another platform i.e. Rasberry pi, which runs on Rasbian ( based on Debian) and all the svg images can be seen without problem.

We would like to know if the svg format is going to be supported or if there is any current way that can help us to interprate those images.

Looking to hearing from you.

Oscar Javier Rivera

0 Kudos
Message 1 of 6
(4,085 Views)

Can you provide a bit more detail on the implementation of the Web HMI? In theory, it should be pushing SVG (either as a file or embedded in the HTML/CSS/XML of your HMI) without touching it.

0 Kudos
Message 2 of 6
(3,286 Views)

Thanks for your support BrandM.

In the a Front-end part, certainly in the HMTL we are referencing the SVG files (located in /www/static), which are not more than icons, but as i mentioned, they can not be seen in any browser. The CSS files contains the fonts and style elements.

In a processing background we are running a .py file, which is reading/writing data from a Database.

Additionally, i was checking some of the available libraries with the package manager (opkg), but inside of the NI repository (e.g. http://download.ni.com/ni-linux-rt/feeds/2014/arm/), i did not find any "svg" library.

Thanks in advance.

Oscar Javier Rivera

0 Kudos
Message 3 of 6
(3,286 Views)
Solution
Accepted by topic author Oscar_KOL

Oscar_KOL wrote:

...

In the a Front-end part, certainly in the HMTL we are referencing the SVG files (located in /www/static), which are not more than icons, but as i mentioned, they can not be seen in any browser. The CSS files contains the fonts and style elements.

...

I would expect that this approach means that all SVG handling happens on the browser on your laptop/desktop/smartphone, the cRIO is acting as nothing more than a data file courier (receiving a request for a file, getting it, sending it).

What webserver are you using on the cRIO? There may be some MIME misconfiguration that needs to be investigated (and was configured properly on Raspbian)

0 Kudos
Message 4 of 6
(3,286 Views)

Hi,

We have implemented a webserver in Python....

0 Kudos
Message 5 of 6
(3,286 Views)

Hi BrandM,

You were right regarding the MIME misconfiguration. Particularly in the Linux version that was installed in our controller, the MIME Types file was not created. So here are the steps to solve our problem:

1. We created a "mime.types" in the /etc folder with the following content:

     image/svg+xml     svg

2. In the terminal, we typed the following commands

     import mimetypes

     mimetypes.add_type ('image/svg+xml', '.svg')

3. We restarted the web server and finally it worked.

Once again, thank you very much for your concern and your guideline.

0 Kudos
Message 6 of 6
(3,286 Views)