New version of Gimp and .scm file no longer works

I hope I’ve posted in the right place; if not feel free to remove. I have a batch script for the “unsharp mask” filter. It was working well in an older version of Gimp. However, once I installed v. 2.8.22 it refuses to appear in Script-fu. I have tried everything commonly posted in the chats/forums and am out of ideas. I am not a coder, so hopefully it is a simple fix that I am just not seeing. Any advice is appreciated. Thanks!

(define (batch-unsharp-mask pattern
radius
amount
threshold)
(let* ((filelist (cadr (file-glob pattern 1))))
(while (not (null? filelist))
(let* ((filename (car filelist))
(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 filename filename)
(gimp-image-delete image))
(set! filelist (cdr filelist)))))

Same question from a few years ago.

That never got a reply from the OP. Nothing wrong with Gimp 2.8 but I hope you can update to Gimp 2.10

There are alternatives to script-fu batch commands. For something with a GUI there is BIMP BIMP. Batch Image Manipulation Plugin for GIMP. | Alessandro Francesconi

I agree that you should update to the latest GIMP 2.10.36

If the script still doesn’t work for you try BIMP. If there is a problem with GIMP2.10.36 maybe a developer would look at the problem but they are unlikely to look at an issue in an outdated version of GIMP.

Good luck with your problem and welcome to the forum.

This piece of code is missing the bit that makes it “register”, in other words, that tells Gimp how to call it as a script in the UI. So you won’t find it in the Gimp menus.

It is meant to be used directly in a Gimp command line (with gimp -b), perhaps using a “wrapper” shell script.

This is a guess, really need more information from New_not_guru for Operating system Win / linux / MacOS ?

…but Gimp 2.8.22 strikes a chord, it was the default version of Gimp for Ubuntu ‘bionic’ ('buntu18 + spin-offs)

Using a mint19 VM and Gimp 2.8.22 that batch script fails like this:

rich@rich-VirtualBox:~/Pictures$ gimp --version
GNU Image Manipulation Program version 2.8.22

rich@rich-VirtualBox:~/Pictures$ ls
arthur.tif batch-unsharp-mask.scm bobdylan.tif Lenna.tif

rich@rich-VirtualBox:~/Pictures$ gimp -b ‘(batch-unsharp-mask “*.tif” 5.0 0.5 0)’ -b ‘(gimp-quit 0)’

(gimp:4759): GLib-GObject-WARNING **: 09:14:48.643: g_object_set_is_valid_property: object class ‘GeglConfig’ has no property named ‘cache-size’
batch command experienced an execution error:
Error: ( : 21863) eval: unbound variable: batch-unsharp-mask

…and since GEGL comes into the error, that script is probably not easily fixable.

If using linux:
(1) Back to BIMP. I have an old linux version that works with Gimp 2.8.22 Ask and I can supply (BIMP version 1.18).

(2) It is still possible with bionic to upgrade to Gimp 2.10.22 using a PPA

Snags: unsharp-mask is now a GEGL procedure, but there is a compatibility plugin to call, It does work with BIMP, at least it does for me. Again I can supply a linux BIMP 2.6 - just ask.

Thank you, Everyone! For some bizarre reason, I tried the gimp -b prefix and it gave me an error, then I ran the command without “gimp -b” and by some miracle it works! Still can’t see it in the menu, but I’ll take it as a win.

gimp -b ‘(batch-unsharp-mask “.tif" 19.0 1.2 0.0)’
Error: ( -b '(batch-unsharp-mask "
.tif” 19.0 1.2 0.0)’ : 1) eval: unbound variable: gimp

(batch-unsharp-mask “*.tif” 19.0 1.2 0.0)
()