R
Roy Smith
I have a url from which I can get an image. I want to use PIL to
manipulate that image. Getting the image is easy:
There's a bunch of factory functions for Image, but none of them seem
to take anything that requests is willing to give you. Image.new()
requires that you pass it the image size. Image.open() takes a file
object, but
doesn't work because r.raw gives you a socket which doesn't support
seek(). I end up doing:
which works, but it's gross. Is there something I'm missing here?
manipulate that image. Getting the image is easy:
There's a bunch of factory functions for Image, but none of them seem
to take anything that requests is willing to give you. Image.new()
requires that you pass it the image size. Image.open() takes a file
object, but
doesn't work because r.raw gives you a socket which doesn't support
seek(). I end up doing:
which works, but it's gross. Is there something I'm missing here?