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: Code: (define (script-fu-rounded-corners image drawable)Code: 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! |
|||
|
May 5, 2012, 07:17
Post: #2
|
|||
|
|||
|
RE: A script fu (rounded corners) from the command line...
Your problem with running it from the command line is that you have miss-understood what the "image" and "drawable" parameters are.
They are internal id NUMBERS, not strings, so you can't run your script from the command line as it stands because you don't know what the numbers are going to be. You would need to supply the filename as a string, then use something like: Code: (set! (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))) ; load the imageHave a look at the batch script I wrote for someone else, which should give you an idea how this works: http://gimpforums.com/thread-batch-despe...37#pid8937 You should be able to take that example and make it use 'script-fu-round-corners' instead of 'plug-in-despeckle' - changing the parameters accordingly of course. Kevin |
|||
|
May 5, 2012, 11:46
Post: #3
|
|||
|
|||
|
RE: A script fu (rounded corners) from the command line...
Thanks a lot
![]() After a bit of searching in your code I managed to make it work. This is the final code: Code: (define (round_the_corners filename)and i run it through a terminal as: Code: gimp -i -f -d -b '(round_the_corners "1.png")' -b "(gimp-quit 0)" |
|||
|
Oct 11, 2012, 08:32
Post: #4
|
|||
|
|||
|
RE: A script fu (rounded corners) from the command line...
Hi hakermania and all
I tried above example but it doesnt seem to work on my linux system. I tried gimp -i -f -d -b --verbose '(round_the_corners "toby.jpg")' -b "(gimp-quit 0)" and I got no of gimp errors INIT: gimp_load_config Parsing '/home/web-dev/.gimp-2.6/unitrc' Parsing '/etc/gimp/2.0/gimprc' Parsing '/home/web-dev/.gimp-2.6/gimprc' gimp_composite: use=yes, verbose=no Processor instruction sets: +mmx +sse +sse2 -3dnow -altivec -vis INIT: gimp_initialize INIT: gimp_real_initialize INIT: gimp_restore Parsing '/home/web-dev/.gimp-2.6/parasiterc' Parsing '/home/web-dev/.gimp-2.6/templaterc' INIT: gimp_real_restore Parsing '/home/web-dev/.gimp-2.6/pluginrc' Querying plug-in: '/usr/lib/gimp/2.0/plug-ins/file-uri' (file-uri:24278): Gtk-WARNING **: cannot open display: (gimp:24274): LibGimpBase-WARNING **: gimp: gimp_wire_read(): error Terminating plug-in: '/usr/lib/gimp/2.0/plug-ins/file-uri' Writing '/home/web-dev/.gimp-2.6/pluginrc' Starting extension: 'extension-script-fu' GIMP-Error: Opening '/var/www/socialapps/macgregor/facebook/spiderman_comic/test_delete/(round_the_corners "toby.jpg")' failed: No such file or directory No batch interpreter specified, using the default 'plug-in-script-fu-eval'. batch command experienced an execution error EXIT: gimp_exit EXIT: gimp_real_exit Terminating plug-in: '/usr/lib/gimp/2.0/plug-ins/script-fu' Terminating plug-in: '/usr/lib/gimp/2.0/plug-ins/script-fu' Writing '/home/web-dev/.gimp-2.6/templaterc' Writing '/home/web-dev/.gimp-2.6/parasiterc' Writing '/home/web-dev/.gimp-2.6/unitrc' EXIT: batch_exit_after_callback I appreciate if you guyz plz help me out with this. |
|||
|
Oct 11, 2012, 09:41
(This post was last modified: Oct 11, 2012 09:42 by paynekj.)
Post: #5
|
|||
|
|||
|
RE: A script fu (rounded corners) from the command line...
Your command line is wrong. The -b argument MUST have the script-command immediately after it NOT the -verbose argument (which is also wrong as it should be 2 dashes, see http://www.gimp.org/tutorials/Basic_Batch/ ).
Try: gimp -i -f -d ---verbose -b '(round_the_corners "toby.jpg")' -b "(gimp-quit 0)" Kevin |
|||
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads... | |||||
| Thread: | Author | Replies: | Views: | Last Post | |
| Line within a line for street map | Doug | 2 | 57 |
May 16, 2013 07:56 Last Post: ofnuts |
|
| Is it possible to move a layer or a selection in a straight line? | silke | 3 | 54 |
May 13, 2013 17:21 Last Post: silke |
|
| Setting increment angle of "straight" line | KrisR | 2 | 102 |
Mar 21, 2013 16:35 Last Post: KrisR |
|
| Gimp script SCM [Scale to/end at borders of] selection | HalfNote5 | 6 | 160 |
Mar 15, 2013 00:49 Last Post: HalfNote5 |
|
| How can i convert picture into dotted line | sm159753 | 5 | 354 |
Feb 20, 2013 16:05 Last Post: sm159753 |
|

Search
Member List
Help
GIMP Tutorials




