x
Loading
 Loading
Hello, Guest | Login | Register

Making the Most of Script-Fu Server

For all the great things that can be said about the GIMP, one thing that you can’t say is that it’s a model Unix application. You can’t send anything into its standard input, nor get anything from its standard output. The GIMP is a universe unto itself, and this flies in the face of the Unix philosophy, which shuns interactive interfaces and encourages developers to make every program a filter.

For all the great things that can be said about the GIMP, one thing that you can’t say is that it’s a model Unix application. You can’t send anything into its standard input, nor get anything from its standard output. The GIMP is a universe unto itself, and this flies in the face of the Unix philosophy, which shuns interactive interfaces and encourages developers to make every program a filter.

There’s nothing intrinsically wrong with being interactive; shells are interactive, and so is vi, but interactive programs have a tendency to not play well with others. Unfortunately, the GIMP is one such program, but there is hope.

The Script-Fu Server

The Script-Fu Server is like a back door into the GIMP. By connecting to a TCP socket (usually on port 10008), a program from outside the GIMP can communicate with it by sending arbitrary Scheme code. (For more information about Scheme, see the January 2002 Power Tools column.) However, letting untrusted code run wild on your system is a recipe for disaster, so the developers of the GIMP made things more secure by “crippling” the interpreter. This reduced functionality makes things difficult.

The protocol for communicating with the Script-Fu Server is not documented anywhere, but examination of the GIMP source file plug-ins/script-fu/ script-fu-server.c shows that the protocol is very simple. Table One describes the format of a Script-Fu request.

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?
Read More
  1. Helpful Tools for Software Developers
  2. The Github Hall of Fame
  3. Book'em, Github.
  4. This Week on Github: Stupid Ruby Tricks
  5. A Veritable Scatter Shot!
Follow Linux Magazine
Rackspace