It is currently Tue Jul 02, 2024 3:41 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: gimp-comment parasite in Python
PostPosted: Tue Sep 20, 2022 9:27 pm  (#1) 
Offline
New Member

Joined: Sep 18, 2022
Posts: 3
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.

_________________
Image


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: gimp-comment parasite in Python
PostPosted: Tue Sep 20, 2022 9:48 pm  (#2) 
Offline
GimpChat Member

Joined: Jul 28, 2018
Posts: 1196
See if this helps https://gimplearn.net/viewtopic.php?f=3&t=542&p=3742

_________________
https://www.deviantart.com/pocholo17
Image


Top
 Post subject: Re: gimp-comment parasite in Python
PostPosted: Tue Sep 20, 2022 10:24 pm  (#3) 
Offline
New Member

Joined: Sep 18, 2022
Posts: 3
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.

_________________
Image


Top
 Post subject: Re: gimp-comment parasite in Python
PostPosted: Wed Sep 21, 2022 3:30 am  (#4) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4752
Unfortunately I can only confirm this. Just reported as a bug.

_________________
Image


Top
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Convert GIMP plugin from Python 2 to Python 3

4

No new posts Difference between "Python-Fu" and "Python" plugin

6

No new posts Attachment(s) Help with pdb.plug_in_displace when using python-fu

4

No new posts Python 3 With GIMP 2

0

No new posts Help with pdb.plug_in_displace when using python-fu in OS X

1



* Login  



Powered by phpBB3 © phpBB Group