Skip to content

web_company_color: Error when computing colors when using webp image as logo #3532

@tarteo

Description

@tarteo

Module

web_company_color

Describe the bug

When using the compute colors feature this error pops up when having a webp image as company logo:

Odoo Server Error

RPC_ERROR
Odoo Server Error

Occured on oca-web-18-0-pr3428-f81eb7e4c68e.runboat.odoo-community.org on model res.company on 2026-05-06 14:08:19 GMT

Traceback (most recent call last):
  File "/opt/odoo/odoo/http.py", line 2167, in _transactioning
    return service_model.retrying(func, env=self.env)
  File "/opt/odoo/odoo/service/model.py", line 157, in retrying
    result = func()
  File "/opt/odoo/odoo/http.py", line 2134, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/opt/odoo/odoo/http.py", line 2382, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 333, in _dispatch
    result = endpoint(**request.params)
  File "/opt/odoo/odoo/http.py", line 754, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/opt/odoo/addons/web/controllers/dataset.py", line 42, in call_button
    action = call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoo/odoo/api.py", line 535, in call_kw
    result = getattr(recs, name)(*args, **kwargs)
  File "/mnt/data/odoo-addons-dir/web_company_color/models/res_company.py", line 191, in button_compute_color
    _r, _g, _b = image_to_rgb(convert_to_image(self.logo))
  File "/mnt/data/odoo-addons-dir/web_company_color/utils.py", line 15, in convert_to_image
    return Image.open(BytesIO(base64.b64decode(field_binary)))
  File "/opt/odoo-venv/lib/python3.10/site-packages/PIL/Image.py", line 3008, in open
    raise UnidentifiedImageError(
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7fa54ad49df0>

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
    RPC_ERROR
        at makeErrorFromResponse (http://oca-web-18-0-pr3428-f81eb7e4c68e.runboat.odoo-community.org/web/assets/a4e1159/web.assets_web.min.js:3178:165)
        at XMLHttpRequest.<anonymous> (http://oca-web-18-0-pr3428-f81eb7e4c68e.runboat.odoo-community.org/web/assets/a4e1159/web.assets_web.min.js:3184:13)

To Reproduce

Affected versions: 18.0

Steps to reproduce the behavior:

  1. Go to settings > users & companies > companies
  2. open a company
  3. upload a webp image as logo
  4. click "Compute colors from logo" in the company styles tab
  5. the error appears

Additional context
Tested in runboat

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions