I need to get height of a text from SVG files (id : textmaster) with php.
When running inkscape with shell_exec, the return value is different than running it directly from cmd :
<?php
$heightpx = shell_exec('inkscape --query-id="textmaster" --query-height drawing_edit.svg');
echo $heightpx;
?>
the return value was :
74.5301
But when run directly from cmd :
inkscape --query-id="textmaster" --query-height drawing_edit.svg
the return value was :
128.778
the svg files :
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="210mm"
height="297mm"
viewBox="0 0 210 297"
version="1.1"
id="svg5"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs2" />
<g
id="layer1">
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25.4773px;line-height:1.25;font-family:Austria;-inkscape-font-specification:Austria;stroke-width:0.367463"
x="20.467245"
y="47.263172"
id="textmaster"><tspan
id="tspan7489"
x="20.467245"
y="47.263172"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Austria;-inkscape-font-specification:Austria;stroke-width:0.367463">Hello World!</tspan></text>
</g>
</svg>
The right value was when it run directly from cmd prompt.
How to make the shell_exec called from php return the same values?