dagwieers / asciidoc-odf

ODF backend for AsciiDoc
98 stars 26 forks source link

LibreOffice bug: style:rel-width and style:rel-height not implemented properly #23

Open dagwieers opened 12 years ago

dagwieers commented 12 years ago

The current implementation in odt.conf for cover-images adds:

style:rel-width="100%" style:rel-height="scale".

For an image with the dimensions 2097x287, this should show the image in LibreOffice with a proportional width and height. However when opened in LibreOffice the width is indeed 100%, but the height seems to be the same as the width. So scale seems to be implementing "height" instead and the image ends up looking square instead. If you look in the Picture-properties in LibreOffice you can see the following values:

(x) Keep scale
( ) Keep image size

-- Scale --------------
Width: 96%
Height: 2%

-- Image Size -------
Width: 170,00mm
Height: 0,41mm

Modifying this Scale to Width: 100% and Height: 100% does the right thing.

If you save the file again, LibreOffice adds it this to the draw:frame:

svg:width="177.69mm" svg:height="24.31mm"

Without this working properly, LibreOffice only understands exact dimensions. Which means as producer (ODF backend) you need to get image dimensions and apply that to the page dimensions and all kinds of crazy shit ;-)

dagwieers commented 12 years ago

Problem has been reported upstream at: https://bugs.freedesktop.org/show_bug.cgi?id=45884