小编swa*_*oop的帖子

Python图像库错误 - 渲染时捕获IOError:数据不足

我创建了一个使用sorl-thumbnail来调整上传图像大小的网站.大多数图像都没有任何问题调整大小,但很少有人收到以下错误:

Caught IOError while rendering: not enough data
Request Method: GET
Request URL:    http://localhost:8000/user/nash22/photographs/
Django Version: 1.3.1
Exception Type: TemplateSyntaxError
Exception Value:    
Caught IOError while rendering: not enough data
Exception Location: /usr/local/lib/python2.7/site-packages/PIL/TiffImagePlugin.py in load, line 382
Python Executable:  /usr/local/bin/python
Python Version: 2.7.1
Run Code Online (Sandbox Code Playgroud)

我在谷歌搜索但找不到任何相关的答案.有人可以帮我解决发生的事情以及如何解决这个问题?谢谢.

编辑

完成回溯

Traceback(最近一次调用最后一次):

文件"/lib/python2.7/django/core/handlers/base.py",第111行,get_response response = callback(request,*callback_args,**callback_kwargs)

文件"/home/swaroop/project/apps/photography/views.py",第702行,showPhoto context_instance = RequestContext(request))

文件"/lib/python2.7/django/shortcuts/ 初始化的.py",第20行,选择render_to_response中返回的HttpResponse(loader.render_to_string(*ARGS,**kwargs),**httpresponse_kwargs)

文件"/lib/python2.7/django/template/loader.py",第188行,在render_to_string中返回t.render(context_instance)

文件"/lib/python2.7/django/template/base.py",第123行,在渲染中返回self._render(context)

文件"/lib/python2.7/django/template/base.py",第117行,在_render中返回self.nodelist.render(context)

文件"/lib/python2.7/django/template/base.py",第744行,在render bits.append中(self.render_node(node,context))

文件"/lib/python2.7/django/template/base.py",第757行,在render_node中返回node.render(context)

文件"/lib/python2.7/django/template/loader_tags.py",第127行,在渲染中返回compiled_pa​​rent._render(context)

文件"/lib/python2.7/django/template/base.py",第117行,在_render中返回self.nodelist.render(context)

文件"/lib/python2.7/django/template/base.py",第744行,在render bits.append中(self.render_node(node,context))

文件"/lib/python2.7/django/template/base.py",第757行,在render_node中返回node.render(context)

文件"/lib/python2.7/django/template/loader_tags.py",第64行,在render result = block.nodelist.render(context)中

文件"/lib/python2.7/django/template/base.py",第744行,在render bits.append中(self.render_node(node,context))

文件"/lib/python2.7/django/template/base.py",第757行,在render_node中返回node.render(context)

文件"/lib/python2.7/sorl/thumbnail/templatetags/thumbnail.py",第45行,在渲染中返回self._render(context)

文件"/lib/python2.7/sorl/thumbnail/templatetags/thumbnail.py",第97行,在渲染文件,几何,**选项中

在get_thumbnail缩略图中输入文件"/lib/python2.7/sorl/thumbnail/base.py",第61行) …

python django sorl-thumbnail python-imaging-library

0
推荐指数
1
解决办法
1897
查看次数