{"action":"created","issue":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/518","labels_url":"https://api.github.com/repos/python-pillow/Pillow/issues/518/labels{/name}","comments_url":"https://api.github.com/repos/python-pillow/Pillow/issues/518/comments","events_url":"https://api.github.com/repos/python-pillow/Pillow/issues/518/events","html_url":"https://github.com/python-pillow/Pillow/issues/518","id":26956916,"number":518,"title":"Problem with EXIF in some files","user":{"login":"mpyatishev","id":3088773,"avatar_url":"https://avatars.githubusercontent.com/u/3088773?v=3","gravatar_id":"","url":"https://api.github.com/users/mpyatishev","html_url":"https://github.com/mpyatishev","followers_url":"https://api.github.com/users/mpyatishev/followers","following_url":"https://api.github.com/users/mpyatishev/following{/other_user}","gists_url":"https://api.github.com/users/mpyatishev/gists{/gist_id}","starred_url":"https://api.github.com/users/mpyatishev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpyatishev/subscriptions","organizations_url":"https://api.github.com/users/mpyatishev/orgs","repos_url":"https://api.github.com/users/mpyatishev/repos","events_url":"https://api.github.com/users/mpyatishev/events{/privacy}","received_events_url":"https://api.github.com/users/mpyatishev/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/python-pillow/Pillow/labels/Bug","name":"Bug","color":"fc2929"},{"url":"https://api.github.com/repos/python-pillow/Pillow/labels/Tiff","name":"Tiff","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/python-pillow/Pillow/milestones/4","html_url":"https://github.com/python-pillow/Pillow/milestones/Future","labels_url":"https://api.github.com/repos/python-pillow/Pillow/milestones/4/labels","id":438495,"number":4,"title":"Future","description":"","creator":{"login":"aclark4life","id":72164,"avatar_url":"https://avatars.githubusercontent.com/u/72164?v=3","gravatar_id":"","url":"https://api.github.com/users/aclark4life","html_url":"https://github.com/aclark4life","followers_url":"https://api.github.com/users/aclark4life/followers","following_url":"https://api.github.com/users/aclark4life/following{/other_user}","gists_url":"https://api.github.com/users/aclark4life/gists{/gist_id}","starred_url":"https://api.github.com/users/aclark4life/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aclark4life/subscriptions","organizations_url":"https://api.github.com/users/aclark4life/orgs","repos_url":"https://api.github.com/users/aclark4life/repos","events_url":"https://api.github.com/users/aclark4life/events{/privacy}","received_events_url":"https://api.github.com/users/aclark4life/received_events","type":"User","site_admin":false},"open_issues":32,"closed_issues":51,"state":"open","created_at":"2013-09-27T11:40:09Z","updated_at":"2016-01-04T01:38:54Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2014-02-05T12:48:47Z","updated_at":"2016-01-22T03:04:00Z","closed_at":null,"body":"I've got a strange problem with some files with EXIF in them. Here is a traceback and the file in attachment.\r\n```\r\nInternal Server Error: /place/content/upload/\r\nTraceback (most recent call last):\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/django/core/handlers/base.py\", line 114, in get_response\r\n    response = wrapped_callback(request, *callback_args, **callback_kwargs)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/django/views/generic/base.py\", line 69, in view\r\n    return self.dispatch(request, *args, **kwargs)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/django/utils/decorators.py\", line 29, in _wrapper\r\n    return bound_func(*args, **kwargs)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py\", line 22, in _wrapped_view\r\n    return view_func(request, *args, **kwargs)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/django/utils/decorators.py\", line 25, in bound_func\r\n    return func(self, *args2, **kwargs2)\r\n  File \"/var/www/tourism/www/tourism/core/mixins.py\", line 13, in dispatch\r\n    return super(LoginRequredMixin, self).dispatch(*args, **kwargs)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/django/views/generic/base.py\", line 87, in dispatch\r\n    return handler(request, *args, **kwargs)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/django/views/generic/edit.py\", line 205, in post\r\n    return super(BaseCreateView, self).post(request, *args, **kwargs)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/django/views/generic/edit.py\", line 171, in post\r\n    return self.form_valid(form)\r\n  File \"/var/www/tourism/www/tourism/apps/place/views.py\", line 368, in form_valid\r\n    self.object.save()\r\n  File \"/var/www/tourism/www/tourism/apps/place/models.py\", line 409, in save\r\n    super(Photo, self).save(*args, **kwargs)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/django/db/models/base.py\", line 545, in save\r\n    force_update=force_update, update_fields=update_fields)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/django/db/models/base.py\", line 582, in save_base\r\n    update_fields=update_fields, raw=raw, using=using)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py\", line 185, in send\r\n    response = receiver(signal=self, sender=sender, **named)\r\n  File \"/var/www/tourism/www/tourism/apps/place/models.py\", line 108, in do_post_save\r\n    instance.rename_files()\r\n  File \"/var/www/tourism/www/tourism/apps/place/models.py\", line 101, in rename_files\r\n    self.save(update_fields=update_fields)\r\n  File \"/var/www/tourism/www/tourism/apps/place/models.py\", line 415, in save\r\n    crop='center'\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/sorl/thumbnail/shortcuts.py\", line 8, in get_thumbnail\r\n    return default.backend.get_thumbnail(file_, geometry_string, **options)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/sorl/thumbnail/base.py\", line 61, in get_thumbnail\r\n    thumbnail)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/sorl/thumbnail/base.py\", line 86, in _create_thumbnail\r\n    image = default.engine.create(source_image, geometry, options)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/sorl/thumbnail/engines/base.py\", line 15, in create\r\n    image = self.orientation(image, geometry, options)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/sorl/thumbnail/engines/base.py\", line 26, in orientation\r\n    return self._orientation(image)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/sorl/thumbnail/engines/pil_engine.py\", line 29, in _orientation\r\n    exif = image._getexif()\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/PIL/JpegImagePlugin.py\", line 362, in _getexif\r\n    return _getexif(self)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/PIL/JpegImagePlugin.py\", line 386, in _getexif\r\n    info.load(file)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/PIL/TiffImagePlugin.py\", line 421, in load\r\n    tag, typ = i16(ifd), i16(ifd, 2)\r\n  File \"/var/www/tourism/env/local/lib/python2.7/site-packages/PIL/_binary.py\", line 29, in i16le\r\n    return i8(c[o]) | (i8(c[o+1])<<8)\r\nIndexError: string index out of range\r\n```\r\n\r\n![admiral](https://f.cloud.github.com/assets/3088773/2086992/3809123a-8e63-11e3-8386-ed545452ba27.jpg)"},"comment":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/comments/173789287","html_url":"https://github.com/python-pillow/Pillow/issues/518#issuecomment-173789287","issue_url":"https://api.github.com/repos/python-pillow/Pillow/issues/518","id":173789287,"user":{"login":"radarhere","id":3112309,"avatar_url":"https://avatars.githubusercontent.com/u/3112309?v=3","gravatar_id":"","url":"https://api.github.com/users/radarhere","html_url":"https://github.com/radarhere","followers_url":"https://api.github.com/users/radarhere/followers","following_url":"https://api.github.com/users/radarhere/following{/other_user}","gists_url":"https://api.github.com/users/radarhere/gists{/gist_id}","starred_url":"https://api.github.com/users/radarhere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radarhere/subscriptions","organizations_url":"https://api.github.com/users/radarhere/orgs","repos_url":"https://api.github.com/users/radarhere/repos","events_url":"https://api.github.com/users/radarhere/events{/privacy}","received_events_url":"https://api.github.com/users/radarhere/received_events","type":"User","site_admin":false},"created_at":"2016-01-22T03:04:00Z","updated_at":"2016-01-22T03:04:00Z","body":"I can't replicate that problem, either with current Pillow or 2.9.x, which would have been the version when you posted this image. Can you provide any information about your platform/version of Pillow/version of Python?"}}