[Gimp-developer] Non-interactive plug-in calls (cross-posted to comp.graphics.apps.gimp)

2002-02-10 Thread Cindy Huyser

Here's a newbie question about non-interactive plug-in calls:

I'm writing a (C) plug-in in which I intend to call another plug-in
non-interactively prior to doing my own processing.  I copy the active
layer, and since the images I'm dealing with all have an alpha channel I
make sure I'm dealing with the image background (rather than the alpha
mask); I then grab the drawable and image IDs from the scratch layer,
and then call a plug-in non-interactively.  

I know my drawable is good, as I've succeeded in doing all the desired
processing after the plug-in call. In every plug-in that I've tried,
though, GIMP_PDB_EXECUTION_ERROR is returned from the plug-in call (I've
checked the plug-ins against the image to make sure that they work on
the image before I try
the call).

Here's the skeleton of my code around the non-interactive call:

activeLayer = gimp_image_get_active_layer(image);
workingLayer = gimp_layer_copy(activeLayer);
add_OK = gimp_image_add_layer(image, workingLayer, -1); 

if((gimp_layer_get_edit_mask(workingLayer)))
setMaskOK = gimp_layer_set_edig_mask(workingLayer, 0);   

bg_drawable = gimp_drawable_get(workingLayer); 
imageID = gimp_drawable_image(bg_drawable-id);


// Call the desired plug-in --  returns GIMP_PDB_EXECUTION_ERROR
return_vals = gimp_run_procedure(plug-in-c-astretch,   
nreturn_vals,
GIMP_PDB_INT32,
GIMP_RUN_NONINTERACTIVE,
GIMP_PDB_IMAGE, imageID,
GIMP_PDB_DRAWABLE,
bg_drawable-id,
GIMP_PDB_END); 

Any insight you'd be able to lend on this problem would be greatly
appreciated!

Thanks,
Cindy Huyser
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer



Re: [Gimp-developer] Non-interactive plug-in calls (cross-posted to comp.graphics.apps.gimp)

2002-02-10 Thread Sven Neumann

Hi,

Cindy Huyser [EMAIL PROTECTED] writes:

 // Call the desired plug-in --  returns GIMP_PDB_EXECUTION_ERROR
 return_vals = gimp_run_procedure(plug-in-c-astretch,   
 nreturn_vals,
 GIMP_PDB_INT32,
 GIMP_RUN_NONINTERACTIVE,
 GIMP_PDB_IMAGE, imageID,
 GIMP_PDB_DRAWABLE,
 bg_drawable-id,
 GIMP_PDB_END); 
 
 Any insight you'd be able to lend on this problem would be greatly
 appreciated!

as a quick guess, I'd say you need to call plug_in_c_astretch since
that's how the plug-in is internally registered. Most documentation is
using hyphens here but that's just because most documentation deals
with Script-Fu which needs hyphens instead of underscores.  However I
wonder why you are getting GIMP_PDB_EXECUTION_ERROR, since that should
be GIMP_PDB_CALLING_ERROR then.


Salut, Sven

___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer