Image upload through a weblink throws error while saving an Item
See original GitHub issueDescription of the issue
While creating a new Item with an image (uploaded via weblink ) gives an error.
Version
bench
- 4.1.0
frappe
- v11
erpnext
- v11
os
- Ubuntu 18.04.3 LTS
Steps to reproduce the issue
- create a new Item
- upload an image for the item using weblink option
- try to save it.
Stacktrace / full error message
Traceback (most recent call last):
File "/.../apps/frappe/frappe/app.py", line 61, in application
response = frappe.handler.handle()
File "/.../apps/frappe/frappe/handler.py", line 21, in handle
data = execute_cmd(cmd)
File "/.../apps/frappe/frappe/handler.py", line 56, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/.../apps/frappe/frappe/__init__.py", line 1036, in call
return fn(*args, **newargs)
File "/.../apps/frappe/frappe/desk/form/save.py", line 22, in savedocs
doc.save()
File "/.../apps/frappe/frappe/model/document.py", line 260, in save
return self._save(*args, **kwargs)
File "/.../apps/frappe/frappe/model/document.py", line 296, in _save
self.run_before_save_methods()
File "/.../apps/frappe/frappe/model/document.py", line 876, in run_before_save_methods
self.run_method("validate")
File "/.../apps/frappe/frappe/model/document.py", line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/.../apps/frappe/frappe/model/document.py", line 1048, in composer
return composed(self, method, *args, **kwargs)
File "/.../apps/frappe/frappe/model/document.py", line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/.../apps/frappe/frappe/model/document.py", line 766, in <lambda>
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/.../apps/erpnext/erpnext/stock/doctype/item/item.py", line 120, in validate
self.make_thumbnail()
File "/.../apps/erpnext/erpnext/stock/doctype/item/item.py", line 273, in make_thumbnail
file_doc.make_thumbnail()
File "/.../apps/frappe/frappe/core/doctype/file/file.py", line 201, in make_thumbnail
image, filename, extn = get_web_image(self.file_url)
File "/.../apps/frappe/frappe/core/doctype/file/file.py", line 409, in get_web_image
image = Image.open(StringIO(frappe.safe_decode(r.content)))
TypeError: initial_value must be str or None, not bytes
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to Fix the HTTP Image Upload Error in WordPress
First, you should wait a few minutes and then try uploading your image file again. This error is sometimes caused by unusual traffic...
Read more >Image Upload Error - SharePoint - Microsoft Tech Community
I found the issue was caused by NOT having 'Edit' access to the 'Site Assets' library. If you create a new 'Page' then...
Read more >Error saving Item in cakephp when I upload an image within ...
it will allow the image to properly upload but will not save the product and when I use this code: <?php echo $this->Form-> ......
Read more >How to Fix the WordPress HTTP Error (Uploading Image to ...
The WordPress HTTP error occurs when something goes wrong while attempting to upload images or videos using the built-in media library tool.
Read more >Why can't I upload an image to my site? - Thinkific Help Center
Go to http://www.refreshyourcache.com/en/home/ and refresh your cache. Sometimes browser caching causes problems with file uploads. After clearing your browser ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@vamagithub
Tested on Version 11 on Python 3