Results 1 to 2 of 2

Thread: GIMP batch process script run-time error

  1. #1
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,263
    Distro
    Ubuntu

    Question GIMP batch process script run-time error

    I need a bit of help, please, with scripting a batch process for GIMP. I hope that I'm asking on the right forum; if there is a better place to ask, please point me in the right direction. (I'm an absolute beginner when it comes to GIMP scripting.)

    I have a bunch of images that I wish to process with script-fu-pencil-drawing. For simplicity's sake, I'll talk about just a single image in this post.

    I have used the tutorial for GIMP batch scripting. Taking the tutorial's example verbatim works perfectly. But when I adjust the script for script-fu-pencil-drawing, I get an error.

    Note that script-fu-pencil-drawing works when used interactively; it is only when used in this batch script that it fails.

    Here is the script as I've adjusted it. The changes are highlighted.
    Code:
    (define (simple-script-fu-pencil-drawing filename
                                             radius
                                             strength
                                             mergelayers)
       (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
              (drawable (car (gimp-image-get-active-layer image))))
              (script-fu-pencil-drawing RUN-NONINTERACTIVE
                                        image drawable radius strength mergelayers)
         (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
         (gimp-image-delete image)))
    Here is the command that I run on the command line, where foo.png is the image to be processed. Again, changes are highlighted.
    Code:
    gimp -i -b '(simple-script-fu-pencil-drawing "foo.png" 8.0 16.0 TRUE)' -b '(gimp-quit 0)'
    Here is the output. The original foo.png is left unchanged.
    Code:
    GIMP-Error: Calling error for procedure 'gimp-layer-copy':
    Procedure 'gimp-layer-copy' has been called with an invalid ID for argument 'layer'. Most likely a plug-in is trying to work on a layer that doesn't exist any longer.
    
    batch command experienced an execution error:
    Error: ( : 1) Procedure execution of gimp-layer-copy failed on invalid input arguments: Procedure 'gimp-layer-copy' has been called with an invalid ID for argument 'layer'.
    Most likely a plug-in is trying to work on a layer that doesn't exist any longer.
    I have been at this for a couple of hours, and nothing that I've tried has worked. If you could help me fix this, please, I would be most grateful.
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

  2. #2
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,263
    Distro
    Ubuntu

    Re: GIMP batch process script run-time error

    Someone gave me the solution, in case this helps anyone else with this problem.
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •