| Summary: | HTML import: base64 PNG image is stretched on import (height is scaled to 200% and aspect ratio not kept) | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Stéphane Guillou (stragu) <stephane.guillou> |
| Component: | filters and storage | Assignee: | Andreas Heinisch <andreas.heinisch> |
| Status: | VERIFIED FIXED | ||
| Severity: | normal | CC: | paulo_fg |
| Priority: | medium | ||
| Version: | 6.2.5.2 release | ||
| Hardware: | x86-64 (AMD64) | ||
| OS: | Linux (All) | ||
| See Also: | https://bugs.documentfoundation.org/show_bug.cgi?id=79952 | ||
| Whiteboard: | target:7.3.0 | ||
| Crash report or crash signature: | Regression By: | ||
| Bug Depends on: | |||
| Bug Blocks: | 111951 | ||
| Attachments: |
example HTML document
Screenshot of Writer 7.2 after opening the HTML file screenshot of HTML document opened in Firefox 89 PNG picture exported from Firefox, for reference image import html Screenshot: fixed in LO 7.3 alpha1 |
||
|
Description
Stéphane Guillou (stragu)
2021-06-11 06:21:41 UTC
Created attachment 172783 [details]
example HTML document
This HTML document is the output of an R Markdown file.
Created attachment 172784 [details]
Screenshot of Writer 7.2 after opening the HTML file
Created attachment 172785 [details]
screenshot of HTML document opened in Firefox 89
Created attachment 172786 [details]
PNG picture exported from Firefox, for reference
Reproduced in earlier version as well: Version: 6.2.5.2 Build ID: 1ec314fa52f458adc18c4f025c545a4e8b22c159 CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; Locale: en-AU (en_AU.UTF-8); UI-Language: en-US Calc: threaded One can restore the right aspect ratio by going to: image context menu > Crop tab > Click "Original size" The issue seems to be that, when opening the file, the height of the picture is scaled to 200% (but the width is 100%). it does in ubuntu 20.04... Created attachment 173445 [details]
image import html
(In reply to paulo g. from comment #7) > Created attachment 173445 [details] > image import html i have test it in 7.3 Paulo, given that you reproduced the bug, could you please set the status to "NEW"? Cheers :) Just a question/remark about the problem. What do we expect should LO do in the following cases: 1) Width/Height given -> take both values for Writer 2) Height/width given -> calculate the respective width/height and automatically keep the aspect ratio? 3) Nothing given -> take the original size (In reply to Andreas Heinisch from comment #10) > Just a question/remark about the problem. What do we expect should LO do in > the following cases: > > 1) Width/Height given -> take both values for Writer > 2) Height/width given -> calculate the respective width/height and > automatically keep the aspect ratio? > 3) Nothing given -> take the original size What is the difference between 1) and 2) ? Sry, was not specific enough. If you have given only the width, calculate the respective height keeping the aspect ratio and vice versa. Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/7a2d8ee2b45b8dd0f614614368ae90878e51a645 tdf#142781 - Calculate width/height keeping aspect ratio It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. This patch still does not address some corner cases during the import of an image in an html document. For instance, if the width/height is explicitly set to 0, LO tries to retrieve some default value for the image, whereas a modern browser does not show the image. Maybe there will be some follow ups for this fix, if there are any new bug reports for importing an html document including images. Created attachment 176305 [details] Screenshot: fixed in LO 7.3 alpha1 Thank you Andreas! Verified as fixed in: Version: 7.3.0.0.alpha1+ / LibreOffice Community Build ID: eec32be26d5d5805c1cb8cb53ce9702c04829819 CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: threaded |