I am currently writing on a GIMP plug-in to extract
frames and audio from MPEG videos.
The plugin's GUI is made with GLADE,
and the libmpeg3 (1.2.2) is used as MPEG-decoder.

while testing i had some Problems with passing
FLOAT parameters between my plugin and the GIMP.

- The opacity Parameter is passed from my plugin
  to the gimp_layer_new Procedure 
  with Value 100.0

  .. but is recieved in the GIMP main Application
  with Value 1.0

- The Problem is related to NLS (the LANG Environment Variable)  
  (when I do unset LANG, everything is OK)

- My PlugIn has a GUI that was created by GLADE.
  the main Routine, generated by GLADE 
  starts with:
    gtk_set_locale ();
    gtk_init (&argc, &argv);

  Without gtk_set_locale(), passing of FLOAT Parameters
  works just fine, even if LANG=german set.
  Well this is a solution for my plugin, but ...

I guess that NLS specific print representation of float numbers
can cause those troubles in the PDB Interface.

  US Decimalpoint     100.0
  German Decimalkomma 100,0

Maybe this hint could be useful for other (PlugIn)Developers too.

Should I report this as Bug of the GIMP PDB-Interface ?

Yours Wolfgang Hofer, <[EMAIL PROTECTED]> 
(Author of GAP)



Here are some additional notes about my system:

 I am using using GIMP 1.2.1
 -bash gimpixII:[gui_tst] >gtk-config --version
 -bash gimpixII:[gui_tst] >uname -a
 Linux gimpixII 2.2.16 #1 Mon Jan 1 20:47:09 CET 2001 i686 unknown

I added some printf statements to my_plugin and to
my local copy of:

to TRACE relevant procedures and parameter values
related to this problem, And here is the result:

-bash gimpixII:[gui_tst] >env | grep LANG
-bash gimpixII:[gui_tst] >gimp

MY_PLUGIN: before call to gimp_layer_new

LIBGIMP: gimp_layer_new: opacity = 100,000000

LIBGIMP: _gimp_layer_new: image_ID = 12
LIBGIMP: _gimp_layer_new: width = 320
LIBGIMP: _gimp_layer_new: height = 240
LIBGIMP: _gimp_layer_new: type = 0
LIBGIMP: _gimp_layer_new: name = my_layer
LIBGIMP: _gimp_layer_new: opacity = 100,000000
LIBGIMP: _gimp_layer_new: mode = 0
LIBGIMP: gimp_run_procedure GIMP_PDB_FLOAT: arg[5]  par: 100,000000

APP: plug_in_params_to_args arg[5]  par: 1.000000 arg:1.000000
APP: layer_new_invoker: opacity_arg = 1.000000
APP: layer_new_invoker: opacity = 2
APP: layer_new: int opacitiy = 2

MY_PLUGIN: after call to gimp_layer_new
MY_PLUGIN: gimp_layer_get_opacity 1: 7,000000


Get your small business started at Lycos Small Business at 

Reply via email to