forked from extern/egroupware
use svg image itself as thumbnail
This commit is contained in:
parent
1095c6e5b9
commit
68374ff0a3
@ -300,9 +300,9 @@ function exif_thumbnail_load($file)
|
|||||||
function gd_image_load($file,$maxw,$maxh)
|
function gd_image_load($file,$maxw,$maxh)
|
||||||
{
|
{
|
||||||
// Get mime type
|
// 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 $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
|
// Call the according gd constructor depending on the file type
|
||||||
if($type == 'image')
|
if($type == 'image')
|
||||||
@ -321,6 +321,10 @@ function gd_image_load($file,$maxw,$maxh)
|
|||||||
return imagecreatefromgif($file);
|
return imagecreatefromgif($file);
|
||||||
case 'bmp':
|
case 'bmp':
|
||||||
return imagecreatefromwbmp($file);
|
return imagecreatefromwbmp($file);
|
||||||
|
case 'svg+xml':
|
||||||
|
html::content_header(egw_vfs::basename($file), $mime);
|
||||||
|
readfile($file);
|
||||||
|
common::egw_exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($type == 'application')
|
else if ($type == 'application')
|
||||||
|
@ -150,6 +150,11 @@ egw.extend('images', egw.MODULE_GLOBAL, function() {
|
|||||||
if (_mtime) params.mtime = _mtime;
|
if (_mtime) params.mtime = _mtime;
|
||||||
image = this.link('/etemplate/thumbnail.php', params);
|
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
|
else
|
||||||
{
|
{
|
||||||
if ((typeof type[1] == 'undefined' || !(image = this.image('mime'+_size+'_'+type[0]+'_'+type[1], 'etemplate')) &&
|
if ((typeof type[1] == 'undefined' || !(image = this.image('mime'+_size+'_'+type[0]+'_'+type[1], 'etemplate')) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user