--export-area didnt handle decimal values correct
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Confirmed
|
Medium
|
Unassigned |
Bug Description
Im calling Inkscape from the console to export a particular region of a
drawing. And everytime i try to use decimal values for "--export-area" it
creates crazy results. (Used Version: 0.45.1 affects Ubuntu and Windows)
For example:
SOURCE_
TARGET_
X0=0.0
Y0=0.0
X1=$(inkscape -f $SOURCE_NAME -W)
Y1=$(inkscape -f $SOURCE_NAME -H)
AREA_ARG=
echo $AREA_ARG
inkscape \
--file=$SOURCE_NAME \
--export-
--export-
--export-width=400 \
--export-height=300
produces the following errormessage:
0.0:0.0:
** (inkscape:22037): WARNING **: Export area '0.0:0.
has negative width or height. Nothing exported.
But it has a correct width and height!
The related code is in "src/main.cpp" at Line 861:
if (sp_export_area) {
/* Try to parse area (given in SVG pixels) */
if (!sscanf(
&area.x1, &area.y1) == 4) {
Nothing exported.", sp_export_area);
return;
}
if ((area.x0 >= area.x1) || (area.y0 >= area.y1)) {
Nothing exported.", sp_export_area);
return;
}
}
I cant say what is the exact error (im no C/C++ Developer), but it seems
that sscanf dont parse or store the values correctly.
Contact: <email address hidden>
Originator: NO
I tried a little bit more and found the real reason for that behavior:
Im from germany and we use the "," instead of the "." to separate the
decimal parts. If i write the values with ",", they are parsed correctly.
But i think inkscape should constantly use the "." character, since most
other programms and also inkscape deliver values with the "." character.
What to do: Replace the sscanf() with a call that uses "." for the decimal
part in "all" languages!