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)
Version:
(earliest affected)
3.5.0 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL: https://github.com/dagwieers/asciidoc...
Whiteboard: odf
Keywords:
Depends on:
Blocks: ODF-import
  Show dependency treegraph
 
Reported: 2012-02-10 03:44 UTC by Dag Wieers
Modified: 2024-09-15 03:17 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
AsciiDoc source for image test file (1.72 KB, text/plain)
2012-12-02 14:15 UTC, Dag Wieers
Details
Flat ODF file showing the reported problem (436.85 KB, application/vnd.oasis.opendocument.text)
2012-12-02 14:16 UTC, Dag Wieers
Details
odt with scale, showing the effects of the bug (1.05 MB, application/vnd.oasis.opendocument.text)
2022-09-15 01:43 UTC, João Vidal
Details
odt with dimensions, showing no problems on image sizes (712.26 KB, application/vnd.oasis.opendocument.text)
2022-09-15 01:43 UTC, João Vidal
Details

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 (allotropia) 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: 6.3.3.2 (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
Comment 15 João Vidal 2020-07-17 12:20:42 UTC
I wrote a bash script to generate Writer files automatically, editing directly 'content.xml', adding images to 'Pictures' and then compressing all into an 'odt'.
I tried the easy way, configuring the fixed entries:
style:rel-width="scale" svg:height="1.499cm"
but all images were shrunk to a single pixel column.

I worked around this by checking original image dimension, estimating the final width and writing it to 'content.xml'. But it's not the elegant way to do it.

I'm using version 6.3.6.2, on Linux.
Comment 16 QA Administrators 2022-09-12 03:40:10 UTC Comment hidden (obsolete)
Comment 17 João Vidal 2022-09-15 01:43:14 UTC
Created attachment 182455 [details]
odt with scale, showing the effects of the bug
Comment 18 João Vidal 2022-09-15 01:43:55 UTC
Created attachment 182456 [details]
odt with dimensions, showing no problems on image sizes
Comment 19 João Vidal 2022-09-15 01:44:48 UTC
It's still present on LO 7.2.7 (my Linux distribution uses pacman, I can't install latest 7.4 with rpm or deb).

Using
    style:rel-width="scale" svg:height="1.499cm"
the images have a very small width. See attachment 'test_with_scale.odt'.

Using something like
    svg:width="1.438cm" svg:height="1.499cm"
the images have the expected size.. See attachment 'test_with_dimensions.odt'.
Comment 20 QA Administrators 2024-09-15 03:17:15 UTC
Dear Dag Wieers,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug