1. Fredrik Lundh
  2. pil-2009-raclette
Issue #17 new

ImageField.size

Anonymous created an issue

Bug with django 1.3: {{{

!python

<Photo object>

p.image <ImageFieldFile: gallery/2011/04/image_350.jpeg> p.image.width Traceback (most recent call last): File "<console>", line 1, in <module> File "/home/services/virtual/wwwbociek/p27d13-23112011/lib/python2.7/site-packages/django/core/files/images.py", line 15, in _get_width return self._get_image_dimensions()[0] File "/home/services/virtual/wwwbociek/p27d13-23112011/lib/python2.7/site-packages/django/core/files/images.py", line 26, in _get_image_dimensions self._dimensions_cache = get_image_dimensions(self, close=close) File "/home/services/virtual/wwwbociek/p27d13-23112011/lib/python2.7/site-packages/django/core/files/images.py", line 54, in get_image_dimensions p.feed(data) File "/home/services/virtual/wwwbociek/p27d13-23112011/lib/python2.7/site-packages/PIL/ImageFile.py", line 420, in feed im = Image.open(fp) File "/home/services/virtual/wwwbociek/p27d13-23112011/lib/python2.7/site-packages/PIL/Image.py", line 1992, in open return factory(fp, filename) File "/home/services/virtual/wwwbociek/p27d13-23112011/lib/python2.7/site-packages/PIL/ImageFile.py", line 108, in init self._open() File "/home/services/virtual/wwwbociek/p27d13-23112011/lib/python2.7/site-packages/PIL/JpegImagePlugin.py", line 294, in _open i = s.unpack("!H") File "/home/services/virtual/wwwbociek/p27d13-23112011/lib/python2.7/site-packages/PIL/ImageSupport2.py", line 76, in unpack raise ValueError(v) ValueError: unpack requires a string argument of length 2 }}}

Comments (0)

  1. Log in to comment