Allow upload of SVG to use in portfolio pages

Bug #1681571 reported by Kristina Hoeppner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Won't Fix
Wishlist
Unassigned

Bug Description

All modern browsers support SVG and so should we in Mahara. Currently, you can't upload them to an image block because the format is not recognized.

Bug #1681573 deals with the support for inline SVG for easy manipulation as a follow-on wishlist item.

description: updated
Revision history for this message
Robert Lyon (robertl-9) wrote :

To handle this we will need to recognise the .svg as an 'image' file but will need to handle slightly differently as we won't need to make thumbnails of it as we can just supply it with dimensions to achieve that.

So bits that will need to change include (but not limited to)

- Code that handles the upload / saving of the file
- Code that displays it in filebrowser / aretefactchooser
- code that displays it via artefact/file/download.php so we display the file rather than prompt download

Changed in mahara:
milestone: 17.10.0 → 18.04.0
Robert Lyon (robertl-9)
Changed in mahara:
milestone: 18.04.0 → 18.10.0
Changed in mahara:
milestone: 18.10.0 → none
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/10554

Revision history for this message
Robert Lyon (robertl-9) wrote :

For things to translate/scale one needs to have the svg markup like so:

<svg ...>
  <g transform="translate(x,y) scale(x,y)">
    ...
    all other info
    ...
  </g>
</svg>

Attached is an example

One can also set/override the transform="translate(x,y) scale(x,y)" part via the image block config if one wants to display only part of the svg

Revision history for this message
Lisa Seeto (lisaseeto) wrote :
Revision history for this message
Rangi Daymond (rangid) wrote :

Hi Robert - a couple of smaller things that may or not be issues:
1. When image block created/edited:
1.1 filename is displayed when Description is selected (instead of entered description)
1.2. file preview is not displayed in the Details & comments sidebar.
2. Should animated SVGs still display as animated ? I have not had one display as expected and a couple cause errors.
And one bigger one:
3. Deleting svg files (maybe just animated ones) via the File Manager cause errors to display on both the Files home page and also sometimes on page/s that used to use a deleted file. I'm investigating this further and have pasted this comment into the launchpad ticket with a zip file containing a screenshot of the Files error and several test svg files (different types: plain, with transforms & animated). Will add further detail when I have it.

Revision history for this message
Cecilia Vela Gurovic (ceciliavg) wrote :
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

We decided not to implement this after all because it is too dangerous securitywise to allow anybody to upload a SVG file because malicious code can be embedded.

Instead we'll only allow site admins to upload SVG files as logos in wishlist item bug #1894358

Changed in mahara:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.