Note that there are some explanatory texts on larger screens.

plurals
  1. POTrouble using PIL with Google Appengine SDK
    primarykey
    data
    text
    <p>I have a Windows Server 2008 R2 (64bits) machine on which I wanted to develop a google AppEngine app.</p> <p>So I installed Python 2.5.4 from python.org (because the Google SDK said I needed 2.5 and 2.5.6 didn't have any MSI's) Then I installed PIL from <a href="http://www.pythonware.com/products/pil/" rel="nofollow noreferrer">http://www.pythonware.com/products/pil/</a> I used version 1.1.7 for python 2.5 I used the 32-bits versions of both of these.</p> <p>Then I installed the AppEngine SDK.</p> <p>Hello-World worked fine, but I wanted to manipulate an image, which didn't work because I get this stacktrace and a HTTP 500 response:</p> <pre><code>2010-02-18 11:50:27 Running command: "['C:\\Python25\\pythonw.exe', 'C:\\Program Files (x86)\\Google\\google_appengine\\dev_appserver.py', '--admin_console_server=', '--port=8080', 'd:\\imgsvc']" WARNING 2010-02-18 10:50:29,260 datastore_file_stub.py:623] Could not read datastore data from c:\users\admini~1\appdata\local\temp\dev_appserver.datastore INFO 2010-02-18 10:50:29,627 dev_appserver_main.py:399] Running application imgsvc on port 8080: http://localhost:8080 ERROR 2010-02-18 10:50:40,058 dev_appserver.py:3217] Exception encountered handling request Traceback (most recent call last): File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3180, in _HandleRequest self._Dispatch(dispatcher, self.rfile, outfile, env_dict) File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3123, in _Dispatch base_env_dict=env_dict) File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 515, in Dispatch base_env_dict=base_env_dict) File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2382, in Dispatch self._module_dict) File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2292, in ExecuteCGI reset_modules = exec_script(handler_path, cgi_path, hook) File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2188, in ExecuteOrImportScript exec module_code in script_module.__dict__ File "d:\imgsvc\imgsvc.py", line 7, in &lt;module&gt; outputimage = images.resize(inputimage.content, 32, 32) File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\images\__init__.py", line 625, in resize return image.execute_transforms(output_encoding=output_encoding) File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\images\__init__.py", line 513, in execute_transforms response) File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\apiproxy_stub_map.py", line 78, in MakeSyncCall return apiproxy.MakeSyncCall(service, call, request, response) File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\apiproxy_stub_map.py", line 278, in MakeSyncCall rpc.CheckSuccess() File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\apiproxy_rpc.py", line 149, in _WaitImpl self.request, self.response) File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\apiproxy_stub.py", line 80, in MakeSyncCall method(request, response) File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\images\images_stub.py", line 171, in _Dynamic_Transform response_value = self._EncodeImage(new_image, request.output()) File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\images\images_stub.py", line 193, in _EncodeImage image.save(image_string, image_encoding) File "C:\Python25\lib\site-packages\PIL\Image.py", line 1439, in save save_handler(self, fp, filename) File "C:\Python25\lib\site-packages\PIL\PngImagePlugin.py", line 564, in _save import ICCProfile SystemError: Parent module 'PIL' not loaded INFO 2010-02-18 10:50:40,081 dev_appserver.py:3246] "GET / HTTP/1.1" 500 - </code></pre> <p>The python script I was trying to run:</p> <pre><code>from google.appengine.api import urlfetch from google.appengine.api import images url = "http://www.brokenwire.net/bw/images/113.png" inputimage = urlfetch.fetch(url) if inputimage.status_code == 200: outputimage = images.resize(inputimage.content, 32, 32) self.response.headers['Content-Type'] = "image/png" self.response.out.write(outputimage) </code></pre> <p>Anybody any idea what is going wrong here?</p> <p>I also tried this standalone python script, which works fine:</p> <pre><code>import Image im = Image.open('filename.png') im2 = im.resize((100,100), Image.ANTIALIAS) im2.show() </code></pre> <p>It seems that it makes a difference which image I use:</p> <pre><code>url = "http://www.r-stone.net/blogs/ishikawa/uploaded_images/google_appengine-779483.png" </code></pre> <p>Gives the stacktrace of the question, but</p> <pre><code>url = "http://www.brokenwire.net/bw/images/113.png" </code></pre> <p>works without a problem.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload