Odoo Help


How to upload jpg images

on 4/26/13, 8:18 AM 5,996 views

I host openerp on a aws server to try. When I upload images to products/customer/employee, only .png files are accepted. When I tried to upload a jpg file, errors as follow appeared.

Did I miss out setting the apps to accept jpg? I even go thru python lib and trace back to check necessary files, JpegImagePlugin.py are in the system.

I had tried several methods still cannot get the problem solved.

Client Traceback (most recent call last):
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/addons/web/http.py", line 203, in dispatch
    response["result"] = method(self, **self.params)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/addons/web/controllers/main.py", line 1117, in call_kw
    return self._call_kw(req, model, method, args, kwargs)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/addons/web/controllers/main.py", line 1109, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/addons/web/session.py", line 43, in proxy
    result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/addons/web/session.py", line 31, in proxy_method
    result = self.session.send(self.service_name, method, *args)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/addons/web/session.py", line 104, in send
    raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last):
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/addons/web/session.py", line 90, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/netsvc.py", line 293, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/osv/osv.py", line 188, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/osv/osv.py", line 131, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/osv/osv.py", line 197, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/osv/osv.py", line 185, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/addons/mail/mail_thread.py", line 242, in create
    thread_id = super(mail_thread, self).create(cr, uid, values, context=context)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/osv/orm.py", line 4469, in create
    result += self._columns[field].set(cr, self, id_new, field, vals[field], user, rel_context) or []
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/osv/fields.py", line 1145, in set
    self._fnct_inv(obj, cr, user, id, name, value, self._fnct_inv_arg, context)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/addons/product/product.py", line 524, in _set_image
    return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/addons/mail/mail_thread.py", line 264, in write
    result = super(mail_thread, self).write(cr, uid, ids, values, context=context)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/osv/orm.py", line 4270, in write
    self.pool.get(object)._store_set_values(cr, user, todo, fields_to_recompute, context)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/osv/orm.py", line 4601, in _store_set_values
    result = self._columns[val[0]].get(cr, self, ids, val, SUPERUSER_ID, context=context)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/osv/fields.py", line 1131, in get
    result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/addons/product/product.py", line 520, in _get_image
    result[obj.id] = tools.image_get_resized_images(obj.image, avoid_resize_medium=True)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/tools/image.py", line 165, in image_get_resized_images
    return_dict[medium_name] = image_resize_image_medium(base64_source, avoid_if_small=avoid_resize_medium)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/tools/image.py", line 103, in image_resize_image_medium
    return image_resize_image(base64_source, size, encoding, filetype, avoid_if_small)
  File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20130318_002339-py2.7.egg/openerp/tools/image.py", line 83, in image_resize_image
    image = ImageOps.fit(image, size, Image.ANTIALIAS)
  File "/opt/bitnami/python/lib/python2.7/site-packages/Pillow-1.7.8-py2.7-linux-x86_64.egg/PIL/ImageOps.py", line 329, in fit
    (leftSide, topSide, leftSide + cropWidth, topSide + cropHeight)
  File "/opt/bitnami/python/lib/python2.7/site-packages/Pillow-1.7.8-py2.7-linux-x86_64.egg/PIL/Image.py", line 761, in crop
  File "/opt/bitnami/python/lib/python2.7/site-packages/Pillow-1.7.8-py2.7-linux-x86_64.egg/PIL/ImageFile.py", line 189, in load
    d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
  File "/opt/bitnami/python/lib/python2.7/site-packages/Pillow-1.7.8-py2.7-linux-x86_64.egg/PIL/Image.py", line 383, in _getdecoder
    raise IOError("decoder %s not available" % decoder_name)
IOError: decoder jpeg not available


Oh! something more: I am able to attach JPG files to emails

on 4/26/13, 8:20 AM
On 5/28/14, 5:38 AM

Hi all, 


- I have the same error 

- I fix :


* The first remove all pillow and PIL packge inside site-packge python2.x

* After process:


$ wget https://pypi.python.org/packages/source/P/Pillow/Pillow-2.2.1.zip 

and install it


cd this

sudo python2.7 setup.py install


Hope help :)

On 4/27/13, 4:36 AM

OK! I install the apps via 3rd party manage console. Some of the users facing the same problem as well. Should be the server setting error. Thank you.


Yannick Vaucher - Camptocamp

--Yannick Vaucher - Camptocamp--

| 5 7 9
Lausanne, Switzerland
--Yannick Vaucher - Camptocamp--
Yannick Vaucher - Camptocamp
On 4/26/13, 2:20 PM

Have you all the required libairies ?

Please check the following question: is-there-somewhere-a-list-of-needed-python-libraries

And you might need to be careful how you installed PIL librairy. You will certainly need the JPEG support.


I follow all the steps. And get the information -- JPEG support available. However still unable to upload JPG files.

on 4/27/13, 3:44 AM

I follow some other steps, reinstall PIL, however when I run "pyhton selftest.py", IOError appear as decoder JPEG not avalibale.

on 4/27/13, 4:29 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 4/26/13, 8:18 AM
Seen: 5996 times
Last updated: 3/16/15, 8:10 AM