Bug 160472

Summary: Writer Web: Loading an html file changes picture "height" from "Auto" to actual picture size
Product: LibreOffice Reporter: Francis Hauber <francis.hauber>
Component: Writer WebAssignee: Not Assigned <libreoffice-bugs>
Status: UNCONFIRMED ---    
Severity: normal    
Priority: medium    
Version: 24.2.2.2 release   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard: QA:needsComment
Crash report or crash signature: Regression By:

Description Francis Hauber 2024-04-01 22:15:47 UTC
Description:
When opening a html file with Writer Web the size of constant ratio pictures are not properly loaded. If a picture has a given "width" and "auto" "height" Writer  Web is replacing the "auto" height with the actual height of the picture.
Exemple: file with html code: <img src="../image.png" name="Image" align="bottom" width="75%" height="auto" border="0"/> becomes 
<img src="../image.png" name="Image" align="bottom" width="75%" height="305" border="0"/> when saved again by Writer.
Issue seems to be at html file reading step as the pictures ratio changes when resizing Writer Web window after file opening.


Steps to Reproduce:
1.Create HTML file with picture. Set picture proportional width size, set "keep original ratio"
2.Store html file and close Writer Web. In the saved html file height="auto".
3.Load the html file in Writer Web, picture ratio isn't kept.

Actual Results:
When loading an html file containing a picture with constant ratio (width=xxx, height=auto) the "keep ratio" property shall be set for the picture.

Expected Results:
When loading an html file containing a picture with constant ratio (width=xxx, height=auto) the "keep ratio" property isn't set for the picture. "Keep ratio" Property is lost.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Load picture with "auto" height attribute as a "constant W/H ratio".
Comment 1 Francis Hauber 2024-04-20 08:24:54 UTC
Creation of an HTML document with Writer Web is working well and HTML file saved is correct as well.

However when the document loaded again the sizes of the images aren't properly restored: images created with a given proportional width (width="60%" for instance) and height="auto" are loaded with the correct proportional width (width="60%") but a fixed pixel width: width="305" for instance!

This makes writer web unusable to edit an html document.