id
stringlengths
16
145
text
stringlengths
1
179k
title
stringclasses
1 value
Python_StringIO/2205_133_0.txt
Milestone
Python_StringIO/2205_107_0.txt
from io import BytesIO from PIL import Image
Python_StringIO/1006_305_0.txt
[ ![@MarynaLongnickel](https://avatars.githubusercontent.com/u/37321032?s=80&u=1f2c06ab7e23f4cae8fcf48c3de1be8ff0649b27&v=4) ](/MarynaLongnickel)
Python_StringIO/2205_16_0.txt
* Open Source
Python_StringIO/Python_StringIO_3_8.txt
ng argument combinations: * ` seek(0, SEEK_SET) ` : Rewind to the start of the stream. * ` seek(cookie, SEEK_SET) ` : Restore a previous position; _cookie_ **must be** a number returned by ` tell() ` . * ` seek(0, SEEK_END) ` : Fast-forward to the end of the stream. * ` seek(0, SEEK_CUR) ` : Le...
Python_StringIO/25046pilhowreturnstr_5_0.txt
[ home ](/) > [ topics ](/browse/) > [ python ](https://bytes.com/topic/python/) > [ questions ](https://bytes.com/topic/python/answers/) > pil: how to return a stringio of an image
Python_StringIO/775_112_0.txt
deleted-user-39880 | 669 posts | July 25, 2013, 4:29 p.m. | [ permalink ](https://www.pythonanywhere.com/forums/topic/775/#id_post_5631)
Python_StringIO/775_47_0.txt
from flask import Flask, request, json, Response, send_file from functools import wraps import requests import urllib from PIL import Image import ImageDraw, ImageFont import StringIO from os import listdir from os.path import isfile, join import random import sys, string, xmlrpclib, re
Python_StringIO/2205_66_0.txt
### What did you expect to happen?
Python_StringIO/1006_282_0.txt
^also worked
Python_StringIO/1006_188_0.txt
Author
Python_StringIO/775_113_0.txt
That must be it!
Python_StringIO/775_41_0.txt
![Staff](/static/anywhere/images/staff.png) harry | 2710 posts | PythonAnywhere staff | July 22, 2013, 5:01 p.m. | [ permalink ](https://www.pythonanywhere.com/forums/topic/775/#id_post_5520)
Python_StringIO/1006_17_0.txt
* [ GitHub Sponsors Fund open source developers ](https://github.com/sponsors)
Python_StringIO/775_25_0.txt
print "proc "+ attachment['fileName'] src_width, src_height = img.size src_ratio = float(src_width) / float(src_height) dst_width = 170 dst_height = 220 dst_ratio = float(dst_width) / float(dst_height)
Python_StringIO/25046pilhowreturnstr_61_0.txt
### Similar topics
Python_StringIO/1006_230_0.txt
alot of work to install 1 module that CAN work just as well in a portable/local enviroment. granted I could just install the egg, but I'm trying to avoid unneeded copying to make my program smaller.
Python_StringIO/2205_87_0.txt
* 👍 24 reactions * 🎉 1 reaction * 🚀 1 reaction
Python_StringIO/1006_226_0.txt
###
Python_StringIO/25046pilhowreturnstr_133_0.txt
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
Python_StringIO/1006_10_0.txt
For
Python_StringIO/1006_118_0.txt
Copy link
Python_StringIO/1006_259_0.txt
---
Python_StringIO/1006_262_0.txt
[ ![@wiredfool](https://avatars.githubusercontent.com/u/19792?s=80&v=4) ](/wiredfool)
Python_StringIO/775_23_0.txt
for attachment in attachments: print "load "+ attachment['fileName'] data = server.confluence1.getAttachmentData(token, page['id'], attachment['fileName'], '0') file = StringIO.StringIO(data) img = Image.open(file)
Python_StringIO/1006_299_0.txt
Obviously, this response can not be identified as an image by Pillow. My solution is passing an object (like ` {"from": "spider"} ` ) from spider to the middleware, and in the process_request method of middleware:
Python_StringIO/1006_308_0.txt
**[ MarynaLongnickel ](/MarynaLongnickel) ** commented Nov 3, 2018
Python_StringIO/775_42_0.txt
I'm puzzled. An hour ago I got a different error message than I get now:
Python_StringIO/1006_100_0.txt
f = open('test.png','wb'); f.write( string(0) ); f.close()
Python_StringIO/1006_60_0.txt
Copy link
Python_StringIO/1006_61_0.txt
###
Python_StringIO/1006_303_0.txt
All reactions
Python_StringIO/775_52_0.txt
It seems to work flawlessly: http://npohle.pythonanywhere.com/test
Python_StringIO/25046pilhowreturnstr_101_0.txt
I'm doing some image processing in PIL, and I want to display the results in a GTK window using PyCairo, so I create a Cairo image surface from the PIL Image like this: mfile =...
Python_StringIO/25046pilhowreturnstr_105_0.txt
by: [ bharathv6 ](https://bytes.com/profile/172149/bharathv6/) | last post by:
Python_StringIO/25046pilhowreturnstr_57_0.txt
Regards, Bengt Richter
Python_StringIO/1006_297_0.txt
I got this problem when using selenium together with ImagePipeline, because every request (includes downloading the images) will get through the middleware which is using the selenium in it's process_request() method , so when trying to download an image, the selenium will open the browser with an url like ' [ http://s...
Python_StringIO/1006_217_0.txt
First of all, unsupported configuration doesn't begin to describe what you're doing with imports.
Python_StringIO/2205_135_0.txt
Development
Python_StringIO/1006_43_0.txt
* [ Code ](/python-pillow/Pillow) * [ Issues 75 ](/python-pillow/Pillow/issues) * [ Pull requests 40 ](/python-pillow/Pillow/pulls) * [ Discussions ](/python-pillow/Pillow/discussions) * [ Actions ](/python-pillow/Pillow/actions) * [ Projects 1 ](/python-pillow/Pillow/projects) * [ Wiki ](/python-pillow/Pillo...
Python_StringIO/25046pilhowreturnstr_129_0.txt
[ 0 ](https://bytes.com/topic/general/answers/979224-discussion-how-does- zigbee-compare-other-wireless-protocols-smart-home-applications)
Python_StringIO/25046pilhowreturnstr_152_0.txt
[ 0 ](https://bytes.com/topic/visual-basic-net/answers/979245-windows-forms- net-8-0-a) [ ](https://bytes.com/)
Python_StringIO/2205_57_0.txt
[ boskicthebrain ](/boskicthebrain) opened this issue Nov 7, 2016 · 4 comments
Python_StringIO/775_86_0.txt
Apologies for making you jump through hoops like this, but it's really puzzling that we appear to be in different environments and so we need to try and get to the bottom of how they differ before we can be confident that we can fix the problem.
Python_StringIO/775_87_0.txt
deleted-user-39880 | 669 posts | July 24, 2013, 10:38 a.m. | [ permalink ](https://www.pythonanywhere.com/forums/topic/775/#id_post_5560)
Python_StringIO/2205_70_0.txt
### What versions of Pillow and Python are you using?
Python_StringIO/25046pilhowreturnstr_137_0.txt
[ AI Job Threat for Devs ](https://bytes.com/topic/career/insights/979226-ai- job-threat-devs)
Python_StringIO/1006_189_0.txt
###
Python_StringIO/25046pilhowreturnstr_106_0.txt
i need to do is modify the image in memory like resizing the image in memory etc ... with out saving it disk as i have to return back the image with out saving it disk PIL supports the use of...
Python_StringIO/1006_348_0.txt
[ ](https://github.com "GitHub") © 2024 GitHub, Inc.
Python_StringIO/25046pilhowreturnstr_114_0.txt
[ How to build RAID in BIOS? ](https://bytes.com/topic/computer- hardware/insights/979211-how-build-raid-bios)
Python_StringIO/775_61_0.txt
deleted-user-64250 | 10 posts | July 22, 2013, 9:12 p.m. | [ permalink ](https://www.pythonanywhere.com/forums/topic/775/#id_post_5528)
Python_StringIO/775_80_0.txt
/usr/local/lib/python2.7/dist-packages/PIL/_imaging.so /usr/lib/x86_64-linux-gnu/libjpeg.so
Python_StringIO/775_117_0.txt
Ask us a question, or tell us what you love or hate about PythonAnywhere. We'll get back to you over email ASAP.
Python_StringIO/775_17_0.txt
server = xmlrpclib.ServerProxy('https://xxxxx.example.com/rpc/xmlrpc') token = server.confluence1.login('xxxxx', 'xxxxxxxxxxx') page = server.confluence2.getPage(token, 'xxxxxx', 'Team Pics') attachments = server.confluence1.getAttachments(token, page['id']) attachment = random.choice (attachments) data = server.conflu...
Python_StringIO/2205_122_0.txt
Sorry, something went wrong.
Python_StringIO/1006_288_0.txt
blah blah, I don't want to rant about how my program works... it's not on topic I just hope I've said enough to clear up any questions here.
Python_StringIO/1006_234_0.txt
All reactions
Python_StringIO/775_14_0.txt
Here's the Flask code:
Python_StringIO/1006_319_0.txt
Sorry, something went wrong.
Python_StringIO/25046pilhowreturnstr_98_0.txt
[ 0 ](https://bytes.com/topic/python/answers/754305-pycairo-pil-stringio) [ ](https://bytes.com/)
Python_StringIO/25046pilhowreturnstr_55_0.txt
>> > You are recommending shadowing 'file' ?! > > > > Why not? Python is a block-structured language. New builtins can > arrive in any release.
Python_StringIO/1006_143_0.txt
File "Z:\home\tcll\sync\copy\UMC_v3.0a\data\Python\PIL\Image.py", line 2288, in open % (filename if filename else fp))
Python_StringIO/1006_269_0.txt
---
Python_StringIO/1006_267_0.txt
Is the full path of the egg in sys.path? Not just the directory it's in?
Python_StringIO/2205_23_0.txt
# Search code, repositories, users, issues, pull requests...
Python_StringIO/2205_85_0.txt
👍 24 boskicthebrain, EastonLee, vkverma01, Nishant-Gaurav, AndersTornkvist, approxit, Lauriy, lysukhin, snowman, khuesmann, and 14 more reacted with thumbs up emoji 🎉 1 Arun-N reacted with hooray emoji 🚀 1 allexiusw reacted with rocket emoji
Python_StringIO/1006_276_0.txt
**[ Tcll ](/Tcll) ** commented Nov 13, 2014
Python_StringIO/775_88_0.txt
This is definitely weird. Everyone should have the same environment -- in fact, there's nothing in the system that could allow different consoles to differ, unless there are virtualenvs or some other way of having different Python modules installed.
Python_StringIO/1006_290_0.txt
All reactions
Python_StringIO/2205_53_0.txt
Closed
Python_StringIO/775_34_0.txt
import urllib from PIL import Image import StringIO
Python_StringIO/775_71_0.txt
As you can see, there's no output so presumably the code is working correctly.
Python_StringIO/775_105_0.txt
Hm, I doubt ` LD_LIBRARY_PATH ` would be set system-wide - I was mentioning it in case you'd set it yourself for some reason.
Python_StringIO/1006_325_0.txt
edited by radarhere
Python_StringIO/1006_324_0.txt
**[ Tcll ](/Tcll) ** commented Nov 16, 2018 •
Python_StringIO/1006_54_0.txt
[ Tcll ](/Tcll) opened this issue Nov 12, 2014 · 16 comments
Python_StringIO/1006_338_0.txt
None yet
Python_StringIO/1006_85_0.txt
I tried the image prior to your response, and it worked.
Python_StringIO/1006_156_0.txt
[ ![@wiredfool](https://avatars.githubusercontent.com/u/19792?s=80&v=4) ](/wiredfool)
Python_StringIO/1006_346_0.txt
[ ![@wiredfool](https://avatars.githubusercontent.com/u/19792?s=52&v=4) ](/wiredfool) [ ![@Tcll](https://avatars.githubusercontent.com/u/773959?s=52&v=4) ](/Tcll) [ ![@hugovk](https://avatars.githubusercontent.com/u/1324225?s=52&v=4) ](/hugovk) [ ![@beyondlex](https://avatars.githubusercontent.com/u/7869143?s=52&v=4) ]...
Python_StringIO/25046pilhowreturnstr_20_0.txt
"Christoph" wrote:
Python_StringIO/25046pilhowreturnstr_120_0.txt
[ What is ONU? ](https://bytes.com/topic/general/insights/979213-what-onu)
Python_StringIO/2205_103_0.txt
###
Python_StringIO/1006_21_0.txt
* [ Pricing ](https://github.com/pricing)
Python_StringIO/1006_199_0.txt
^ this got it working as it registers in pillow.py's local instance
Python_StringIO/1006_96_0.txt
###
Python_StringIO/1006_251_0.txt
###
Python_StringIO/1006_165_0.txt
Sorry, something went wrong.
Python_StringIO/1006_320_0.txt
[ ![@Tcll](https://avatars.githubusercontent.com/u/773959?s=80&u=96a793e9582ba5f3f67877b81c28eb43e5c3cec7&v=4) ](/Tcll)
Python_StringIO/1006_171_0.txt
I can't exactly import directly from PIL though... it can't find the module when I try from IMG.py or the library (by 'library' I mean what I talked about a few issues back which would be used by IMG.py and other scripts)
Python_StringIO/1006_72_0.txt
return __f[__c].tostring() # __f[__c] = array( 'B', [] )
Python_StringIO/1006_134_0.txt
^ passed, I got a duplicate of the last imported PNG this rules out possible issue 2, as expected and explained in the first test export...
Python_StringIO/1006_309_0.txt
Hello, Tcll. I'm getting the same error :< ... Any chance you could help me out?
Python_StringIO/775_72_0.txt
I don't think that the PA system will be doing any magic which is likely to affect this, and it shouldn't be running anything in a virtualenv unless you've deliberately set it up that way.
Python_StringIO/25046pilhowreturnstr_3_0.txt
[ Post Job ](https://buy.stripe.com/8wM15xboY2mcgjS289)
Python_StringIO/1006_340_0.txt
None yet
Python_StringIO/25046pilhowreturnstr_73_0.txt
[ 0 ](https://bytes.com/topic/python/answers/38983-pil-zope-resizing-images) [ ](https://bytes.com/)
Python_StringIO/1006_62_0.txt
**[ Tcll ](/Tcll) ** commented Nov 12, 2014
Python_StringIO/775_2_0.txt
Toggle navigation [ ![](/static/anywhere/images/PA-logo.svg) ](/)