Re: [Gimp-user] Re: Running script-fu-round-corners from gimp command line

2006-11-18 Thread Saul Goode

Von: Gene Smith [EMAIL PROTECTED]
 
 How do I put the call to gimp_image_flatten() in my script. Everything I 
 try still gives the experience an exec error message. Last thing tried:
 
 (define (round-corners filename)
 (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename 
 filename)))
(drawable (car (gimp-image-get-active-layer image
   (image (gimp_image_flatten(image)))
   (script-fu-round-corners RUN-NONINTERACTIVE
  image drawable 15 TRUE 8 8 15 TRUE FALSE)
   (set! drawable (car (gimp-image-get-active-layer image)))
   (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
   (gimp-image-delete image)))
 
(gimp_image_flatten(image)) is incorrect for a couple of reasons.

First, Script-fu never uses underscores (except for marking strings for
foreign language translation) and these need to be converted to dashes;
therefore the function becomes gimp-image-flatten.

Second, 'image' should not be within parentheses.

Third, after you perform the flatten, the variable 'drawable' is no
longer valid (flatten creates a new layer). You need to assign the
active layer to 'drawable' AFTER you perform the flatten.


It is amazing what you can accomplish if you do 
not care who gets the credit. -- Harry S. Truman

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


[Gimp-user] Re: Running script-fu-round-corners from gimp command line

2006-11-17 Thread Gene Smith

Saul Goode wrote, On 11/14/2006 01:08 AM:

I think it is just a matter of you having to flatten the image before
calling 'script-fu-round-corners' (which does not accept images with an
alpha channel).



Von: Gene Smith [EMAIL PROTECTED]



I made this script from the example and put in 
~/.gimp-2.2/scripts/round-corners.scm:


(define (round-corners filename)
   (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename 
filename)))

  (drawable (car (gimp-image-get-active-layer image
 (script-fu-round-corners RUN-NONINTERACTIVE
   image drawable 15 TRUE 8 8 15 TRUE FALSE)
 (set! drawable (car (gimp-image-get-active-layer image)))
 (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
 (gimp-image-delete image)))

and run it for a image file:

gimp -i -b '(round-corners /home/gene/product_images/white-shawl.png)' 
'(gimp-quit 0)'


No batch interpreter specified, using the default


'plug_in_script_fu_eval'.


batch command: experienced an execution error.



How do I put the call to gimp_image_flatten() in my script. Everything I 
try still gives the experience an exec error message. Last thing tried:


(define (round-corners filename)
   (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename 
filename)))

  (drawable (car (gimp-image-get-active-layer image
 (image (gimp_image_flatten(image)))
 (script-fu-round-corners RUN-NONINTERACTIVE
   image drawable 15 TRUE 8 8 15 TRUE FALSE)
 (set! drawable (car (gimp-image-get-active-layer image)))
 (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
 (gimp-image-delete image)))


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


[Gimp-user] Re: Running script-fu-round-corners from gimp command line

2006-11-13 Thread Gene Smith

Sven Neumann wrote:

Hi,

On Mon, 2006-11-13 at 01:51 -0500, Gene Smith wrote:
I have a bunch of jpg's that I need to run the stock procedure for 
making rounded corners and drop shadows on. I would like to do it from 
the command line rather than manually, one file at a time with the gui. 


Have a look at the Batch tutorial on gimp.org:

http://gimp.org/tutorials/Basic_Batch/


Sven


Thank, I did see that page.  But I just want to run an existing 
scrip-fu like this:


gimp  -i -d -b '(script-fu-round-corners RUN-NONINTERACTIVE 
./white-shawl.jpg -1 15 TRUE 8 8 15 TRUE FALSE)' '(gimp-quit 0)'


and not sure what to put in for the first 3 parameter of the 
round-corners script. I think the first one, RUN-NONINTERACTIVE, is 
right. The next two, image and drawable, I am not sure what to put in 
(possibly I need to call drawable?). The last 7 I think are OK since 
they match the gimp dialog box that you run manually. That's really what 
I am asking.


-gene

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


Re: [Gimp-user] Re: Running script-fu-round-corners from gimp command line

2006-11-13 Thread Michael Schumacher
Von: Gene Smith [EMAIL PROTECTED]

 Thank, I did see that page.  But I just want to run an existing 
 scrip-fu like this:

This is exactly what the tutorials is about.
 
 gimp  -i -d -b '(script-fu-round-corners RUN-NONINTERACTIVE 
 ./white-shawl.jpg -1 15 TRUE 8 8 15 TRUE FALSE)' '(gimp-quit 0)'
 
 and not sure what to put in for the first 3 parameter of the 
 round-corners script. I think the first one, RUN-NONINTERACTIVE, is 
 right. The next two, image and drawable, I am not sure what to put in 
 (possibly I need to call drawable?).

You have to put the call to the script at the right place - this is where the 
(plug-in-unsharp-mask RUN-NONINTERACTIVE image drawable radius amount 
threshold) is called in the example.


HTH,
Michael
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] Re: Running script-fu-round-corners from gimp command line

2006-11-13 Thread Gene Smith

Michael Schumacher wrote, On 11/13/2006 11:54 AM:

Von: Gene Smith [EMAIL PROTECTED]

Thank, I did see that page.  But I just want to run an existing 
scrip-fu like this:



This is exactly what the tutorials is about.
 

gimp  -i -d -b '(script-fu-round-corners RUN-NONINTERACTIVE 
./white-shawl.jpg -1 15 TRUE 8 8 15 TRUE FALSE)' '(gimp-quit 0)'


