RSS/Atom feed Twitter
Site is read-only, email is disabled

trouble running autocrop from plug-in

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

trouble running autocrop from plug-in Cindy Huyser 29 Sep 22:43
  trouble running autocrop from plug-in Simon Budig 29 Sep 22:34
trouble running autocrop from plug-in Cindy Huyser 29 Sep 23:46
  trouble running autocrop from plug-in Simon Budig 29 Sep 23:35
Simon Budig
2002-09-29 22:34:11 UTC (over 21 years ago)

trouble running autocrop from plug-in

Cindy Huyser (chuyser@io.com) wrote:

I've been attempting to call the autocrop plug-in from within a C plug-in, but to no avail. My syntax is:

GimpDrawable *drawable; ...
plug_in_autocrop(image, *drawable);

[...]

drawable->autocrop();

Randomly guessing syntaxes most probably won't help you much. :-)

Libgimp has only wrappers for most of the gimp internal functions. For Plugins you need to use the gimp_run_procedure call directly, in your case something like the following (untested!):

params = gimp_run_procedure ("plug_in_autocrop", &retvals, GIMP_PDB_INT32, 1, GIMP_PDB_IMAGE, image_id, GIMP_PDB_DRAWABLE, drawable_id, GIMP_PDB_END);

I hope this helps.

Bye, Simon

Cindy Huyser
2002-09-29 22:43:55 UTC (over 21 years ago)

trouble running autocrop from plug-in

I've been attempting to call the autocrop plug-in from within a C plug-in, but to no avail. My syntax is:

GimpDrawable *drawable; ...
plug_in_autocrop(image, *drawable);

and the error I get from running gimptool --install-admin on my plug-in is

'undefined reference to plug-in autocrop'

The includes and libraries that gimptool echos when run are:

-I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include

-L/usr/lib -lgimpui -lgimp -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm

Attempting to run the plug-in with the alternate syntax:

drawable->autocrop();

generates the error

'structure has no member named 'autocrop'

If I try to run it with gimp_run_procedure, I get a segmentation fault.

Any thoughts about what I might be doing wrong?

TIA, Cindy Huyser

Simon Budig
2002-09-29 23:35:16 UTC (over 21 years ago)

trouble running autocrop from plug-in

Cindy Huyser (chuyser@io.com) wrote:

Simon Budig wrote:

Randomly guessing syntaxes most probably won't help you much. :-)

Not really a random guess, but using a _very_old documented syntax: http://www.goof.com/pcg/marc/pdb/plug_in_autocrop.html

This describes the Perl interface - not the C bindings... (ok, this is not really obvious)

Bye, Simon

Cindy Huyser
2002-09-29 23:46:56 UTC (over 21 years ago)

trouble running autocrop from plug-in

Simon Budig wrote:

Randomly guessing syntaxes most probably won't help you much. :-)

Not really a random guess, but using a _very_old documented syntax: http://www.goof.com/pcg/marc/pdb/plug_in_autocrop.html

Libgimp has only wrappers for most of the gimp internal functions. For Plugins you need to use the gimp_run_procedure call directly, in your case something like the following (untested!):

params = gimp_run_procedure ("plug_in_autocrop", &retvals, GIMP_PDB_INT32, 1, GIMP_PDB_IMAGE, image_id, GIMP_PDB_DRAWABLE, drawable_id, GIMP_PDB_END);

I hope this helps.

Bye, Simon

Thanks,
Cindy