Bug 117077 - Conversion to HTML should embed images by default.
Summary: Conversion to HTML should embed images by default.
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice Online
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:6.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-18 01:06 UTC by Simon
Modified: 2018-04-27 12:41 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon 2018-04-18 01:06:05 UTC
Using LibreOffice online conversion feature:

When converting a file containing image(s) to the html format, the default behavior should be to embed the image(s) (base 64) instead of returning an html file with path references (on the server) to the extracted image files that obviously are not available on client side.

Using JODConverter, we have to set the "FilterOptions" to "EmbedImages".
Comment 1 Miklos Vajna 2018-04-25 10:13:38 UTC
I think bug 63211 made it the non-default, so at least the problems from that bug has to be considered before blindly flipping the default in sw/source/filter/html/wrthtml.cxx:196.
Comment 2 Simon 2018-04-25 12:02:38 UTC
Instead of changing the default behavior for the whole writer, wouldn't be possible to just set the "EmbedImages" property to true when the conversion is done to HTML by a call to the LibreOffice Online API ?

The commit comment for 63211 is:

"This change re-introduces linked images in HTML export
but keeps embedded image export in mailmerge e-Mail function"

Wouldn't it be possible to do the same (keeps embedded images) for the LibreOffice Online conversion feature ?
Comment 3 Jan Holesovsky 2018-04-26 09:00:07 UTC
Just for the record, I'd be for embedding images by default too :-)

The reason not to do that described in bug 63211 comment 19 was that HTML import in LibreOffice couldn't handle the embedded images - but that's reportedly not the case any more, and we can handle it fine these days.

The only other case I've heard of is copy from LibreOffice and paste to Word - but then again, I wonder why text/rtf mimetype is not used in that case (?)

But for the export of html, it's much more useful to embed images to have self-contained documents.

Ie. I support to change the default to embedding in all cases but where it breaks (the possible copy LibreOffice / paste Word case), than what we have currently: not embedding by default, and embedding only in mail merge.
Comment 4 Miklos Vajna 2018-04-26 09:06:35 UTC
Samuel, do you (or anyone else from CIB) remember what was the exact scenario where HTML embedding of images broke? I verified that on import we now handle embedded images. So do you have any concerns to flip the default and embed everywhere, except copy&paste?

If not, I plan to go ahead with this, loosing images in Online is quite annoying.
Comment 5 Samuel Mehrbrodt (allotropia) 2018-04-26 09:16:24 UTC
(In reply to Miklos Vajna from comment #4)
> Samuel, do you (or anyone else from CIB) remember what was the exact
> scenario where HTML embedding of images broke? I verified that on import we
> now handle embedded images. So do you have any concerns to flip the default
> and embed everywhere, except copy&paste?
> 
> If not, I plan to go ahead with this, loosing images in Online is quite
> annoying.

/me investigating, will report back.
Comment 6 Michael Stahl (allotropia) 2018-04-26 09:27:22 UTC
the most relevant bug here is 88038 although there were a couple duplicates; apparently there are users who want to create their websites in Writer, and embedding images is a bit silly in that case.

clearly there needs to be a config option whether images should be embedded or not; i/m not sure what the default should be.
Comment 7 Samuel Mehrbrodt (allotropia) 2018-04-26 09:40:06 UTC
(In reply to Michael Stahl from comment #6)
> clearly there needs to be a config option whether images should be embedded
> or not; i/m not sure what the default should be.

Maybe instead of a config option rather a checkbox in the save dialog when "HTML" is selected.
With that, we would have covered both automatic conversion (where you can decide with the EmbedImages option) and also manual export.

Given that option, I have no strong preference how the default should be.
Comment 8 Katarina Behrens (Inactive) 2018-04-26 10:00:15 UTC
> Maybe instead of a config option rather a checkbox in the save dialog when
> "HTML" is selected.

Given that there's already too many checboxes in save-as dialog, it could also be a separate filter: 'HTML (embed images)' vs. 'HTML (link images)' Internally ofc the same export filter, differing just in the EmbedImages option set or not
Comment 9 V Stuart Foote 2018-04-26 12:51:16 UTC
(In reply to Katarina Behrens (CIB) from comment #8)
> 
> Given that there's already too many checboxes in save-as dialog, it could
> also be a separate filter: 'HTML (embed images)' vs. 'HTML (link images)'
> Internally ofc the same export filter, differing just in the EmbedImages
> option set or not

+1, and the distinct filters should help for CLI convert-to users.
Comment 10 Commit Notification 2018-04-27 12:40:25 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/online/commit/?id=7e9ba2e8c68f6904177272bee9453860224174ec

tdf#117077 kit: opt-in to embed images in HTML export
Comment 11 Miklos Vajna 2018-04-27 12:41:52 UTC
Bug was filed against Online, so there we just opt in. Feel free to file a follow-up bug for LibreOffice itself. I'm not sure what would be a solution that pleases everyone. Separate filters are a great idea, but for 3 boolean flags that means 8 filters. So maybe not. :-)