Gimp 2.99: How to write python plugin that doesn't require an existing open image?

I am trying to re-write a GIMP 2.10 python plugin that processes a directory, scanning for image files. I’ve just started, and I am stuck implementing my plugin’s do_create_procedure method.
If I write do_create_procedure to return a Gimp.ImageProcedure, then my plugin will not “run” because there is no current image. The error message is:
GIMP-Error: Procedure 'plug-in-selectinimagefile-python' has been called with an invalid ID for argument 'image'. Most likely a plug-in is trying to work on an image that doesn't exist any longer.

If I write do_create_procedure to return a Gimp.Procedure, then my plugin will not load/register. The error message is:
attempted to install <Image> procedure "plug-in-selectinimagefile-python" which does not take the standard <Image> plug-in's arguments: (GimpRunMode).

Now I am trying trial and error with other procedure sub-classes, so far no luck. I am also guessing at trying a different menu prefix that is not “Image” but no other choices seem to correctly describe my plugin.

What might be the best way to do this?

For GIMP 2.99 you can add this line to tell that you don’t care about images:

procedure.set_sensitivity_mask(Gimp.ProcedureSensitivityMask.ALWAYS)

Thanks! That seems to have worked!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.