Download it now!
Bug 45884 - LibreOffice does not understand "scale" value with style:rel-width and style:rel-height
Summary: LibreOffice does not understand "scale" value with style:rel-width and style:...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
3.5.0 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
Whiteboard: odf
Depends on:
Blocks: ODF-import
  Show dependency treegraph
Reported: 2012-02-10 03:44 UTC by Dag Wieers
Modified: 2019-11-12 05:10 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:

AsciiDoc source for image test file (1.72 KB, text/plain)
2012-12-02 14:15 UTC, Dag Wieers
Flat ODF file showing the reported problem (436.85 KB, application/vnd.oasis.opendocument.text)
2012-12-02 14:16 UTC, Dag Wieers

Note You need to log in before you can comment on or make changes to this bug.
Description Dag Wieers 2012-02-10 03:44:54 UTC
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. 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 ;-)

I believe this problem has always existed.
Comment 1 Dag Wieers 2012-02-10 07:17:08 UTC
The behavior one would expect is the behavior seen when pushing the "Original Size" button inside the Picture-proprties window.
Comment 2 Dag Wieers 2012-02-10 07:20:45 UTC
AFAICT LibO does not handle "scale", it does seem to handle percentages correctly.
Comment 3 sasha.libreoffice 2012-05-17 05:15:03 UTC
Thanks for bugreport
Please, attach odt file that demonstrates this problem
Comment 4 Dag Wieers 2012-12-02 14:15:53 UTC
Created attachment 70925 [details]
AsciiDoc source for image test file

This is the AsciiDoc source for the generated Flat ODF file showing the described problem.
Comment 5 Dag Wieers 2012-12-02 14:16:33 UTC
Created attachment 70926 [details]
Flat ODF file showing the reported problem

Flat ODF file showing the reported problem
Comment 6 Dag Wieers 2012-12-02 14:17:28 UTC
The attached Flat ODF file shows the (various) problems we see with including images into ODF.
Comment 7 QA Administrators 2013-09-24 01:48:11 UTC Comment hidden (obsolete)
Comment 8 Dag Wieers 2013-09-24 09:00:56 UTC
Bug was incorrectly set to NEEDINFO :-(
Comment 9 QA Administrators 2015-04-01 14:41:59 UTC Comment hidden (obsolete)
Comment 10 tommy27 2016-04-16 07:24:47 UTC Comment hidden (obsolete)
Comment 11 Michael Stahl (CIB) 2016-04-18 09:50:31 UTC
well i don't remember anybody fixing anything there
Comment 12 Johannes Wilm 2016-10-01 16:32:41 UTC
I just tested it. This bug is still there.
Comment 13 QA Administrators 2018-12-16 03:50:39 UTC Comment hidden (obsolete)
Comment 14 V Stuart Foote 2019-11-11 14:35:27 UTC
Still have issues of OP in scaling images of attachment 70926 [details] correctly to canvas.

Version: (x64)
Build ID: a64200df03143b798afd1ec74a12ab50359878ed
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded