Re: Procedural database execution of gimp-image-convert-grayscale failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I made a couple changes nothing major.  You didn't define some variables for example.  I haven't run it but the script compiles now.  

(define (script-fu-bb image drawable location inText)
   (let*
   (
   ( theImageHeight 0)
   ( theImageWidth 0 )
   ( theOffsetX 0 )
   ( namepng 0 )
   ( layer 0 )
   ( drawable 0 )
   )
   (gimp-image- convert-grayscale image)

   (set! drawable (car (gimp-image- get-active- drawable image) ) )
   (gimp-by-color- select drawable '(255 255 255) 60 2 1 0 0 0) 
   (gimp-edit-cut drawable)

   (set! theImageWidth (car ( gimp-drawable- width drawable) ) )
   (set! theImageHeight (car ( gimp-drawable- height drawable) ) )

   (set! theImageWidth (/ (* 180 theImageWidth) theImageHeight) )
   (gimp-image- scale image theImageWidth 180)

   (set! theOffsetX (/ (- 240 theImageWidth) 2))
   (gimp-image- resize image 240 180 theOffsetX 0)
   (set! layer (car (gimp-image- get-active- layer image) ) )
   (gimp-layer- resize-to- image-size layer)

   (set! namepng (string-append location inText ".png"))
   (file-png-save2 1 image drawable namepng inText 1 2 0 0 0 1 1 0 0)
   (gimp-image- clean-all image)
   )
)

   (script-fu-register "script-fu-bb"
   "bb"
   "creation format illustration"
   "Loic"
   "copyright 2007, Loic"
   "Mars 2007"
   ""

   SF-IMAGE "Image" 0
   SF-DRAWABLE "drawable" 0
   SF-STRING "location" "Desktop/Images/ "
   SF-STRING "Text" "a"
   )

   (script-fu-menu- register "script-fu-bb" "<Image>/Script- Fu")



loicprojet <loicprojet@xxxxxxxx> wrote:                               Hello,
 
 I have this ERROR message since I install Gimp 2.4.0
 Procedural database execution of gimp-image-convert-grayscale failed
 
 My script-fu is quite simple but I can't understand where is the
 mistake. Just have look. Thank a lot for your suggestions
 
 (define (script-fu-bb image drawable location inText)
 
 (let*
  (
  (theImageHeight)
  (theImageWidth)
  (theOffsetX)
  (namepng)
  (layer)
  )
  (gimp-image-convert-grayscale image) 0
 
  (set! drawable (car (gimp-image-get-active-drawable image) ) )
  (gimp-by-color-select drawable '(255 255 255) 60 2 1 0 0 0)
  (gimp-edit-cut drawable)
 
  (set! theImageWidth (car ( gimp-drawable-width  drawable) ) )
  (set! theImageHeight (car ( gimp-drawable-height  drawable) ) )
 
  (set! theImageWidth (/ (* 180 theImageWidth) theImageHeight))
  (gimp-image-scale image theImageWidth 180)
 
  (set! theOffsetX (/ (- 240 theImageWidth) 2))
  (gimp-image-resize image 240 180 theOffsetX 0)
  (set! layer (car (gimp-image-get-active-layer image) ) )
  (gimp-layer-resize-to-image-size layer)
 
  (set! namepng (string-append location inText ".png"))
  (file-png-save2 1 image drawable namepng inText 1 2 0 0 0 1 1 0 0)
  (gimp-image-clean-all image)
  )
 )
 
 (script-fu-register "script-fu-bb"
  "bb"
  "creation format illustration"
  "Loic"
  "copyright 2007, Loic"
  "Mars 2007"
  ""
  
  SF-IMAGE "Image"  0
  SF-DRAWABLE "drawable" 0
         SF-STRING   "location"      "Desktop/Images/"
  SF-STRING "Text"  "a"
 )
 
 (script-fu-menu-register "script-fu-bb" "<Image>/Script-Fu")
 
 
     
                               

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

[Non-text portions of this message have been removed]


[Index of Archives]     [Gimp Developers]     [Gimp Users]     [Yosemite News]     [Epson Inkjet Printers]     [Scanners]     [Gimp's Home]     [Steve's Art]

&hbsp; Powered by Linux