Post all Gimp scripts and script writing questions here
Tue Sep 20, 2022 9:27 pm
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.
Tue Sep 20, 2022 10:24 pm
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.
Wed Sep 21, 2022 3:30 am
Unfortunately I can only confirm this. Just reported
as a bug.
Powered by phpBB © phpBB Group.
phpBB Mobile / SEO by Artodia.