Re: [Gimp-user] Script-fu in GIMP - and batch processing.



Hello everyone,

I tried this:

 (define (batch-unsharp-mask pattern radius amount threshold)
  (let* ((filelist (cadr (file-glob pattern 1))))
    (while (not (null? filelist))
           (let* ((filename (car filelist))
                  (filenamenew (string-append (car filelist) "-new")) ; as well as (filenamenew 
(string-append filename "-new"))
                  (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
                  (drawable (car (gimp-image-get-active-layer image))))
             (plug-in-unsharp-mask RUN-NONINTERACTIVE image drawable radius amount threshold)
             (gimp-file-save RUN-NONINTERACTIVE image drawable filenamenew filenamenew)
             (gimp-image-delete image))
           (set! filelist (cdr filelist)))))

calling the programme with this command:

gimp -i -b '(batch-unsharp-mask "*.JPG" 5.0 0.5 0)' -b '(gimp-quit 0)'

Unfortunately I did not have the expected success, as I got this result:

batch command experienced an execution error: Error: Procedure execution of gimp-file-save failed: unknown 
file type

It looks like this variable I call "filenamenew" is not accepted.

I don't know if it's because of my GIMP version (2.10.8 for Debian GNU-Linux 10)...

But well, anyway, I don't mind anymore. I was just trying to face a challenge, but I can get around and avoid 
it: I'll just accept that my edited files do not get a new name; I will just have to keep the originals 
stored elsewhere, so no need to bother...

So, thanks very much to all of you for your suggestions, I really appreciated you taking my question 
seriously.

Cheers.

Ludo



Message: 3
Date: Sun, 30 May 2021 13:30:26 -0400
From: Kevin Cozens <kevin ve3syb ca><mailto:kevin ve3syb ca>
To: gimp-user-list gnome org<mailto:gimp-user-list gnome org>
Subject: Re: [Gimp-user] Script-fu in GIMP - and batch processing.
Message-ID: <94e20ccd-ee8a-aa44-9d8b-3a0ef6ad8255 ve3syb ca><mailto:94e20ccd-ee8a-aa44-9d8b-3a0ef6ad8255 
ve3syb ca>
Content-Type: text/plain; charset=utf-8; format=flowed

On 2021-05-15 11:45 a.m., ludo0565 dbmail com<mailto:ludo0565 dbmail com> wrote:


Then I tried with this:


[snip]


 ?????????? ??? ? (filenamenew (+ "(car filelist)" "-new"))


[snip]


But that didn't work either, because the argument to " + " (sum) must be a number.


The problem with that line is that you are passing two strings to + instead
of passing numbers to it. The + symbol means add two numbers together. What
you want is string concatenation.

Try the following:
     (filenamenew (string-append (car filelist) "-new"))


--
Cheers!

Kevin.

http://www.ve3syb.ca/               | "Nerds make the shiny things that
https://www.patreon.com/KevinCozens | distract the mouth-breathers, and
                                     | that's why we're powerful"
Owner of Elecraft K2 #2172          |
#include <disclaimer/favourite>     |             --Chris Hardwick





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