and not sure what to put in for the first 3 parameter of the 
round-corners script. I think the first one, RUN-NONINTERACTIVE, is 
right. The next two, image and drawable, I am not sure what to put in 
(possibly I need to call drawable?).



You have to put the call to the script at the right place - this is where the 
(plug-in-unsharp-mask RUN-NONINTERACTIVE image drawable radius amount 
threshold) is called in the example.


HTH,
Michael


I made this script from the example and put in 
~/.gimp-2.2/scripts/round-corners.scm:


(define (round-corners filename)
   (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename 
filename)))

  (drawable (car (gimp-image-get-active-layer image
 (script-fu-round-corners RUN-NONINTERACTIVE
   image drawable 15 TRUE 8 8 15 TRUE FALSE)
 (set! drawable (car (gimp-image-get-active-layer image)))
 (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
 (gimp-image-delete image)))

and run it for a image file:

gimp -i -b '(round-corners /home/gene/product_images/white-shawl.png)' 
'(gimp-quit 0)'


No batch interpreter specified, using the default 'plug_in_script_fu_eval'.
batch command: experienced an execution error.

--verbose doesn't say more.

When I run in Script-Fu Console:

= (round-corners /home/gene/product_images/white-shawl.jpg)
ERROR: Procedural database execution failed:
(gimp_image_width 1)

I still must be doing something wrong.

-gene



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


Re: [Gimp-user] Re: Running script-fu-round-corners from gimp command line

2006-11-13 Thread Saul Goode
I think it is just a matter of you having to flatten the image before
calling 'script-fu-round-corners' (which does not accept images with an
alpha channel).

 Von: Gene Smith [EMAIL PROTECTED]

 I made this script from the example and put in 
 ~/.gimp-2.2/scripts/round-corners.scm:
 
 (define (round-corners filename)
 (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename 
 filename)))
(drawable (car (gimp-image-get-active-layer image
   (script-fu-round-corners RUN-NONINTERACTIVE
  image drawable 15 TRUE 8 8 15 TRUE FALSE)
   (set! drawable (car (gimp-image-get-active-layer image)))
   (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
   (gimp-image-delete image)))
 
 and run it for a image file:
 
 gimp -i -b '(round-corners /home/gene/product_images/white-shawl.png)' 
 '(gimp-quit 0)'
 
 No batch interpreter specified, using the default
'plug_in_script_fu_eval'.
 batch command: experienced an execution error.
 
 --verbose doesn't say more.
 
 When I run in Script-Fu Console:
 
 = (round-corners /home/gene/product_images/white-shawl.jpg)
 ERROR: Procedural database execution failed:
  (gimp_image_width 1)
 
 I still must be doing something wrong.

It is amazing what you can accomplish if you do 
not care who gets the credit. -- Harry S. Truman

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