Odoo Help

Welcome!

This community 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.

0

Cannot identify image file

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

Hi everyone,

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

<pageGraphics>

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

...

</pageGraphics>

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.

SOLUTION:

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
1

Jeudy Nicolas

--Jeudy Nicolas--
1181
| 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

Hello,

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

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