← Back to team overview

mahara-contributors team mailing list archive

[Bug 1416890] Re: Use SVG images and provide backward compatibility

 

Hi Gilles,

If you're interested in contributing your code back upstream, there are
some instructions on the mahara.org wiki:
https://wiki.mahara.org/index.php/Developer_Area/Contributing_Code

We use the gerrit code review system, which is based on git. If you
can't get that working, I'm also willing to just take a look at a patch
file or a github branch. :)

I suppose what we would want, is a new method,
$THEME->get_image_url($imagename). This would be equivalent to a call to
$THEME->get_url("images/{$imagename}.png"), except that it would check
for multiple file extension types. And then we'd want to go through the
existing code and find all the current places that are calling
$THEME->get_url() for images and replace them with calls to
$THEME->get_image_url().

This would multiply the number of filesystem checks to find an image
file, so it indeed might be good to do this in conjunction with some
cacheing to cut down on that.

Cheers,
Aaron

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1416890

Title:
  Use SVG images and provide backward compatibility

Status in Mahara ePortfolio:
  Triaged

Bug description:
  Suggestion by Gilles-Philippe Leblanc:

  In the Moodle software, the images are all managed by a cascade system.
  The function initially looking if a svg file exists, then a png, then gif, jpg and ico.

  This lets you use a svg file and maintain backward compatibility.

  The system also detects if the browser supports SVG. Generally, all
  browsers support this format except Internet Explorer 8 and below.

  Everything is cached to avoid unnecessary calculation.

  So I was wondering if it was planned to add the following components to do this:
  * A library for browser detection on the server side
  * A function to find the right file extension
  * A library for caching php

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1416890/+subscriptions


References