Odoo Help


Cannot identify image file

Aitor Bouzas
on 12/31/14, 4:28 AM 1,873 views

Hi everyone,

I'm having an issue with adding an image to a report. This is code of the report


    <image x="37" y="37" height="50" width="110" file="../img/logo-coolabora.png" />



And this is the error shown as I try to generate the PDF:

cannot identify image file
fileName=<open file u'C:\\Archivos de programa\\OpenERP 7.0-20140221-003045\\Server\\server\\openerp\\addons\\ajuste_did\\img\\logo-coolabora.png', mode 'r' at 0x03799E90> identity=[ImageReader@0x392ed50 filename=u'C:\\Archivos de programa\\OpenERP 7.0-20140221-003045\\Server\\server\\openerp\\addons\\ajuste_did\\img\\logo-coolabora.png']
handle_pageBegin args=()

(<type 'exceptions.IOError'>, IOError("cannot identify image file\nfileName=<open file u'C:\\\\Archivos de programa\\\\OpenERP 7.0-20140221-003045\\\\Server\\\\server\\\\openerp\\\\addons\\\\ajuste_did\\\\img\\\\logo-coolabora.png', mode 'r' at 0x03799E90> identity=[ImageReader@0x392ed50 filename=u'C:\\\\Archivos de programa\\\\OpenERP 7.0-20140221-003045\\\\Server\\\\server\\\\openerp\\\\addons\\\\ajuste_did\\\\img\\\\logo-coolabora.png']\n handle_pageBegin args=()",), <traceback object at 0x03933F30>)

I've read on the web that this is an issue due to some Python's library... Can someone help me?

Thanks in advance.


As @Jeudy said, I used an url like this:

<image x="37" height="37" height="50" width="110" file="http://localhost:8069/[module_name]/static/img/[image_name.image_format]" />

Thanks @Jeudy! it worked for me the solution in the "EDIT" part of the question.

Aitor Bouzas
on 12/31/14, 5:13 AM

Jeudy Nicolas

--Jeudy Nicolas--

| 6 7 8
Pelousey, France
--Jeudy Nicolas--

- Linux administrator - Functional guy with OpenERP - Python, html, css, javascript developer OpenERP Ready Partner

Jeudy Nicolas
On 12/31/14, 4:52 AM


I think you have to use absolute url for images or base64 econded one.

Use for example: http://your_odoo_server/your_module/static/img/your_image.png or directly encore your image in base64.

Related posts:

- https://www.odoo.com/fr_FR/forum/help-1/question/images-in-webkit-mako-pdf-reports-16735

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

2 follower(s)


Asked: 12/31/14, 4:28 AM
Seen: 1873 times
Last updated: 3/16/15, 8:10 AM