Bug 142871 - Gratuitous /> after image in exported HTML
Summary: Gratuitous /> after image in exported HTML
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: All All
: medium minor
Assignee: Miklos Vajna
URL:
Whiteboard: target:7.3.0 target:7.2.0.0.beta2
Keywords: bibisected, bisected, regression
: 142872 (view as bug list)
Depends on:
Blocks: (X)HTML-Export
  Show dependency treegraph
 
Reported: 2021-06-15 09:19 UTC by Eyal Rozenberg
Modified: 2021-07-08 20:25 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Smiley face example: ODT + faulty HTML (11.93 KB, application/zip)
2021-06-15 09:21 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2021-06-15 09:19:24 UTC
In Writer,

1. Create a new document.
2. Insert a shape - Symbol | Smiley Face . Make it a few paragraphs' worth in height, and about the same width.
3. Save the document as HTML.
4. Open the output HTML in a web browser

Expected result: You only see the smilary-face image.

Actual result: You see a /> after the smiley face (at the top and to the right of it).
Comment 1 Eyal Rozenberg 2021-06-15 09:21:14 UTC
Created attachment 172900 [details]
Smiley face example: ODT + faulty HTML

Note there's a GIF which the HTML references.
Comment 2 Eyal Rozenberg 2021-06-15 09:27:39 UTC
Seen with:

Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: 162f5a20095c6937030d23ee03fb8f72c51eefa1
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-US (en_IL); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-06-06_16:55:45
Comment 3 Telesto 2021-06-16 04:59:53 UTC
Repro
Version: 7.2.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: 239b4bb27fd8db26e8416045b3015688a8b1b0ae
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL

not in
Version: 7.1.0.0.beta1+ (x64)
Build ID: f9fab4203c1aa0b9a3f27ce2713b6d5addc7df19
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win
Locale: nl-NL (nl_NL); UI: nl-NL
Calc: CL

Note: 7.1 has issues though!

[Note: also observing kind of 'crop' Right and bottom on html export have 'flat' area; something happening on more exports (recalling something about File ->  Export -> Image in Draw doing the same)
Comment 4 Michael Warner 2021-06-16 12:47:46 UTC
Relevant HTML looks like this:

<img src="smiley_html_9ea10e4862fb59d1.gif" name="Shape 1" alt="Shape 1" align="left" width="142" height="122"<img src="smiley_html_9ea10e4862fb59d1.gif" name="Shape 1" alt="Shape 1" align="left" width="142" height="122"/>
/>


As you can see, the HTML source has a second, unnecessary copy of the img element nested inside the expected img element. This is not correct HTML syntax. 

I think this is clearly a bug and not an enhancement. Since you can work around it by manually editing the HTML code to remove the unnecessary second element, I have changed the priority to minor.
Comment 5 raal 2021-06-19 04:16:17 UTC
This seems to have begun at the below commit.
Adding Cc: to Miklos Vajna ; Could you possibly take a look at this one?
Thanks
 9d0147aa2ba591e2692bb574d0ba107adbff1c86 is the first bad commit
commit 9d0147aa2ba591e2692bb574d0ba107adbff1c86
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Fri Jun 4 13:22:17 2021 +0200

    source e76471c5ce725dae9abb6f78b7674c6f77df34f4

https://git.libreoffice.org/core/+/e76471c5ce725dae9abb6f78b7674c6f77df34f4
  sw XHTML / reqif export: export non-PNG graphic shapes directly
Comment 6 Miklos Vajna 2021-06-28 07:53:10 UTC
Yes, I'll take a look.
Comment 7 Commit Notification 2021-07-01 16:26:25 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2d9580e6a65a2699ff61fc1b0e07f62b4946de84

tdf#142871 sw HTML export: avoid unwanted inner PNG for images

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.
Comment 8 Commit Notification 2021-07-02 13:22:27 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/e8903df87ecdef73471e379193bdccbb015f79f0

tdf#142871 sw HTML export: avoid unwanted inner PNG for images

It will be available in 7.2.0.0.beta2.

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.
Comment 9 Buovjaga 2021-07-02 18:05:33 UTC
*** Bug 142872 has been marked as a duplicate of this bug. ***
Comment 10 BogdanB 2021-07-08 20:25:27 UTC
it's solved.
Verified in
Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: eac5977bfc11797eda356560a5e45c51108ef5a1
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded