Loading image for manipulation from URL

Hi everyone,

Today I've had some serious issues with trying to load images into my

First of all Im on Django 17 and Python 3.4, apparently this means no urllib, urllib2, StringIO, cStringIO, BytesIO.

So I have requests and BeautifulSoup to work with. And also Pillow.

There is an image here:

I'm trying to return the size:

rq = requests.get('')
image =

#soup = BeautifulSoup(rq.content, 'html.parser')
#imgs ='img') (Didn't work)

sz = image.size
return render_to_response('crophop/imgur.html',{'link':sz})

Nothing has been working. I've seen loads and loads of examples with urllib and StringIO which is what makes it so frustrating.

I've spent hours today trying to make this work. Does anyone have an idea how I can either make the code work or get StringIO onto my system?




Works using django17 and python 3.4

Not using skimage - > io as a lot of other areas suggest.

Using a much easier way than urllib / string - array conversions:

from skimage import novice

picture ="URL")
wdth = picture.width (and anything else)


Hope it helps someone else. I feel like something as simple as reading should be simple, and this novice is by far the best solution in so far as not needed a bunch of other libraries which may or may not with w/e other versions of stuff you have. I'm surprised it took me a whole day to find it, as well as there was not a single mention of it on anything stack exchange. Oh well.



Glad you worked it out :-)