Bug 85904 - html export GUI option missing: force external / embed images
Summary: html export GUI option missing: force external / embed images
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: HTML-Export
  Show dependency treegraph
 
Reported: 2014-11-05 08:36 UTC by Marco Ciampa
Modified: 2018-10-15 05:49 UTC (History)
2 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 Marco Ciampa 2014-11-05 08:36:40 UTC
A very nice addition to the html export filter could be to add an option to force the external / embedded export of all images in the document.
I can imagine, for example, two scenarios in which this option could be useful:

1) document with embedded images that one wants to export to html+links to local "images" folder as for web publishing.

2) document with link to local images that one want to export as a unique html with embedded images as for document embedding like in an email.

Now the choice depends on how the document is created into LibreOffice.
Comment 1 Marco Ciampa 2014-11-21 08:19:05 UTC
Keep in mind that the HTML exporter, now loses data.


Infact if you have a document with locally stored linked images (instead of embedded) the html produced document embeds all images, losing all filenames.


If you manage to extract the images from the produced html output exported by LibO by means of an external filter/tool, you can't recover file names and this is _bad_.
Comment 2 QA Administrators 2017-01-03 19:39:22 UTC Comment hidden (obsolete)
Comment 3 Marco Ciampa 2017-01-03 22:32:55 UTC
The option is still missing in the html export _but_ now it correctly preserves the external linked images names (yay!).

Linux Ubuntu 16.04-64 Version: 5.2.3.2
Build ID: 1:5.2.3~rc2-0ubuntu1~xenial1
Comment 4 Mike Kaganski 2017-04-24 09:45:46 UTC
As this bug is filed (for filters and storage component), the option is present now (since 5.2, commit http://cgit.freedesktop.org/libreoffice/core/commit/?id=46fa816aa0a713c54836b9689fa7a1c9ff55ef5a). The filter option to allow image embedding is "EmbedImages", and may be used from the command line stis way:

> soffice --convert-to html:HTML:EmbedImages originalfile

This bug may be, however, converted to be about missing UI option to use this feature (there could be "Change filter settings" checkbox enabled in Save As dialog for HTML, and proper filter settings dialog implemented).
Comment 5 Xisco Faulí 2017-06-07 20:19:52 UTC
You can't confirm yourself a bug.
Could you please try to reproduce it with the latest version of LibreOffice
from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the bug is still present in the latest version.
Comment 6 Marco Ciampa 2017-06-07 21:12:40 UTC
As Mike Kaganski said, in command line now there is a "force embed images" option but:

1) it misses the complementary "force save images as external files + links"
2) these options are absent in the GUI

Tested with LibO 5.3.3.2 GNU/Linux
Comment 7 Mike Kaganski 2017-06-08 04:31:33 UTC
To add a new GUI option is a valid enhancement request -> NEW.

Note that there's no need for "complimentary force save images as external files + links" option, because this mode is the default (i.e. it is used without explicit command-line html:HTML:EmbedImages filter option).
Comment 8 Marco Ciampa 2017-06-08 06:02:24 UTC
Mmmm I'm not sure Mike.
As I say previously for the previous versions of LibO (and that behaviour isn't changed yet) the default behaviour is to save the document as it was created.

So if you have a doc with embedded images and you want to save it as a main html file with separated and linked images (to put it in a web server for example) you have to export those images and link them all before exporting the doc into HTML so I think that option "force save images as external files + links" could be _very_ useful indeed...
Comment 9 Mike Kaganski 2017-06-08 06:52:48 UTC
You are mixing two different things.

HTML export filter is used when you "Save as"-HTML. It works as I described; it doesn't matter if the images were linked or embedded - they will end up linked.

I suppose that you are talking about XHTML filter that may be used in File->Export. That is another thing.
Comment 10 Marco Ciampa 2017-06-08 10:15:33 UTC
1) you are right Mike!

2) very interesting observation! It should be documented or there should be a warning. Of course inserting the gui option for the embedded/linked images is self explanatory by itself...

3) since html is not really a text format I wonder if having a save as (html with images linked) and export as (xhtml with images linked or embedded) in two different menus have much sense. Why html and xhtml are not both in the export menu?

And yes, reloading a document saved in html does not bring it up the same (you lose some formats options like the text styles) so it is not really a save/load but more an import/export procedure...
Comment 11 Mike Kaganski 2018-10-15 05:49:00 UTC
See bug 44291, and it's proposed patch at https://gerrit.libreoffice.org/#/c/50388/, for an example of adding a GUI option to the export filter.