mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-26 11:19:55 +03:00
fixes #2254 adjust placement of int casting
...for SVG width and height values
This commit is contained in:
parent
29b1c32fbc
commit
65dce73ef8
1 changed files with 6 additions and 6 deletions
|
@ -188,24 +188,24 @@ function get_sync_metadata($infos)
|
||||||
|
|
||||||
$xmlget = simplexml_load_string($xml);
|
$xmlget = simplexml_load_string($xml);
|
||||||
$xmlattributes = $xmlget->attributes();
|
$xmlattributes = $xmlget->attributes();
|
||||||
$width = (int) $xmlattributes->width;
|
$width = $xmlattributes->width;
|
||||||
$height = (int) $xmlattributes->height;
|
$height = $xmlattributes->height;
|
||||||
$vb = (string) $xmlattributes->viewBox;
|
$vb = (string) $xmlattributes->viewBox;
|
||||||
|
|
||||||
if (isset($width) and $width != "")
|
if (isset($width) and $width != "")
|
||||||
{
|
{
|
||||||
$infos['width'] = $width;
|
$infos['width'] = (int) $width;
|
||||||
} elseif (isset($vb))
|
} elseif (isset($vb))
|
||||||
{
|
{
|
||||||
$infos['width'] = explode(" ", $vb)[2];
|
$infos['width'] = round(explode(" ", $vb)[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($height) and $height != "")
|
if (isset($height) and $height != "")
|
||||||
{
|
{
|
||||||
$infos['height'] = $height;
|
$infos['height'] = (int) $height;
|
||||||
} elseif (isset($vb))
|
} elseif (isset($vb))
|
||||||
{
|
{
|
||||||
$infos['height'] = explode(" ", $vb)[3];
|
$infos['height'] = round(explode(" ", $vb)[3]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue