diff --git a/admin/batch_manager_unit.php b/admin/batch_manager_unit.php
index 7304fbe40..77552f3d3 100644
--- a/admin/batch_manager_unit.php
+++ b/admin/batch_manager_unit.php
@@ -213,7 +213,8 @@ SELECT
{
$legend.= ' ('.$row['file'].')';
}
-
+ $extTab = explode('.',$row['path']);
+
$template->append(
'elements', array_merge($row,
array(
@@ -228,6 +229,7 @@ SELECT
'DESCRIPTION' => htmlspecialchars(isset($row['comment']) ? $row['comment'] : ""),
'DATE_CREATION' => $row['date_creation'],
'TAGS' => $tag_selection,
+ 'is_svg' => (strtoupper(end($extTab)) == 'SVG'),
)
));
}
diff --git a/admin/include/functions_metadata.php b/admin/include/functions_metadata.php
index 9092e95fa..22cd279cc 100644
--- a/admin/include/functions_metadata.php
+++ b/admin/include/functions_metadata.php
@@ -177,12 +177,38 @@ function get_sync_metadata($infos)
// for width/height (to compute the multiple size dimensions)
$is_tiff = true;
}
-
}
$file = original_to_representative($file, $infos['representative_ext']);
}
+ if (in_array(mime_content_type($file), array('image/svg+xml', 'image/svg')))
+ {
+ $xml = file_get_contents($file);
+
+ $xmlget = simplexml_load_string($xml);
+ $xmlattributes = $xmlget->attributes();
+ $width = (int) $xmlattributes->width;
+ $height = (int) $xmlattributes->height;
+ $vb = (string) $xmlattributes->viewBox;
+
+ if (isset($width) and $width != "")
+ {
+ $infos['width'] = $width;
+ } elseif (isset($vb))
+ {
+ $infos['width'] = explode(" ", $vb)[2];
+ }
+
+ if (isset($height) and $height != "")
+ {
+ $infos['height'] = $height;
+ } elseif (isset($vb))
+ {
+ $infos['height'] = explode(" ", $vb)[3];
+ }
+ }
+
if ($image_size = @getimagesize($file))
{
$infos['width'] = $image_size[0];
@@ -244,7 +270,7 @@ SELECT id, path, representative_ext
{
continue;
}
-
+ // print_r($data);
$id = $data['id'];
foreach (array('keywords', 'tags') as $key)
{
diff --git a/admin/picture_modify.php b/admin/picture_modify.php
index b9dd9df97..f160b23c5 100644
--- a/admin/picture_modify.php
+++ b/admin/picture_modify.php
@@ -295,7 +295,8 @@ $intro_vars = array(
'size' => l10n('%s pixels, %.2f MB', $row['width'].'×'.$row['height'], $row['filesize']/1024),
'stats' => l10n('Visited %d times', $row['hit']),
'id' => l10n($row['id']),
- 'ext' => l10n('%s file type',strtoupper(end($extTab)))
+ 'ext' => l10n('%s file type',strtoupper(end($extTab))),
+ 'is_svg'=> (strtoupper(end($extTab)) == 'SVG'),
);
if ($conf['rate'] and !empty($row['rating_score']))
diff --git a/admin/themes/default/template/batch_manager_unit.tpl b/admin/themes/default/template/batch_manager_unit.tpl
index 61a94d49a..f770f8120 100644
--- a/admin/themes/default/template/batch_manager_unit.tpl
+++ b/admin/themes/default/template/batch_manager_unit.tpl
@@ -56,7 +56,7 @@ jQuery("a.preview-box").colorbox( {
-
+
{'Edit'|@translate}
diff --git a/admin/themes/default/template/picture_modify.tpl b/admin/themes/default/template/picture_modify.tpl
index 1245890fd..9bfff1a83 100644
--- a/admin/themes/default/template/picture_modify.tpl
+++ b/admin/themes/default/template/picture_modify.tpl
@@ -96,7 +96,7 @@ $('#action-delete-picture').on('click', function() {
{combine_css path="admin/themes/default/fontello/css/animation.css" order=10} {* order 10 is required, see issue 1080 *}