Fredrik Lundh is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

effbot / pil-2009-raclette http://effbot.org/zone/pil-index.htm

Work repository for PIL 1.1.7 and beyond. The "default" branch should be fairly solid, the other branches less so. For production use, see the pil-117 repository.

Clone this repository (size: 1.6 MB): HTTPS / SSH
hg clone https://bitbucket.org/effbot/pil-2009-raclette
hg clone ssh://hg@bitbucket.org/effbot/pil-2009-raclette

Issues

#17 ImageField.size

Reported anonymously

Bug with django 1.3:

<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
Status: new Responsible: nobody Type: bug Priority: major
Milestone: raclette-final Component: pil-core Version: pil-1.1.6

Attachments

No attachments added for this issue yet.

Comments and changes

No comments added for this issue yet.

Add comment / attachment

Verification: Please write the text from the image in the box (letters only)

captcha

Is that you, Humanoid? Is this me?