尝试上传图片时出现BadImageError

时间:2013-10-09 15:11:16

标签: python google-app-engine python-imaging-library

我正在使用在Python上运行的Google App Engine服务器。我的应用程序有一些文件上传字段用于上传图像。当我处理图像时,我收到了这个错误:

ERROR    2013-10-09 14:32:06,727 main.py:29] Exception in request:
Traceback (most recent call last):
  File "/home/ajith/Dev/Space/SDK/google_appengine/lib/django-1.2/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/ajith/Dev/Space/Space/src/space/company/views.py", line 172, in companyDetails
    thumbnail = img.execute_transforms(output_encoding=images.JPEG)
  File "/home/ajith/Dev/Space/SDK/google_appengine/google/appengine/api/images/__init__.py", line 799, in execute_transforms
    return rpc.get_result()
  File "/home/ajith/Dev/Space/SDK/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 612, in get_result
    return self.__get_result_hook(self)
  File "/home/ajith/Dev/Space/SDK/google_appengine/google/appengine/api/images/__init__.py", line 886, in execute_transforms_hook
    raise _ToImagesError(e, self._blob_key)
BadImageError

这是我在尝试执行transform时遇到此错误的地方:

img = images.Image(content)
img.resize(width=100, height=100)
img.im_feeling_lucky()
thumbnail = img.execute_transforms(output_encoding=images.JPEG)
logo = db.Blob(thumbnail)

非常感谢任何回复。

0 个答案:

没有答案