Moodle

CLONE -Scalable Vector Graphics (SVG) files in Moodle are not correctly displayed in many Browsers

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.6.2
  • Fix Version/s: DEV backlog
  • Component/s: Resource
  • Labels:
    None
  • Environment:
    Any

Description

Applies to Web browsers (Firefox, Opera) that natively display SVG and require correct MIME type to be served from Moodle.
Internet Explorer + Adobe SVG Plugin view does not have a problem as it renders SVG base on the .svg extension alone.

Problem can be simply resolved by adding the following lines to function get_mimetypes_array() in /lib/filelib.php

i.e.

'svg' => array ('type'=>'image/svg+xml', 'icon'=>'image.gif'),
'svgz' => array ('type'=>'image/svg+xml', 'icon'=>'image.gif'),

Issue Links

Activity

Hide
Philip Serracino Inglott added a comment - - edited

This issue still seems there in 1.8.2.

I followed the fixes indicated in the original report, but svg are still not displayed correctly. In fact they are not displayed at all.

I can upload and select and svg from the htmleditor, but no preview is displayed.
the <img> tag is inserted with width and height = 0. The editor should insert the correct tag

Show
Philip Serracino Inglott added a comment - - edited This issue still seems there in 1.8.2. I followed the fixes indicated in the original report, but svg are still not displayed correctly. In fact they are not displayed at all. I can upload and select and svg from the htmleditor, but no preview is displayed. the <img> tag is inserted with width and height = 0. The editor should insert the correct tag

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated: