-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
No documented way to programmatically request single iteration of gif animation #7328
Comments
There isn't one. The code just checks whether or not Pillow/src/PIL/GifImagePlugin.py Lines 940 to 950 in c98a799
|
Ok, thanks for the info and clarifying there is no way to do this. Would it be reasonable to request a way to be able to do this? For example using |
I think |
Yes, if I pass |
I've created PR #7329 to resolve this. |
What did you do?
Generate a .gif file using
loop=1
.What did you expect to happen?
I expected this to cause the .gif animation to play through once and then not repeat.
What actually happened?
On some gif viewers the gif played once, on others it played twice.
What are your OS, Python and Pillow versions?
Discussion
See this issue which spells out the problem in more detail: #4575
I was able to resolve my issue by omitting the
loop
argument from my gifsave
call altogether. In this case 1 iteration of the animation was reliably played on all gif players I tried. But how can I access the omitted argument behavior while still including the argument? Suppose I have code like:What argument can a user of this function pass in for
loop
to get the same behavior as if noloop
argument was supplied tosave
? 0 doesn't work, 1 doesn't work,None
doesn't work. I don't know of any argument that works and as far as I can tell there is no such argument in the documentation.The text was updated successfully, but these errors were encountered: