Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #31951
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'socket': 0.05; 'pil': 0.07; 'here?': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:PIL': 0.09; 'url:github': 0.09; 'clark': 0.16; 'doing:': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'roy': 0.16; 'subject:requests': 0.16; 'url:issues': 0.16; 'alex': 0.17; 'requests': 0.18; 'import': 0.21; 'idea': 0.24; 'ticket': 0.24; 'pass': 0.25; 'header:User-Agent:1': 0.26; 'object,': 0.27; "doesn't": 0.28; 'header:X-Complaints-To:1': 0.28; '>>>>': 0.29; 'image,': 0.29; "i'm": 0.29; 'file': 0.32; 'getting': 0.33; 'to:addr:python-list': 0.33; 'open': 0.35; 'something': 0.35; 'there': 0.35; 'received:org': 0.36; 'but': 0.36; 'anything': 0.36; 'data': 0.37; 'subject:: ': 0.38; 'gives': 0.39; 'to:addr:python.org': 0.39; 'takes': 0.39; 'header:Received:5': 0.40; 'end': 0.40; 'think': 0.40; 'you.': 0.61; 'here': 0.65; 'said:': 0.65; 'smith': 0.71; 'subject:get': 0.81; 'received:fios.verizon.net': 0.84 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Alex Clark <aclark@aclark.net> |
| Subject | Re: PIL and requests don't get along |
| Date | Tue, 23 Oct 2012 14:28:56 -0400 |
| Organization | ACLARK.NET, LLC |
| References | <k66mc3$ed3$1@panix2.panix.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-1; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Gmane-NNTP-Posting-Host | pool-74-96-186-16.washdc.fios.verizon.net |
| User-Agent | Unison/2.1.9 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2682.1351016950.27098.python-list@python.org> (permalink) |
| Lines | 33 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1351016950 news.xs4all.nl 6853 [2001:888:2000:d::a6]:53957 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:31951 |
Show key headers only | View raw
On 2012-10-23 18:06:59 +0000, Roy Smith said: > 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: > >>>> import requests >>>> r = requests.get(url) > > 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 > >>>> Image.open(r.raw) > > doesn't work because r.raw gives you a socket which doesn't support > seek(). I end up doing: > >>>> r = requests.get(url) >>>> data = cStringIO.StringIO(r.content) >>>> image = Image.open(data) > > which works, but it's gross. Is there something I'm missing here? No idea but you can open a ticket here if you think it's appropriate: https://github.com/python-imaging/Pillow/issues -- Alex Clark ยท https://www.gittip.com/aclark4life/
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
PIL and requests don't get along roy@panix.com (Roy Smith) - 2012-10-23 14:06 -0400
Re: PIL and requests don't get along Alex Clark <aclark@aclark.net> - 2012-10-23 14:28 -0400
Re: PIL and requests don't get along Kushal Kumaran <kushal.kumaran+python@gmail.com> - 2012-10-24 11:25 +0530
Re: PIL and requests don't get along Roy Smith <roy@panix.com> - 2012-10-24 09:35 -0400
csiph-web