[inx] min/max float values ignored with locale using comma as decimal separator

Bug #647744 reported by su_v on 2010-09-25
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Follow-up to Bug #442642 “Inkscape crashes on Effects: render: grid without default”

Reported on #inkscape irc channel:
Miraceti wrote:
> I have noticed a bug in 0.47 and 0.48. When running
> Extension->Render->Grid, it is possible to enter horizontal
> and/or vertical spaces = 0 which causes 100% CPU usage in
> apparently neverending loop.

> Well, experiencing problems with small values could be unpleasant
> but zero should not definitely be tried to render at all.

> Division by zero is much worse than just consuming a lot of memory.

> I guess, zero should be filtered out already on UI level.

The lower limit to '0.1' doesn't seem to be in effect with certain locale setting (LC_NUMERIC): a comma as decimal separator apparently allows to enter '0,0' into the dialog:

Reported on irc by Miraceti with
Linux jiri1 2.6.35-gentoo-r4 #1 Sat Sep 4 13:26:57 EEST 2010 i686 AMD Athlon(tm) XP 1800+ AuthenticAMD GNU/Linux
gentoo package media-gfx/inkscape-0.48.0 (marked unstable in Gentoo now)

Also confirmed by sanguivor (on irc) for the bzr version:
Locale is a mixture of en_DK.UTF-8 and fi_FI.UTF-8.

Reproduced with Inkscape 0.48+devel r9785 on OS X 10.5.8: If I change the language ($LANG) for the Inkscape process so that comma is used as decimal separator, the lower limit for x/y spacing (0.1) no longer applies.

su_v (suv-lp) wrote :
su_v (suv-lp) wrote :

The min/max values are defined in the extension definition file:

            "<param name=\"xspacing\" gui-text=\"" N_("Horizontal Spacing:") "\" type=\"float\" min=\"0.1\" max=\"1000\">10.0</param>\n"
            "<param name=\"yspacing\" gui-text=\"" N_("Vertical Spacing:") "\" type=\"float\" min=\"0.1\" max=\"1000\">10.0</param>\n"

Ignoring the min/max float values depending on decimal separator is possibly a similar issue as reported in bug #571196.

Alvin Penner (apenner) wrote :

confirmed in Windows XP using Render->Grid
If I use Control Panel->Regional Options->Customize and set the decimal symbol to be 'comma', then the Render Grid spinbox allows me to choose a spacing of 0,0. If I type manually the value 0, then this gets converted to 0,0 on loss of focus, instead of the expected value of 0,1

Changed in inkscape:
status: New → Confirmed
jazzynico (jazzynico) on 2010-09-26
tags: added: i18n
jazzynico (jazzynico) wrote :

Since I can lead to crashes, setting Importance to High.

Changed in inkscape:
assignee: nobody → JazzyNico (jazzynico)
importance: Undecided → High
milestone: none → 0.48.1
status: Confirmed → In Progress
jazzynico (jazzynico) wrote :

Patch attached, please test.

This patch works for me using win7 and rev9788

su_v (suv-lp) wrote :

Fix confirmed with Inkscape 0.48+devel r9788 + InxFloatMinMax.diff on OS X 10.5.8
(tested with 'export LANG="de_DE.UTF-8"' in the shell script launching inkscape-bin)

jazzynico (jazzynico) wrote :

Fix committed in the trunk (revision 9791) and 0.48.x branch (revision 9674).

Changed in inkscape:
status: In Progress → Fix Committed
jazzynico (jazzynico) on 2011-03-05
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers