Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Displaying SVGs

Olivier Paroz edited this page Sep 28, 2015 · 2 revisions

There are currently two ways to display SVGs in Gallery

Using the SVG provider

You simply add OC\Preview\SVG to your list of enabled providers

'enabledPreviewProviders' =>
 array (
   ...
   5 => 'OC\\Preview\\SVG',
   ...
 ),

Caveats

  • xlink:href attributes are not supported and the preview will be empty

Notes

  • There may be other preview providers available which offer more features, while keeping you on the safe side

Letting the browser render the SVG

You simply add the following information to your gallery.cnf file, placed in the top folder in your ownCloud.

---
# Gallery configuration file
features:
  ...
  native_svg: yes

Caveats

  • Some complex SVGs can't be parsed
  • SVGs can contain scripts which can attack the browser