In the GIF file, the comment is before the pixel data. The existing code in 1.3.46 reads comment and assigns it to the last frame. But it needs to store comment and assign it to the next frame.
this block is on the bottom. But this must go up to where the image is read.
The key thing is that we have a GIF with 8 frames. Each frame has a comment.
So we have 8 comments and 8 images and I think we need to read each image comment.
since not each image has a comment, you also need to set comments to NULL.
Please compare to my code, which definitively can read 8 comments for 8 GIF frames.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
To fix this, I made comments a variable before the loop:
then when reading the comment, we just store it:
later when we read the GIF frame, we add the comment:
and on the end, we need to free comments, if it is still there
Attached my copy of the gif.c file with the fix. You may just compare to yours and move over the fix, if you think this is a good fix. Thanks.
This issue should be addressed by Mercurial changeset 17869:67f0e477d45e. Thanks for reporting this issue and providing an example.
Thank you. That was quick!
Please verify that you are pleased with the result.
Looks like you didn't fix it for multi frame images. Or did I misunderstand the code?
this block is on the bottom. But this must go up to where the image is read.
The key thing is that we have a GIF with 8 frames. Each frame has a comment.
So we have 8 comments and 8 images and I think we need to read each image comment.
since not each image has a comment, you also need to set comments to NULL.
Please compare to my code, which definitively can read 8 comments for 8 GIF frames.