Re: Gimp-Python with no ui? (external script)

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

 



Carol Spears <carol <at> gimp.org> writes:

> http://carol.gimp.org/gimp/scripting/routines.html#shell

 Does that work with gimp 2.2? I'm also trying to get a pygimp script to run in
batch mode, but it doesn't work. I tried running your python_fu_batch_resize
example (adapting directories of course) but it didn't work. So I wrote a simple
test script and I tried running that. This is the code:

 #!/usr/bin/python

 from gimpfu import *

 def test():
   width = 530
   height= 56
   bg_colour = (255, 255, 255)
   # Create new image
   img = pdb.gimp_image_new(width, height, RGB)
  
   # Create and fill background layer
   bg_layer = pdb.gimp_layer_new(img, width, height, RGBA_IMAGE, "Background", 
100, NORMAL_MODE)
   pdb.gimp_context_set_background(bg_colour)
   pdb.gimp_drawable_fill(bg_layer,BACKGROUND_FILL)
   pdb.gimp_image_add_layer(img,bg_layer,0)
   pdb.gimp_display_new(img)
  
 register("Test",
          "", "", "", "", "",
          "<Toolbox>/Xtns/Python-Fu/Test",
          "RGB*, GRAY*",
          [],
          [],
          test
         )

 main()

I called gimp like this
 
 gimp-2.2 -i -b '(Test RUN-NONINTERACTIVE)' -b '(gimp-quit 0)'

And I got these messages:
 
 No batch interpreter specified, using the default 'plug_in_script_fu_eval'.
 batch command: experienced an execution error.
 batch command: experienced an execution error.

The script works normally when called from within gimp, so I don't really see
why it should fail, unless gimp doesn't process python in batch mode. What am I
doing wrong here?

--
Alex

_______________________________________________
Gimp-developer mailing list
Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux