Re: scanimage -L crashes SuSE 6.4

From: Nick Lamb (njl98r@ecs.soton.ac.uk)
Date: Sun Apr 16 2000 - 17:50:20 PDT

  • Next message: Wandered Inn: "Re: xscanimage on Gimp"

    On Sun, Apr 16, 2000 at 04:52:39PM +0200, Oliver Rauch wrote:
    > I do not get the problem on my system so I am not able to do some tests
    > with it.

    Oh, alright.

    > The problem only occurs when xsane does call gtk_set_locale(); and it is
    > started as gimp plugin.

    Yes, I now see why this is causing a problem for you (see end of post)

    > XSane does not change the opacity value for the gimp.

    This isn't true. You have to specify an opacity value for every new
    layer created in Gimp. XSane creates a new layer => XSane specifies
    an opacity value, it uses 100 (should probably be 100.0) in fact.

    Unfortunately, for say, German users, it sends this in the "wrong"
    format to be understood by Gimp, which is using the "C" locale.

    > It looks like
    > gimp's preset value is not correct if localization is active.

    Nope, Gimp is working just fine thanks :)

    The fix for XSane is to turn off LC_NUMERIC localisation while talking
    over the wire to Gimp, the simplest way to achieve this is to add

    #include <locale.h>
    ... in the appropriate place ...

    and add a line which says...

    setlocale(LC_NUMERIC, "C");

    soon after gtk_init() only when Gimp is being used, perhaps at the
    start of the #ifdef'd group soon after you call gtk_init().

    All other Gimp plug-ins seem to have this happen automatically, but
    I think you're the only one to call gtk_set_locale() from inside a
    Gimp plug-in AFAIK.

    Maybe I should ask gimp-devel for a better WIRE protocol for Gimp,
    but I think that would be a 2.0 request not something for 1.2.0

    Nick.

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
    



    This archive was generated by hypermail 2b29 : Sun Apr 16 2000 - 17:50:33 PDT