GIMP Chat
http://gimpchat.com/

gimp-comment parasite in Python
http://gimpchat.com/viewtopic.php?f=9&t=20127
Page 1 of 1

Author:  NotThatDave [ Tue Sep 20, 2022 9:27 pm ]
Post subject:  gimp-comment parasite in Python

I'm writing a Python plugin to help my workflow in creating animated gifs. Basically, it merges the layer groups into single layer frames and incorporates background layers into those layers. I've read that I can add a comment to the give by creating a 'gimp-comment' parasite. What is missing is actually where to attach the parasite. I first tried adding it to the new image I created and it didn't work. I tried adding it globally and it didn't work either.

After running the plug in, I open the new gif file and look at the image properties and go to the comment tab and it is always blank.

Does anyone have a pointer to some code that works for sure on GIMP 2.10.14?

Also, FYI, I do know that pdb.file_gif_save2 takes a URI, which means the filename must start with "file://" in order for exporting to gif. I am able to export just fine, but I would really like to have a comment in the gif that says "Created by XYZ plugin..." or some such.

Author:  Pocholo [ Tue Sep 20, 2022 9:48 pm ]
Post subject:  Re: gimp-comment parasite in Python

See if this helps https://gimplearn.net/viewtopic.php?f=3&t=542&p=3742

Author:  NotThatDave [ Tue Sep 20, 2022 10:24 pm ]
Post subject:  Re: gimp-comment parasite in Python

Yeah, that's pretty much the only thing I found online about this subject and it doesn't work.

I am curious why that poster uses gimp.parasite_attach() instead of pdb.gimp_parasite_attach(). I did try both methods for global and image parasites, and none of the four ways worked.

So, looking further, it seems the call to pdb.file_gif_save2() is the bit not honoring the comment. When I do everything except export to gif, then manually export to gif via the GUI, the comment I added programmatically is added to the gif file.

I wonder if it has to do with the call to gimp.displays_flush(). I'll try adding that, even though I am not displaying the exported gif.

SPOILER ALERT: Just tested and unfortunately flushing does NOT change the outcome.

Author:  ofnuts [ Wed Sep 21, 2022 3:30 am ]
Post subject:  Re: gimp-comment parasite in Python

Unfortunately I can only confirm this. Just reported as a bug.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/