Switch to full style
Post all Gimp scripts and script writing questions here
Post a reply

Load As Layers Wire Initialization Error With Python

Sun Dec 31, 2023 10:18 pm

Hello People,

Calling gimp-file-load-layers results in (python2:24932): LibGimpBase-ERROR **: 09:10:03.138: gimp_wire_write_msg: the wire protocol has not been initialized.

pdb.gimp_file_load_layers(RUN-NONINTERACTIVE, TheImage, "/Path/To/the_file.xcf").

The operations before the above statement to resize the image and the canvas work fine.
The plugin will not load unless I have that line commented. With it uncommented I see the same wire protocol error.

Various searches regarding the wire protocol have not resulted in anything useful.

What causes this?
How can I open a GIMP file as layers using python script?

GIMP 2.10.20

GIMP 2.10.20 Python Console
Python 2.7.5 (default, Apr 2 2020, 13:16:51)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

Thanks

=thoth=

Re: Load As Layers Wire Initialization Error With Python

Mon Jan 01, 2024 3:49 am

I never put "RUN-NONINTERACTIVE" in my scripts.
Maybe you just leave that out?

Re: Load As Layers Wire Initialization Error With Python

Mon Jan 01, 2024 4:48 am

Thoth wrote:Hello People,

Calling gimp-file-load-layers results in (python2:24932): LibGimpBase-ERROR **: 09:10:03.138: gimp_wire_write_msg: the wire protocol has not been initialized.

pdb.gimp_file_load_layers(RUN-NONINTERACTIVE, TheImage, "/Path/To/the_file.xcf").

The operations before the above statement to resize the image and the canvas work fine.
The plugin will not load unless I have that line commented. With it uncommented I see the same wire protocol error.

Various searches regarding the wire protocol have not resulted in anything useful.

What causes this?
How can I open a GIMP file as layers using python script?

GIMP 2.10.20

GIMP 2.10.20 Python Console
Python 2.7.5 (default, Apr 2 2020, 13:16:51)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

Thanks

=thoth=


In Python the "run mode" parameter is actually an optional named parameter:

Code:
pdb.gimp_file_save(exportImage,exportLayer,filePath,filePath,run_mode=RUN_INTERACTIVE)


And since it defaults to RUN_NONINTERACTIVE it can be left out in most cases.

Re: Load As Layers Wire Initialization Error With Python

Sat Jan 13, 2024 12:19 pm

nelo wrote:I never put "RUN-NONINTERACTIVE" in my scripts.
Maybe you just leave that out?


Hallo Nelo,

Leaving it out results in the wire initialization error as well.

Code:
pdb.gimp_file_load_layers(TheImage, "/Graphix/Templates/2023_isdi_xga2_04.xcf")


=thoth=

Re: Load As Layers Wire Initialization Error With Python

Sat Jan 13, 2024 12:23 pm

ofnuts wrote:In Python the "run mode" parameter is actually an optional named parameter:

Code:
pdb.gimp_file_save(exportImage,exportLayer,filePath,filePath,run_mode=RUN_INTERACTIVE)


And since it defaults to RUN_NONINTERACTIVE it can be left out in most cases.


Hi efnuts,

This also resulted in the Wire Initialization error.

Code:
pdb.gimp_file_load_layers(TheImage, "/Graphix/Templates/2023_isdi_xga2_04.xcf", run_mode=RUN_INTERACTIVE)



=thoth=

Re: Load As Layers Wire Initialization Error With Python

Sat Jan 13, 2024 12:24 pm

Hi All,

I am going to try to reach out to the GIMP maintainers.
If I find a solution, I will post it here.


=thoth=

Re: Load As Layers Wire Initialization Error With Python

Sat Jan 13, 2024 7:35 pm

Thoth wrote:Hi All,

I am going to try to reach out to the GIMP maintainers.
If I find a solution, I will post it here.


=thoth=

Can you show the full code? It looks like your plugin doesn't register properly.
Post a reply