Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate multiple GIF comment blocks with newlines #6294

Merged
merged 2 commits into from May 22, 2022

Conversation

raygard
Copy link
Contributor

@raygard raygard commented May 13, 2022

If more than one comment is in a GIF frame, separate them with \r\n in the info dict.

Fixes #6293 .

Changes proposed in this pull request:

  • When reading GIF file, multiple comments in a frame are separated with \r\n, rather than being concatenated.
  • Add a test to check this for the first frame of an image.
  • Add an image to the test set that contains two comment blocks before the first frame (as well as several other comment blocks.)

If more than one comment is in a GIF frame, separate them with \r\n in the info dict.
@radarhere
Copy link
Member

If I suggest \n instead of \r\n, how do you feel about that?

@raygard
Copy link
Contributor Author

raygard commented May 20, 2022

As mentioned in the corresponding issue, I found all the cases of more than one comment per GIF that I could find easily in my files. I see one where a single \n is used, but several that use \r\n to separate lines within a comment. I'm fine with any way you want to go on this issue. It's far less important to me than PR #6300, the one that fixes the comment-per-frame problem, that will (along with PR #6211) probably fix the problem @smccombie has with animated GIFs in MS Teams.

@radarhere radarhere changed the title Multiple GIF comments in a frame are separated Separate multiple GIF comment blocks in a frame with newlines May 22, 2022
@radarhere radarhere merged commit e9cb215 into python-pillow:main May 22, 2022
@radarhere radarhere changed the title Separate multiple GIF comment blocks in a frame with newlines Separate multiple GIF comment blocks with newlines May 22, 2022
@raygard raygard deleted the comments_separate_multiple branch May 24, 2022 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GIF: multiple comment blocks for a frame are run together
2 participants