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
Delay with Animated GIFs not being applied? #153
Comments
I'm having the same issue on Ubuntu with ImageMagick 6.8.7-5 Q16 x86_64 2013-11-07. After setting a delay on all the |
@lhl after looking at the tests, I figured out how to set the frame delay correctly
the |
I think this code would also work: for frame in gif.sequence:
with frame:
frame.delay = 2 |
Hello, I'll add more test info for this issue. See this. >>> from wand.color import Color
>>> from wand.image import Image
>>> red = Color('red')
>>> blue = Color('blue')
>>> green = Color('green')
>>> ri = Image(width=100, height=100, background=red, format='GIF')
>>> bi = Image(width=100, height=100, background=blue, format='GIF')
>>> gi = Image(width=100, height=100, background=green, format='GIF')
>>> ri
<wand.image.Image: d02a8da '' (100x100)>
>>> bi
<wand.image.Image: 201aaeb '' (100x100)>
>>> gi
<wand.image.Image: 18ecdf4 '' (100x100)>
>>> rig = ri.convert('gif')
>>> rig
<wand.image.Image: d02a8da 'GIF' (100x100)>
>>> big = bi.convert('gif')
>>> gig = gi.convert('gif')
>>> container = Image(width=100, height=100)
>>> container.sequence
<wand.sequence.Sequence object at 0x10743be10>
>>> container.sequence.clear()
>>> container.sequence
<wand.sequence.Sequence object at 0x10743be10>
>>> container.sequence.append(rig)
>>> container.sequence[-1].delay = 1000
>>> container.sequence.append(big)
>>> container.sequence[-1].delay = 2000
>>> container.sequence.append(gig)
>>> container.sequence[-1].delay = 3000
>>> container.animation
True
>>> container.save('test.gif')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/item4/.virtualenvs/ugoira/lib/python3.5/site-packages/wand/image.py", line 2693, in save
'.save(filename={0!r})?'.format(file))
TypeError: file must be a writable file object, but 'test.gif' is a string; did you want .save(filename='test.gif')?
>>> container.save(filename='test.gif')
>>>
>>> for frame in container.sequence:
... print(frame.delay)
...
1000
2000
3000
>>> reopen = Image(filename='test.gif')
>>> for frame in reopen.sequence:
... print(frame.delay)
...
0
0
0
>>> container.sequence.clear()
Exception ignored in: <bound method Resource.__del__ of <wand.sequence.SingleImage: 18ecdf4 (100x100)>>
Traceback (most recent call last):
File "/Users/item4/.virtualenvs/ugoira/lib/python3.5/site-packages/wand/resource.py", line 232, in __del__
self.destroy()
File "/Users/item4/.virtualenvs/ugoira/lib/python3.5/site-packages/wand/sequence.py", line 334, in destroy
with container.sequence.index_context(self.index):
>>> ontainer = Image(width=100, height=100)
>>> container.sequence.clear()
>>> container.sequence.append(rig)
>>> with container.sequence[-1]:
... container.sequence[-1].delay = 1000
...
>>> container.sequence.append(big)
>>> with container.sequence[-1]:
... container.sequence[-1].delay = 2000
...
>>> container.sequence.append(gig)
>>> with container.sequence[-1]:
... container.sequence[-1].delay = 3000
...
>>> for frame in container.sequence:
... print(frame.delay)
...
1000
2000
3000
>>> container.save(filename='test2.gif')
>>>
>>> reopen = Image(filename='test2.gif')
>>> for frame in reopen.sequence:
... print(frame.delay)
...
1000
2000
3000 |
Hi, I'm getting this problem with v0.3.9 on Ubuntu Xenial. Is it fixed in later versions? |
It appears wand installed via pip (v0.4.4) also has this bug. Any ETA on a fix? Cheers |
I'm using v0.3.0 on OS X w/ (ImageMagick 6.8.6-0 2013-07-09 Q16 via MacPorts).
I am setting the delay property on the SingleImage's in the sequence (checking to make sure it is assigned), but when I save the file, it turns out that it doesn't include a delay at all? (verified w/ "identify -verbose out.gif | grep Delay")
Is there something simple I'm missing or something more I should test with or is this a bug?
The text was updated successfully, but these errors were encountered: