You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tried to call im.convert() after accessing im.is_animated on a non-animated gif file.
What did you expect to happen?
Expected the im.convert() command to execute successfully.
What actually happened?
im.convert() gave an error 'NoneType' object has no attribute 'convert'
What are your OS, Python and Pillow versions?
OS: Windows 10 (build 19041.388)
Python: 3.7.6
Pillow: 9.2.0
im=Image.open('test.gif')
im.is_animated# is_animated was accessed, the next line calling .convert() will now failim.convert() # This gives "'NoneType' object has no attribute 'convert'"
If you call im.convert() without first calling im.is_animated, it will work fine.
This seemingly doesn't happen with every gif, including probably non animated ones.
I went through every line of the is_animated method in GifImagePlugin.py and it seems that the convert() error starts happening when an exception is thrown when calling self._seek(1, False) on line 134
test.gif which was used to produce the bug:
The text was updated successfully, but these errors were encountered:
radarhere
changed the title
Calling im.convert() after accessing im.is_animated on gives an error with specific gifs.
Calling im.convert() after accessing im.is_animated on gives an error with specific gifs
Sep 22, 2022
Hi. This has actually already been fixed in main by PR #6455 (so this is effectively a duplicate of #6454). It will be part of the next Pillow release, due out in late October.
What did you do?
Tried to call im.convert() after accessing im.is_animated on a non-animated gif file.
What did you expect to happen?
Expected the im.convert() command to execute successfully.
What actually happened?
im.convert() gave an error
'NoneType' object has no attribute 'convert'
What are your OS, Python and Pillow versions?
If you call im.convert() without first calling im.is_animated, it will work fine.
This seemingly doesn't happen with every gif, including probably non animated ones.
I went through every line of the is_animated method in GifImagePlugin.py and it seems that the convert() error starts happening when an exception is thrown when calling
self._seek(1, False)
on line 134test.gif which was used to produce the bug:
![test](https://user-images.githubusercontent.com/36000241/191572654-9e514be0-57b4-4668-b013-3da65559ab92.gif)
The text was updated successfully, but these errors were encountered: