04-06-2017, 07:06 AM
You have to use a "persistent" parasite by setting the parasite flag to 1. This works for me:
I assume "gimp-comment" is a special parasite which is used to set the image comments in formats that support comments, which is why you see it saved for Jpeg and PNG (IMHO this is a bug if the parasite wasn't persistent).
Code:
➤> image=gimp.image_list()[0]
➤> p=gimp.Parasite("test-parasite",1,"Parasite data")
➤> image.parasite_attach(p)
# Save and close image
# Reopen image
➤> image=gimp.image_list()[0]
➤> image.parasite_list()
('test-parasite',)
➤> image.parasite_find("test-parasite").data
'Parasite data'
I assume "gimp-comment" is a special parasite which is used to set the image comments in formats that support comments, which is why you see it saved for Jpeg and PNG (IMHO this is a bug if the parasite wasn't persistent).