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

script-fu without display problem

This discussion is connected to the gimp-user-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.

script-fu without display problem Irek S?onina 05 Feb 23:51
  script-fu without display problem Sven Neumann 06 Feb 12:39
   script-fu without display problem Irek Slonina 06 Feb 12:59
    script-fu without display problem Sven Neumann 06 Feb 13:34
Irek S?onina
2004-02-05 23:51:58 UTC (about 20 years ago)

script-fu without display problem

I have wrote a small script-fu script to be run by the web, but I have encountered a problem. Script lookes like this:

(define (script-fu-xcf2gif infile outfile) (let*
(
(img (car (gimp-file-load 1 infile infile))) (drawable (car (gimp-drawable-get-image img))) )
(gimp-image-flatten img)
(gimp-image-convert-indexed img 1 0 256 0 1 "") (file-gif-save 1 img drawable outfile outfile 1 0 0 0) )
)

which I am running from console like this: gimp -d -i -b '(script-fu-xcf2gif "blokada.xcf" "blokada.gif")' '(gimp-quit 1)'

and it produces something like this: This is a development version of The GIMP. Debug messages may appear here.
gimp_composite: use=yes, verbose=no +mmx +sse +sse2 -3dnow -altivec -vis (gimp:13064): Gtk-WARNING **: cannot open display: (gimp:13061): Gimp-Plug-In-WARNING **: gimp: plug_in_flush(): error: Broken pipe
(gimp:13061): Gimp-Plug-In-WARNING **: plug_in_close: plug-in aborted before sending its procedure return values GIMP: Plug-In crashed: "gif"
(/usr/lib/gimp/1.3/plug-ins/gif)
The dying Plug-In may have messed up GIMP's internal state. You may want to save your images and restart GIMP to be on the safe side. batch command: experienced an execution error. (gimp:13061): Gimp-Plug-In-WARNING **: plug_in_close: plug-in aborted before sending its procedure return values

The same code is executed successfully when run from xterm... I have also tried to make a display with Xvfb, but 1.3 theoritically does not need it, --display switch with combine with -i is marked as incorrect.

I am using gimp-2.0pre3.

Sven Neumann
2004-02-06 12:39:12 UTC (about 20 years ago)

script-fu without display problem

Hi,

Irek S?onina writes:

I have wrote a small script-fu script to be run by the web, but I have encountered a problem. Script lookes like this:

(define (script-fu-xcf2gif infile outfile) (let*
(
(img (car (gimp-file-load 1 infile infile))) (drawable (car (gimp-drawable-get-image img))) )
(gimp-image-flatten img)
(gimp-image-convert-indexed img 1 0 256 0 1 "") (file-gif-save 1 img drawable outfile outfile 1 0 0 0) )
)

This script can only work accidentally. Have a look at this line:

(drawable (car (gimp-drawable-get-image img)))

Here you are accessing an image as if it was a drawable and then assign the image return value to a variable that is used as a drawable later.

which I am running from console like this: gimp -d -i -b '(script-fu-xcf2gif "blokada.xcf" "blokada.gif")' '(gimp-quit 1)'

and it produces something like this: This is a development version of The GIMP. Debug messages may appear here.
gimp_composite: use=yes, verbose=no +mmx +sse +sse2 -3dnow -altivec -vis (gimp:13064): Gtk-WARNING **: cannot open display:

I am sorry but I cannot reproduce this. If you can make up a simple and reproducable test case, please feel free to file a bug report.

Sven

Irek Slonina
2004-02-06 12:59:13 UTC (about 20 years ago)

script-fu without display problem

On Fri, 6 Feb 2004, Sven Neumann wrote:

This script can only work accidentally. Have a look at this line:

(drawable (car (gimp-drawable-get-image img)))

Here you are accessing an image as if it was a drawable and then assign the image return value to a variable that is used as a drawable later.

I am a newbie in script-fu, I haven't understood my fault. I admit, I have passed over the drawable chapter. What is the right thing to do, when I want to get a useable drawable, that can be passed to file-gif-save function?

I am sorry but I cannot reproduce this. If you can make up a simple and reproducable test case, please feel free to file a bug report.

Ok, thanks.

br.

Sven Neumann
2004-02-06 13:34:42 UTC (about 20 years ago)

script-fu without display problem

Hi,

Irek Slonina writes:

On Fri, 6 Feb 2004, Sven Neumann wrote:

This script can only work accidentally. Have a look at this line:

(drawable (car (gimp-drawable-get-image img)))

Here you are accessing an image as if it was a drawable and then assign the image return value to a variable that is used as a drawable later.

I am a newbie in script-fu, I haven't understood my fault. I admit, I have passed over the drawable chapter. What is the right thing to do, when I want to get a useable drawable, that can be passed to file-gif-save function?

(gimp-image-get-active-drawable image) should do the trick but it would be even better to simply use the return value of (gimp-image-flatten image).

Sven