Post Reply 

A script fu (rounded corners) from the command line...

May 4, 2012, 21:07
Post: #1
A script fu (rounded corners) from the command line...
Hello there!
I've made a script in order to round the corners of my images with one click.
Maybe it wasn't necessary, because I could use script-fu-round-corners in the command line, but that's what I've tried, stupid or not:
(define (script-fu-rounded-corners image drawable)
  (let* ()
    (script-fu-round-corners image drawable 10 FALSE 8 8 15 FALSE FALSE)
    (gimp-file-save RUN-NONINTERACTIVE image drawable "/home/alex/Desktop/1.png" "/home/alex/Desktop/1.png")

(script-fu-register "script-fu-rounded-corners"
                    "Round Corners"
                    "Script by Alex"
                    "Copyright (C) 2012 Alex"
                    "Version 0.1"
                    SF-IMAGE "Input Image" 0
                    SF-DRAWABLE "Input Drawable" 0

(script-fu-menu-register "script-fu-rounded-corners" "<Image>/Alex")
And I've run it like this from the command line:
gimp -i -b '(script-fu-rounded-corners "2.png"' -b '(gimp-quit 0)'

And here are the 3 major problems:

a) If I open an image in gimp and run the script from inside gimp, then the image /home/alex/Desktop/1.png is created successfully and everything is fine. When I run the above command from the command line, it exits without errors but nothing happens to the image.

b) As 4th and 5th argument in gimp-file-save I've hardcored the path of the image, but I'd like to overwrite automatically the specified image, I've tried instead of hardcoring the path to put the variable 'image', but it isn't of type 'STRING', and this type of variable is needed there. No clues.

c) It feels like that this could be done without the use of the custom script-fu called 'script-fu-rounded-corners' I made. It could probably be a one-liner in gimp, where 'script-fu-round-corners' is being called.

Thanks in advance for any help!
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
A script fu (rounded corners) from the command line... - hakermania - May 4, 2012 21:07

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How do you make a line and shape on Gimp? hibi 3 203 Jul 5, 2014 15:19
Last Post: hibi
  line art layer selection arnisd 1 175 Jun 8, 2014 21:06
Last Post: ofnuts
  How to draw a straight line with the GIMP. sepoto 14 1,738 May 31, 2014 07:12
Last Post: iForStyle007
  Cleaning up a low rez [coloring book] line drawing. nyxythepixy 2 412 Apr 12, 2014 22:24
Last Post: nyxythepixy
  Color replacement from the command line blue1 1 208 Feb 17, 2014 23:58
Last Post: ofnuts

Forum Jump:

GIMP ForumPortalArchiveContactTermsRSS