How do I get the running gimp3 version from plugin?

I have a working plugin, and tried this code to get the running gimp version from the plugin. I’m getting None as result.

Gimp.version()

The plugin is declared as

class StableDiffussion(Gimp.PlugIn):
.
.
Gimp.main(StableDiffussion.__gtype__, sys.argv)

What am I doing wrong?

We have a tutorial: GIMP Developer - How to write a plug-in

1 Like

The tutorial is excellent, I followed it and the plugin is here. I would like to get the Gimp version to track down bugs and be able to understand if maybe it’s an incompatibility with Gimp.

Any hint to get the specific version? Gimp.version() returns None in my case.

Could you share the plugin code?

What version and platform are you using? That should work and it’s even used in the Python console itself to show the version number:

GIMP 3.0.4 Python Console
Python 3.12.10 (main, Apr 18 2025, 06:12:22)  [GCC UCRT Clang 20.1.3 64 bit (AMD64)]
>>> Gimp.version()
'3.0.4'
>>> 
1 Like

I found the problem thanks to @jboerema and @brunvonlope feedback, the problem was that I was making the call in the __init__ method, I moved the invocation to the run method of my Gimp.PlugIn subclass and the call was successful.

As a side note, I had similar problems with the translation. I was making the invocation of the gettext utilities too soon in the __init__ or the do_query_procedures and the translation was not being applied. Translation process works well with do_create_procedure and run.

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