{"action":"created","issue":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/1359","labels_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1359/labels{/name}","comments_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1359/comments","events_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1359/events","html_url":"https://github.com/python-pillow/Pillow/issues/1359","id":97739308,"number":1359,"title":"PIL.JpegImagePlugin in _getexif TypeError: 'unicode' object cannot be interpreted as an index","user":{"login":"sergei-maertens","id":5518550,"avatar_url":"https://avatars.githubusercontent.com/u/5518550?v=3","gravatar_id":"","url":"https://api.github.com/users/sergei-maertens","html_url":"https://github.com/sergei-maertens","followers_url":"https://api.github.com/users/sergei-maertens/followers","following_url":"https://api.github.com/users/sergei-maertens/following{/other_user}","gists_url":"https://api.github.com/users/sergei-maertens/gists{/gist_id}","starred_url":"https://api.github.com/users/sergei-maertens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergei-maertens/subscriptions","organizations_url":"https://api.github.com/users/sergei-maertens/orgs","repos_url":"https://api.github.com/users/sergei-maertens/repos","events_url":"https://api.github.com/users/sergei-maertens/events{/privacy}","received_events_url":"https://api.github.com/users/sergei-maertens/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-28T15:46:11Z","updated_at":"2015-07-29T11:13:10Z","closed_at":null,"body":"This seems to be related to #635, #1163, #1256, #520.\r\n\r\nPillow 2.9.0, Python 2.7\r\n\r\nTraceback:\r\n```\r\nStacktrace (most recent call last):\r\n\r\n  File \"django/core/handlers/base.py\", line 164, in get_response\r\n    response = response.render()\r\n  File \"django/template/response.py\", line 158, in render\r\n    self.content = self.rendered_content\r\n  File \"django/template/response.py\", line 135, in rendered_content\r\n    content = template.render(context, self._request)\r\n  File \"django/template/backends/django.py\", line 74, in render\r\n    return self.template.render(context)\r\n  File \"django/template/base.py\", line 209, in render\r\n    return self._render(context)\r\n  File \"django/template/base.py\", line 201, in _render\r\n    return self.nodelist.render(context)\r\n  File \"django/template/base.py\", line 903, in render\r\n    bit = self.render_node(node, context)\r\n  File \"django/template/base.py\", line 917, in render_node\r\n    return node.render(context)\r\n  File \"django/template/loader_tags.py\", line 135, in render\r\n    return compiled_parent._render(context)\r\n  File \"django/template/base.py\", line 201, in _render\r\n    return self.nodelist.render(context)\r\n  File \"django/template/base.py\", line 903, in render\r\n    bit = self.render_node(node, context)\r\n  File \"django/template/base.py\", line 917, in render_node\r\n    return node.render(context)\r\n  File \"django/template/base.py\", line 903, in render\r\n    bit = self.render_node(node, context)\r\n  File \"django/template/base.py\", line 917, in render_node\r\n    return node.render(context)\r\n  File \"sorl/thumbnail/templatetags/thumbnail.py\", line 59, in render\r\n    return self._render(context)\r\n  File \"sorl/thumbnail/templatetags/thumbnail.py\", line 137, in _render\r\n    thumbnail = get_thumbnail(file_, geometry, **options)\r\n  File \"sorl/thumbnail/shortcuts.py\", line 8, in get_thumbnail\r\n    return default.backend.get_thumbnail(file_, geometry_string, **options)\r\n  File \"sorl/thumbnail/base.py\", line 125, in get_thumbnail\r\n    thumbnail)\r\n  File \"sorl/thumbnail/base.py\", line 157, in _create_thumbnail\r\n    image = default.engine.create(source_image, geometry, options)\r\n  File \"sorl/thumbnail/engines/base.py\", line 20, in create\r\n    image = self.orientation(image, geometry, options)\r\n  File \"sorl/thumbnail/engines/base.py\", line 45, in orientation\r\n    return self._orientation(image)\r\n  File \"sorl/thumbnail/engines/pil_engine.py\", line 71, in _orientation\r\n    exif = image._getexif()\r\n  File \"PIL/JpegImagePlugin.py\", line 390, in _getexif\r\n    return _getexif(self)\r\n  File \"PIL/JpegImagePlugin.py\", line 424, in _getexif\r\n    file.seek(exif[0x8769])\r\n```\r\nThe exif data seems to be of the format\r\n```\r\n'Exif\\x00\\x00II*\\x00\\x08\\x00\\x00\\x00\\x07\\x00\\x1a\\x01\\x05\\x00\\x01\\x00\\x00\\x00b\\x00\\x00\\x00\\x1b\\x01\\x05\\x00\\x01\\x00\\x00\\x00j\\x00\\x00\\x00(\\x01\\x03\\x00\\x01\\x00\\x00\\x00\\x02\\x00\\x00\\x001\\x01\\x02\\x00\\x1d\\x00\\x00\\x00r\\x00\\x00\\x002\\x01\\x02\\x00\\x14\\x00\\x00\\x00\\x90\\x00\\x00\\x00\\x13\\x02\\x03\\x00\\x01\\x00\\x00\\x00\\x01\\x00\\x00\\x00i\\x87\\x02\\x00\\x9a\\x00\\x00\\x00\\xa4\\x00\\x00\\x00>\\x01\\x00\\x00\\xd0\\x07\\x00\\x00\\x04\\x00\\x00\\x00\\xd0\\x07\\x00\\x00\\x04\\x00\\x00\\x00Adobe Photoshop Elements 5.0\\x00\\x002010:08:15 13:58:09\\x00\\t\\x00\\x00\\x90\r\n```\r\nwhich is obviously encoded.\r\n\r\nThe image in question is https://modelbrouwers.nl/media/albums/44/3370/DSC_4458.jpg\r\n"},"comment":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/comments/125921464","html_url":"https://github.com/python-pillow/Pillow/issues/1359#issuecomment-125921464","issue_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1359","id":125921464,"user":{"login":"sergei-maertens","id":5518550,"avatar_url":"https://avatars.githubusercontent.com/u/5518550?v=3","gravatar_id":"","url":"https://api.github.com/users/sergei-maertens","html_url":"https://github.com/sergei-maertens","followers_url":"https://api.github.com/users/sergei-maertens/followers","following_url":"https://api.github.com/users/sergei-maertens/following{/other_user}","gists_url":"https://api.github.com/users/sergei-maertens/gists{/gist_id}","starred_url":"https://api.github.com/users/sergei-maertens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergei-maertens/subscriptions","organizations_url":"https://api.github.com/users/sergei-maertens/orgs","repos_url":"https://api.github.com/users/sergei-maertens/repos","events_url":"https://api.github.com/users/sergei-maertens/events{/privacy}","received_events_url":"https://api.github.com/users/sergei-maertens/received_events","type":"User","site_admin":false},"created_at":"2015-07-29T11:13:10Z","updated_at":"2015-07-29T11:13:10Z","body":"I've mentioned it on the cropping library, only later I realized this wasn't the most appropriate place to put the issue.\r\n\r\nYou can use the image."}}