Posts: 7
Threads: 3
Joined: May 2025
Reputation:
1
Gimp version:
Operating system(s): Windows 11
8 hours ago
(This post was last modified: 8 hours ago by nmw01223.)
I'm trying to debug a python plugin on gimp 3.0.6 on Windows 11. I can get all the section of code to run in the python console, but nothing turns up in the plugin itself except the specified dialog.
I cannot find out where any message output goes. Is there any way of putting the equivalent of print() statements in the code and having it turn up on a console somewhere? I'm running it from the command line as gimp-3.0.exe --verbose.
Posts: 7
Threads: 3
Joined: May 2025
Reputation:
1
Gimp version:
Operating system(s): Windows 11
5 hours ago
(This post was last modified: 4 hours ago by nmw01223.)
Gimp-3.0.exe is definitely not a shortcut, its 6.8MB!
I think it's the executable. Actually there are three of exactly the same size: gimp.exe, gimp-3.exe and gimp-3.0.exe. The one the main start menu shortcut uses is gimp-3.exe, doesn't make any difference though which is used, print() statements do not seem to turn up anywhere visible that I can see.
UPDATE:
Ah, but Gimp.message() turns up in the error console. That's a start.
I now find that what is returned from file = config.get_property("...") when it was created with procedure.add_file_argument() is not a string as I thought, it's a GFile (or something), and file.get_path() doesn't produce the path as it does in the working plugin I'm looking at. Don't know why, but it's a start.
Posts: 7
Threads: 3
Joined: May 2025
Reputation:
1
Gimp version:
Operating system(s): Windows 11
2 hours ago
(This post was last modified: 2 hours ago by nmw01223.)
The object returned from get_property() is apparently a Gio.File, which is some sort of abstraction of a file.
get_path() returns nothing useful (though Google AI help said it returned a readable path). get_uri() produced the folder in the URI form file:\\\c:\.... Since I need the folder path to build full paths to files from, all I could do was remove the scheme prefix using string replace(). I'm certain that isn't the way to do it, and it definitely isn't cross platform, but I haven't found anything better yet. Would be good if there was a method something like get_readable_name(), get_fullpath() or similar, but if there is I haven't found it yet.