Re: [Gimp-user] batch mode in gimp?



IMHO, the best candidate for these repetitive jobs is ImageMagick - as
suggested before by ofnuts.  Or with a shell script invoking "convert" (as
shown in the example) or (if you have some programming experience) with a
simple C program using the Magick shared library.  In this way i wrote a
simple program to resize images, adjusting the quality in order to generate
a file not bigger than a specified limit.



On Fri, Aug 2, 2013 at 10:37 AM, Josef Wolf <jw raven inka de> wrote:

On Fr, Aug 02, 2013 at 03:32:55 +1200, Jehan Pagès wrote:
You can do it this way. Tested by myself right now and working well:

$ gimp-2.9 -i -d -f -s -b "`cat script.scm` (simple-unsharp-mask
\"file.png\" 5.0 0.5 0)" -b '(gimp-quit 0)'

So basically you could have your small shell script call-gimp-function
with the following code inside:

------------------------------------------------------
#!/bin/sh

gimp-2.9 -i -d -f -s -b "`cat \"$1\"` $2" -b '(gimp-quit 0)'
------------------------------------------------------

Then you can call it this way:
$ ./call-gimp-function script.scm "(simple-unsharp-mask \"file.png\" 5.0
0.5 0)"

Thanks for your suggestion, Jehan!

In fact, that's what I'm currently doing. But I thought there must be a
better
way, since this is very prone to quoting errors. I got hidden badly when I
tried to pass a color definition as a quoted scheme list =:8O

I think it should work well even if there are double quotes in the
definition script because I think cat escapes them before feeding the
contents to the main command.

I'd rather redirect stdin instead of using cat.

PS: where can I find information about how to access operating system
(files,
directories, environment, etc) from script-fu? I've been searching for
TinyScheme ducumentation but could not find anyting. There seems to be
something like txn extensions and re extensions. But they don't seem to be
available from script-fu? Any hints?

--
Josef Wolf
jw raven inka de
_______________________________________________
gimp-user-list mailing list
List address:    gimp-user-list gnome org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list




-- 
(@_  |
//\  | Maurizio Loreti - Fisico in pensione, nonno felice di
V_/_ | due nipotini, vagabondo e fotografo a tempo perso...


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