Image Type: SVG

3 posts by 2 authors in: Forums > CMS Builder
Last Post: August 22, 2016   (RSS)

By Daryl - August 22, 2016

Hi Tim,

We'll look into adding support for SVG image file type for the next release. 

You can add the following patch, for now, to display the thumbnails for SVG images in the admin.

In showUploadPreview function in \cmsb\lib\upload_functions.php file, add the following code after line 1086:

$isImage = preg_match("/\.(gif|jpg|jpeg|png)$/i", $uploadRecord['urlPath']); // line 1086

// display image preview for svg image file type
if (preg_match("/\.(svg)$/i", $uploadRecord['urlPath'])) {
  $isImage                = true;
  $uploadRecord['width']  = "150";
  $uploadRecord['height'] = "150";
}

Note: This patch is for v3.05 and don't forget to create a backup first

Let me know any questions.

Thanks,

Daryl Maximo
PHP Programmer - interactivetools.com

By Toledoh - August 22, 2016

Thats great - Thanks Daryl.

Cheers,

Tim (toledoh.com.au)