RSS/Atom feed Twitter
Site is read-only, email is disabled

Newbie needs help making batch reflect script

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

Newbie needs help making batch reflect script Mark McLaren 06 Jul 00:40
  Newbie needs help making batch reflect script Mark McLaren 06 Jul 12:13
  Newbie needs help making batch reflect script saulgoode@flashingtwelve.brickfilms.com 06 Jul 15:26
Mark McLaren
2010-07-06 00:40:49 UTC (over 14 years ago)

Newbie needs help making batch reflect script

Hi all,

I am a Script-Fu and Scheme newbie; please forgive my ignorance. I am trying add reflection to a batch of PNG files using the GIMP reflection plugin from:

http://registry.gimp.org/node/1025

I have previously been able to batch re-size my PNG files using a script-autocrop script that I found on the GimpTalk forum.

http://www.gimptalk.com/forum/script-autocrop-p265988.html

To create a batch reflection script I have tried taking a copy of script-autocrop, changed the definition name to match the new filename and changed the "plug-in-autocrop" line so that it call the reflection plugin instead, like this:

(script-fu-gimp-reflection RUN-NONINTERACTIVE image drawable 30 100 FALSE TRUE)

If I run it, I get the following error:

GIMP-Error: Calling error for procedure 'gimp-file-save': Procedure 'gimp-file-save' has been called with an invalid ID for argument 'draw
able'. Most likely a plug-in is trying to work on a layer that doesn't exist any
longer.

batch command experienced an execution error

What am I doing wrong? Any assistance is appreciated.

Many thanks,

Mark

OS: winxp GIMP: 2.6.8

Mark McLaren
2010-07-06 12:13:00 UTC (over 14 years ago)

Newbie needs help making batch reflect script

I realized that this wasn't particularly descriptive. My failing script looks like this:

(define (script-reflect filename) (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) (drawable (car (gimp-image-get-active-layer image)))) (script-fu-gimp-reflection RUN-NONINTERACTIVE image drawable 30 100 FALSE TRUE) (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename) (gimp-image-delete image)))

Thank you for any help,

Mark

On Mon, Jul 5, 2010 at 11:40 PM, Mark McLaren wrote:

Hi all,

I am a Script-Fu and Scheme newbie; please forgive my ignorance.  I am trying add reflection to a batch of PNG files using the GIMP reflection plugin from:

http://registry.gimp.org/node/1025

I have previously been able to batch re-size my PNG files using a script-autocrop script that I found on the GimpTalk forum.

http://www.gimptalk.com/forum/script-autocrop-p265988.html

To create a batch reflection script I have tried taking a copy of script-autocrop, changed the definition name to match the new filename and changed the "plug-in-autocrop" line so that it call the reflection plugin instead, like this:

(script-fu-gimp-reflection RUN-NONINTERACTIVE image drawable 30 100 FALSE TRUE)

If I run it, I get the following error:

GIMP-Error: Calling error for procedure 'gimp-file-save': Procedure 'gimp-file-save' has been called with an invalid ID for argument 'draw
able'. Most likely a plug-in is trying to work on a layer that doesn't exist any
 longer.

batch command experienced an execution error

What am I doing wrong?  Any assistance is appreciated.

Many thanks,

Mark

OS: winxp GIMP: 2.6.8

saulgoode@flashingtwelve.brickfilms.com
2010-07-06 15:26:48 UTC (over 14 years ago)

Newbie needs help making batch reflect script

Quoting Mark McLaren :

To create a batch reflection script I have tried taking a copy of script-autocrop, changed the definition name to match the new filename and changed the "plug-in-autocrop" line so that it call the reflection plugin instead, like this:

(script-fu-gimp-reflection RUN-NONINTERACTIVE image drawable 30 100 FALSE TRUE)

If I run it, I get the following error:

GIMP-Error: Calling error for procedure 'gimp-file-save': Procedure 'gimp-file-save' has been called with an invalid ID for argument 'draw
able'. Most likely a plug-in is trying to work on a layer that doesn't exist any longer.

The original call to 'plug-in-autocrop' does not alter the value for 'drawable'. Whatever layer was passed to the plug-in still exists (though it gets cropped).

However, the reflection script destroys the original layer passed to it -- merging it with the other layers to produce a new layer. This means the 'drawable' argument you passed to the script will no longer be valid after the script has returned, and you need to set the value of 'drawable' to a valid layer. Hopefully, the script leaves the appropriate layer active when it returns so that you can use 'gimp-image-get-active-layer' to set 'drawable' properly.