Grabbing animated gif with python script

Thursday, July 10, 2014

I've been playing around with Pythonista on iOS to create some automation scripts.


I have a problem where I'm trying to grab an animated gif from a remote url. I've come up with the following script.



import Image
from urllib import urlopen
from io import BytesIO

url = "http://ift.tt/1mEiv90"
img = Image.open(BytesIO(urlopen(url).read()))


I get the image but it only appears to be the first frame of the gif? I'm guessing it has something to do with the BytesIO not reading in the whole file but I'm not sure?


Hope I'm along the right lines.







http://ift.tt/1ooh2Rx