fixes #2254 adjust placement of int casting

...for SVG width and height values
This commit is contained in:
Linty 2024-10-25 14:30:24 +02:00
parent 29b1c32fbc
commit 65dce73ef8

View file

@ -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]);
} }
} }