Graechan wrote:
Saulgoode is what you have stated in part 1 a naming convention that I have not used through ignorance and if so thank you for the heads up.
Yes, it is merely a matter of convention, and let's the user know whether the command will present a dialog expecting further input.
Also as a minor point with regard to convention, the pop-up blurb for a command should describe what running the command will do, not what the command does. For example, your Rasterize command
will "
Make the active Selection or Image look blocky" (not "
Makes the ..."). This is admittedly a bit nit-picky but for consistency your script should strive to follow the same convention as used throughout the rest of the GIMP menus.
Graechan wrote:
I now understand part 2 as the drawable may not be same size as image I've changed to use 'gimp-drawable-mask-bounds'
A word of caution on 'gimp-drawable-mask-bounds', the first value returned will be TRUE if there is selection and that selected region does not overlap the layer. In this situation, the coordinates returned will be the boundaries of the layer (relative to the layer). Unless you test for this condition, your script may wrongly assume the entire layer is selected even if none of it is.
This behavior of 'gimp-drawable-mask-bounds' was considered to be a bug, but it was not discovered until it was too late (and fixing it would have broken too many existing scripts). The developers chose to introduce a new procedure, 'gimp-drawable-mask-intersect', which returns FALSE if there is a selection but that selection does not overlap the layer. In general, 'gimp-drawable-mask-intersect' is preferable (note, however, that it returns the selection's width and height, not the lower and right boundary).