diff --git a/etemplate/thumbnail.php b/etemplate/thumbnail.php index 7f054af3fb..366283ca2a 100644 --- a/etemplate/thumbnail.php +++ b/etemplate/thumbnail.php @@ -300,9 +300,9 @@ function exif_thumbnail_load($file) function gd_image_load($file,$maxw,$maxh) { // Get mime type - list($type, $image_type) = explode('/', egw_vfs::mime_content_type($file)); + list($type, $image_type) = explode('/', $mime = egw_vfs::mime_content_type($file)); // if $file is not from vfs, use mime_magic::filename2mime to get mime-type from extension - if (!$type) list($type, $image_type) = explode('/', mime_magic::filename2mime($file)); + if (!$type) list($type, $image_type) = explode('/', $mime = mime_magic::filename2mime($file)); // Call the according gd constructor depending on the file type if($type == 'image') @@ -321,6 +321,10 @@ function gd_image_load($file,$maxw,$maxh) return imagecreatefromgif($file); case 'bmp': return imagecreatefromwbmp($file); + case 'svg+xml': + html::content_header(egw_vfs::basename($file), $mime); + readfile($file); + common::egw_exit(); } } else if ($type == 'application') diff --git a/phpgwapi/js/jsapi/egw_images.js b/phpgwapi/js/jsapi/egw_images.js index 2e5940b04a..ffe7ea55f7 100644 --- a/phpgwapi/js/jsapi/egw_images.js +++ b/phpgwapi/js/jsapi/egw_images.js @@ -150,6 +150,11 @@ egw.extend('images', egw.MODULE_GLOBAL, function() { if (_mtime) params.mtime = _mtime; image = this.link('/etemplate/thumbnail.php', params); } + // for svg return image itself + else if (type[0] == 'image' && type[1] == 'svg+xml') + { + image = this.webserverUrl+'/webdav.php'+_path; + } else { if ((typeof type[1] == 'undefined' || !(image = this.image('mime'+_size+'_'+type[0]+'_'+type[1], 'etemplate')) &&