You are here

Creating Gimp Batch Conversion Script (Python)

Hi All

Bit of a newb so please excuse me.

Earlier today I wrote this batch conversion script (based on an example script) for converting DDS files to DTX5 DDS files however it crashes Gimp when I try to use it and due to the lack of error handling I have no idea where to go now. Can anyone give me any pointers please?

Script:
http://pastebin.com/jCEKQugN

Forums: 

I don't use Python so take this with a grain of salt...

The procedure you define, "batch_convert(img, layer, inputFolder, outputFolder)", is expecting an image and a layer to be provided as arguments, however, your registration block does not specify PF_IMAGE and PF_LAYER.

Since you do not need an image to be open when your script is run (it operates on files, not the current image), you should not include 'img' and 'layer' as parameters in your procedure definition. (Also, you can remove the asterisk in line 29 so that your menu command will be available even if you have no image open.)

Subscribe to Comments for "Creating  Gimp Batch Conversion Script (Python)"