Re: [Gimp-user] script-fu - ERROR: bad function

2006-07-12 Thread Narushima Hironori
Wow, I modify code by refer follow code to running script!
Thank you.

(Difficult to learn new language, but script-fu is very useful. thank you.)

[EMAIL PROTECTED] wrote:

> 
> I think that what saulgoode pointed out DOES meet your trouble.
> By the error message Gimp told that the value of "(print image)"
> might not be a function (and never).
> My poor guess is:
> 
> ***
> *** 34,40 
> )
>   )
>   
> ! (if (< 0 count) (
> (print image) ;; print
> (gimp-image-convert-indexed image 0 0 255 FALSE TRUE "")
> (print image) ;; not print
> --- 34,40 
> )
>   )
>   
> ! (if (< 0 count) (begin
> (print image) ;; print
> (gimp-image-convert-indexed image 0 0 255 FALSE TRUE "")
> (print image) ;; not print

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] script-fu - ERROR: bad function

2006-07-11 Thread out_of_s
> [EMAIL PROTECTED] wrote:
> > I think that there exists a problem with the construct of your IF 
> > statement.
> > 

> My scheme format might be strange.
> But that is not relation with error `ERROR: bad function.'

I think that what saulgoode pointed out DOES meet your trouble.
By the error message Gimp told that the value of "(print image)"
might not be a function (and never).
My poor guess is:

***
*** 34,40 
)
  )
  
! (if (< 0 count) (
(print image) ;; print
(gimp-image-convert-indexed image 0 0 255 FALSE TRUE "")
(print image) ;; not print
--- 34,40 
)
  )
  
! (if (< 0 count) (begin
(print image) ;; print
(gimp-image-convert-indexed image 0 0 255 FALSE TRUE "")
(print image) ;; not print
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] script-fu - ERROR: bad function

2006-07-11 Thread Narushima Hironori
[EMAIL PROTECTED] wrote:
> I think that there exists a problem with the construct of your IF 
> statement.
> 

My scheme format might be strange.
But that is not relation with error `ERROR: bad function.'

I use The GIMP for Windows (version 2.2.11) in WindowsXPSP2.
(binary founded in gimp-win.sourceforge.net)

Does an other platform not output bad function error in
(gimp-image-convert-indexed) ???

Thanks.
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] script-fu - ERROR: bad function

2006-07-11 Thread saulgoode

I think that there exists a problem with the construct of your IF statement.

The format of IF statements in Scheme is:

(if condition
  do_this_if_true
  do_this_if_false
  )

For example:

(if (< x 0)
  (print "X is negative")
  (print "X is positive")
  )

The "do_this_if_false" is optional but if you wish to do more than one  
thing, you must use a "(begin" ... ")" statement.


(if (< x 0)
  (begin
(print "X is negative")
(set! sign -1)
)
  (begin
(print "X is positive")
(set! sign 1)
)
  )




___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] script-fu - ERROR: bad function

2006-07-10 Thread Narushima Hironori
I write follow script (convert bitmap images to join layer to distribute
animated gif file)

But I'm in stagnation. Console display only `ERROR: bad function' and
other no hint.

-- 
(define (bmp_to_gifani directory transparent-color ms-per-frame)
  (let* (
  (filelist (cadr (file-glob (string-append directory "\\*") 1)))
  (image (car (gimp-image-new 8 8 RGB)))
  (count 0)
)
(gimp-display-new image)
(while filelist
  (let* (
  (bmp-filepath (car filelist))
  (bmp-image (car (gimp-file-load
RUN-NONINTERACTIVE  
bmp-filepath
bmp-filepath)))
  (layer
(car (gimp-layer-new-from-drawable
  (car (gimp-image-get-active-layer bmp-image))
  image)))
)
(gimp-layer-set-offsets layer 0 0)
(gimp-image-add-layer image layer 0)
(gimp-image-resize-to-layers image)

(gimp-drawable-set-name layer
  (string-append
(number->string count)
" (" (number->string ms-per-frame) "ms)(replace)"))

(gimp-by-color-select layer transparent-color 2 FALSE 0 0 0 0)
(gimp-edit-cut layer)

(set! count (+ count 1))
(set! filelist (cdr filelist))
  )
)

(if (< 0 count) (
  (print image) ;; print
  (gimp-image-convert-indexed image 0 0 255 FALSE TRUE "")
  (print image) ;; not print
  ;;(print image)
  ;;(set! image (car (plug-in-animationoptimize RUN-NONINTERACTIVE
image image)))
  ;;(print directory)
  ;;(set! savepath (string-append directory ".gif"))
  ;;(print savepath)
  ;;(file-gif-save RUN-NONINTERACTIVE image image savepath savepath
0 1 ms-per-frame 2)
  ;;(print 5)
))
  )
)
--
- local environment
  c:\foo\1.bmp, c:\foo\2.bmp, c:\foo\3.bmp

and execute in console
  (bmp_to_gifani "c:" '(0 0 0) 50)

to display
  ERROR: bad function.

Stop in call (gimp-image-convert-indexed). How to invoke this method and
debug this situation?

Please hint me.
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user