Usually there is the need to show the company logo on printed reports, so it will be great if we add some fields on company to allow the user to customize it. In trytonspain there is a module [1] which add the logo as Binary field, so the idea is to include in base at least this fields:
logo: field.Binary
width: field.Integer which stores the logo width
height: field.Integer which stores the logo height
We can also change header and footer to HTML fields, but we first need to solve issue2068.
Do you think more fields are needed?
Do you think that this information can be reused for other usages?
To put an image in Relatorio, we also need the mime-type (which is limited to the relatorio.templates.opendocument.EXTENSIONS).
About the size, is it not better to get a fixed size and resize the binary on the fly?
Also the generic common header/footer should be improved to include the image when it is present (maybe it should be optional). Maybe there are cases where user wants to have the logo on the footer.
I think we need to get an example of such generic header/footer.
Another possibility will be to allow HTML in the header/footer which could contains <img/>.
I would prefer to keep pillow dependency as optional.
So we could say in the help that the image should be in this format with this size and if pillow is available we proceed to the conversion otherwise we will let the report fails later.
Indeed the resizing will only be about limiting the size of the resulted document.
IME, logos work best when in some kind of vector format. SVG seems to work well enough with libreoffice.
PNGs and (deity forbid) JPEGs give poor result, either their resolution is too small or leads to scaling issues or their size is too large. Sometimes white background in the logo is not really white, leading to strange colored or gray rectangles, depending on output-device and -capabilities.
SVG even works in current web-browsers out of the box, and shouldnât have size- or fuzziness-issues on high-DPI-displays.
oups. I just noticed that I added 'image/svg': 'svg',
to relatorio.templates.opendocument.EXTENSIONS. I donât know if anything more would be needed for âproperâ support, but for barcodes and logos, this works for me. I can prepare code review for relatorio.