{"action":"created","issue":{"url":"https://api.github.com/repos/frappe/erpnext/issues/4201","labels_url":"https://api.github.com/repos/frappe/erpnext/issues/4201/labels{/name}","comments_url":"https://api.github.com/repos/frappe/erpnext/issues/4201/comments","events_url":"https://api.github.com/repos/frappe/erpnext/issues/4201/events","html_url":"https://github.com/frappe/erpnext/issues/4201","id":112314821,"number":4201,"title":"Errors on Attach image & save : \"Unable to read file format\" and \"local variable 'image' referenced before assignment\"","user":{"login":"revant","id":1040161,"avatar_url":"https://avatars.githubusercontent.com/u/1040161?v=3","gravatar_id":"","url":"https://api.github.com/users/revant","html_url":"https://github.com/revant","followers_url":"https://api.github.com/users/revant/followers","following_url":"https://api.github.com/users/revant/following{/other_user}","gists_url":"https://api.github.com/users/revant/gists{/gist_id}","starred_url":"https://api.github.com/users/revant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revant/subscriptions","organizations_url":"https://api.github.com/users/revant/orgs","repos_url":"https://api.github.com/users/revant/repos","events_url":"https://api.github.com/users/revant/events{/privacy}","received_events_url":"https://api.github.com/users/revant/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-20T08:38:47Z","updated_at":"2015-10-20T19:07:27Z","closed_at":"2015-10-20T19:07:27Z","body":"1. Attached Image to Item\r\n1. Save\r\n\r\nIt shows 2 errors\r\n\"Unable to read file format for /files/Eternal_pen.jpg\"\r\n![2errorpil](https://cloud.githubusercontent.com/assets/1040161/10602092/f45ff02e-7733-11e5-9c38-67cd841b44c1.png)\r\n\r\nand\r\n```\r\nTraceback (innermost last):\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/desk/form/save.py\", line 18, in savedocs\r\n    doc.save()\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/model/document.py\", line 239, in save\r\n    self.run_before_save_methods()\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/model/document.py\", line 589, in run_before_save_methods\r\n    self.run_method(\"validate\")\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/model/document.py\", line 551, in run_method\r\n    return Document.hook(fn)(self, *args, **kwargs)\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/model/document.py\", line 706, in composer\r\n    return composed(self, method, *args, **kwargs)\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/model/document.py\", line 689, in runner\r\n    add_to_return_value(self, fn(self, *args, **kwargs))\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/model/document.py\", line 545, in \r\n    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)\r\n  File \"/home/revant/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py\", line 69, in validate\r\n    self.make_thumbnail()\r\n  File \"/home/revant/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py\", line 111, in make_thumbnail\r\n    file_doc.make_thumbnail()\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py\", line 142, in make_thumbnail\r\n    image,\r\n UnboundLocalError: local variable 'image' referenced before assignment\r\n\r\nTraceback (innermost last):\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/app.py\", line 67, in application\r\n    response = frappe.handler.handle()\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/handler.py\", line 75, in handle\r\n    execute_cmd(cmd)\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/handler.py\", line 109, in execute_cmd\r\n    ret = frappe.call(method, **frappe.form_dict)\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/__init__.py\", line 773, in call\r\n    return fn(*args, **newargs)\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/desk/form/save.py\", line 18, in savedocs\r\n    doc.save()\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/model/document.py\", line 239, in save\r\n    self.run_before_save_methods()\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/model/document.py\", line 589, in run_before_save_methods\r\n    self.run_method(\"validate\")\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/model/document.py\", line 551, in run_method\r\n    return Document.hook(fn)(self, *args, **kwargs)\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/model/document.py\", line 706, in composer\r\n    return composed(self, method, *args, **kwargs)\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/model/document.py\", line 689, in runner\r\n    add_to_return_value(self, fn(self, *args, **kwargs))\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/model/document.py\", line 545, in \r\n    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)\r\n  File \"/home/revant/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py\", line 69, in validate\r\n    self.make_thumbnail()\r\n  File \"/home/revant/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py\", line 111, in make_thumbnail\r\n    file_doc.make_thumbnail()\r\n  File \"/home/revant/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py\", line 142, in make_thumbnail\r\n    image,\r\n UnboundLocalError: local variable 'image' referenced before assignment\r\n```"},"comment":{"url":"https://api.github.com/repos/frappe/erpnext/issues/comments/149670529","html_url":"https://github.com/frappe/erpnext/issues/4201#issuecomment-149670529","issue_url":"https://api.github.com/repos/frappe/erpnext/issues/4201","id":149670529,"user":{"login":"anandpdoshi","id":836785,"avatar_url":"https://avatars.githubusercontent.com/u/836785?v=3","gravatar_id":"","url":"https://api.github.com/users/anandpdoshi","html_url":"https://github.com/anandpdoshi","followers_url":"https://api.github.com/users/anandpdoshi/followers","following_url":"https://api.github.com/users/anandpdoshi/following{/other_user}","gists_url":"https://api.github.com/users/anandpdoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/anandpdoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anandpdoshi/subscriptions","organizations_url":"https://api.github.com/users/anandpdoshi/orgs","repos_url":"https://api.github.com/users/anandpdoshi/repos","events_url":"https://api.github.com/users/anandpdoshi/events{/privacy}","received_events_url":"https://api.github.com/users/anandpdoshi/received_events","type":"User","site_admin":false},"created_at":"2015-10-20T19:07:27Z","updated_at":"2015-10-20T19:07:27Z","body":"Fixed"}}