mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-08 01:32:59 +02:00
fixes #1657 SVG support (both gallery and admin sides)
This commit is contained in:
committed by
plegall
parent
8d1e97c8b7
commit
77b156df18
@@ -104,6 +104,8 @@ foreach ($pictures as $row)
|
||||
'URL' => $url,
|
||||
'DESCRIPTION' => $desc,
|
||||
'src_image' => new SrcImage($row),
|
||||
'path_ext' => strtolower(get_extension($row['path'])),
|
||||
'file_ext' => strtolower(get_extension($row['file'])),
|
||||
) );
|
||||
|
||||
if ($conf['index_new_icon'])
|
||||
|
||||
@@ -45,7 +45,7 @@ $conf['picture_ext'] = array('jpg','jpeg','png','gif');
|
||||
// file_ext : file extensions (case sensitive) authorized
|
||||
$conf['file_ext'] = array_merge(
|
||||
$conf['picture_ext'],
|
||||
array('tiff', 'tif', 'mpg','zip','avi','mp3','ogg','pdf')
|
||||
array('tiff', 'tif', 'mpg','zip','avi','mp3','ogg','pdf','svg')
|
||||
);
|
||||
|
||||
// enable_formats: should Piwigo search for multiple formats?
|
||||
|
||||
@@ -42,6 +42,8 @@ final class SrcImage
|
||||
|
||||
$this->id = $infos['id'];
|
||||
$ext = strtolower(get_extension($infos['path']));
|
||||
$infos['file_ext'] = @strtolower(get_extension($infos['file']));
|
||||
$infos['path_ext'] = $ext;
|
||||
if (in_array($ext, $conf['picture_ext']))
|
||||
{
|
||||
$this->rel_path = $infos['path'];
|
||||
@@ -57,10 +59,17 @@ final class SrcImage
|
||||
$this->flags |= self::IS_MIMETYPE;
|
||||
if ( ($size=@getimagesize(PHPWG_ROOT_PATH.$this->rel_path)) === false)
|
||||
{
|
||||
$this->rel_path = 'themes/default/icon/mimetypes/unknown.png';
|
||||
if ('svg' == $ext)
|
||||
{
|
||||
$this->rel_path = $infos['path'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->rel_path = 'themes/default/icon/mimetypes/unknown.png';
|
||||
}
|
||||
$size = getimagesize(PHPWG_ROOT_PATH.$this->rel_path);
|
||||
}
|
||||
$this->size = array($size[0],$size[1]);
|
||||
$this->size = @array($size[0],$size[1]);
|
||||
}
|
||||
|
||||
if (!$this->size)
|
||||
|
||||
Reference in New Issue
Block a user