mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-05-09 23:05:04 +02:00
related to #1657 svg is now considered as a file and not a picture and added file_ext and path_ext to img data sent.
This commit is contained in:
@@ -104,7 +104,8 @@ foreach ($pictures as $row)
|
||||
'URL' => $url,
|
||||
'DESCRIPTION' => $desc,
|
||||
'src_image' => new SrcImage($row),
|
||||
'is_svg' => ('svg' == strtolower(get_extension($row['path']))),
|
||||
'path_ext' => strtolower(get_extension($row['path'])),
|
||||
'file_ext' => strtolower(get_extension($row['file'])),
|
||||
) );
|
||||
|
||||
if ($conf['index_new_icon'])
|
||||
|
||||
@@ -40,13 +40,12 @@
|
||||
|
||||
// picture_ext : file extensions for picture file, must be a subset of
|
||||
// file_ext
|
||||
// Add 'svg' to this array to support svg images.
|
||||
$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'];
|
||||
|
||||
Reference in New Issue
Block a user