[Gimp-developer] Gimp 2.99 python3 plug-ins: writing a plugin to generate an image

Gottfried Müller <[email protected]>
Newsgroups gmane.comp.video.gimp.devel
Message-ID <[email protected]>
Hello

is it possible writing a plug-in to generate an image without an opened
image? I found no examples. As a test I tried to open a file image only.
I've got the following message:

GIMP-Error: Procedure 'python-fu-openImageFile' 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.

Here a code snippet:

def openImageFile(procedure, args, data):
     print("start openImageFile")
     return procedure.new_return_values(Gimp.PDBStatusType.SUCCESS,
GLib.Error())


class OpenImageFile(Gimp.PlugIn):

     def do_query_procedures(self):
         return ["python-fu-openImageFile"]

     def do_create_procedure(self, name):
         data = None
         procedure = Gimp.ImageProcedure.new(
             self, name, Gimp.PDBProcType.PLUGIN, openImageFile, data
         )
         procedure.set_documentation(DESCR_SHORT, DESCR_LONG, name)
         procedure.set_attribution(AUTHOR, COPYRIGHT, DATE)
         procedure.set_menu_label(MENU_LABEL)
         procedure.add_menu_path(MENU_PATH)
         return procedure

Gimp.main(OpenImageFile.__gtype__, sys.argv)

I tried also an scheme script using gimp-file-load. It is using a GFile
argument now. In 2.10 I could use a filename. How to create a GFile in
scheme in 2.99?


Gottfried

_______________________________________________
gimp-developer-list mailing list
List address:    [email protected]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.