Re: [Gimp-developer] Optimizing border-like selection in python

2010-09-24 Thread Jerry Baker
o-selection). Actually the plugin this routine is part of hasn't > got much merit on rectangular/circular selections... > > > On 25/09/2010 00:27, Jerry Baker wrote: >> Ahh... autoformatting... this should be easier to read... (sorry) >> >> def create_bo

Re: [Gimp-developer] Optimizing border-like selection in python

2010-09-24 Thread Jerry Baker
ection_type='ellipse', size=3) # Fill pdb.gimp_edit_fill(drawable, 0) pdb.gimp_selection_none(image) image.undo_group_end() On 09/24/2010 06:18 PM, Jerry Baker wrote: >Calculating a new selection from the current selection would be faster > (I think): >

Re: [Gimp-developer] Optimizing border-like selection in python

2010-09-24 Thread Jerry Baker
Calculating a new selection from the current selection would be faster (I think): def create_border(image, selection_type='rectangle', size=1): is_selection, x1, y1, x2, y2 = pdb.gimp_selection_bounds(image) if is_selection: if size < 1: size = 1 if sel

Re: [Gimp-developer] Python plugin registration: choosing between a "closed" set of strings

2010-09-07 Thread Jerry Baker
If your 'variants' are similar you could just use PF_OPTION and change your variables/options with an if/else... Or you can define different functions and register them separately in the same file. The 'palette-to-gradient.py' file in the source does this... http://git.gnome.org/browse/gimp/

Re: [Gimp-developer] Scripting-Questions

2010-08-22 Thread Jerry Baker
08/22/2010 07:53 AM, oli...@first.in-berlin.de wrote: > Hi Jerry, > > thanks for your hints. > > Another question: I want to use "gimp-file-load-layer" and don't > know how to access it. > > Any idea? > > Ciao, > Oliver > > > On Sat, Aug 21, 2

Re: [Gimp-developer] Scripting-Questions

2010-08-21 Thread Jerry Baker
Hi Oliver, 1) Insert a layer at lowest position... The image.add_layer method position argument is what you need to specify. 0 places a new layer at the top, 1 would be under the first layer, 2 under the second layer, etc... image.layers give you the list of layers in the image. Use len(imag

Re: [Gimp-developer] remove layer should not force you to last selected layer

2010-03-05 Thread Jerry Baker
I've always hated the way that worked, I've got a script that deletes the active layer, then sets the layer underneath it to active if anyone wants to use it... #!/usr/bin/env python # -*- coding: utf-8 -*- # # delete-layer.py - Version 1.0 # Copyright (C) 07/11/2008 by J

[Gimp-developer] Toolbox UI/Docking

2010-02-22 Thread Jerry Baker
For discussion... https://bugzilla.gnome.org/show_bug.cgi?id=610344 Add docking capabilities to the toolbox so it would be possible to dock another dialog to the top, bottom, left or right of the toolbox or dock the toolbox on the top, bottom, left, or right of another dialog window. (In multi

[Gimp-developer] Adding plug-in-paths to python path

2010-02-03 Thread Jerry Baker
I'm trying to figure out the best way to add all of the paths listed in gimprc under 'plug-in-path' to the python path in order to properly support the python package/module structure. http://docs.python.org/tutorial/modules.html#packages Adding this would allow better organization of larger pyt

Re: [Gimp-developer] some current 2.7 issues

2009-12-07 Thread Jerry Baker
Liam R E Quin wrote: > Some nits ,some -- especially (2) and (4) -- bigger than others... > > (1) The file->export dialogue action button says save, not export > (sounds really minor but given the save/export changes, can actually > be confusing) > > (2) The default save location should not

[Gimp-developer] Workflow Tips ?

2009-11-20 Thread Jerry Baker
I keep running into the limits of gimp python so I've finally decided to start learning C. In python the development process is a lot faster. Basically "Edit File > Save > Run." - There are a lot more steps involved on the C side... I was wondering if anyone could give me some tips for speeding