Option to embed images in generated html file

I just had to revert back to an older version of LibreOffice because apparently what I saw as a “feature” was actually considered to be a bug by everyone else.

Now when I save an .odt file as .html, the images are saved as links. I want to embed them, the way they used to be. I’ve searched all the menus and this forum and cannot find an option for this. I thought that “break link” under the edit menu would do it, but it doesn’t.

What else?

HTML files are plain text files.
The only way I can think of to embed an image is to encode it like some small images in CSS.

Please explain what you are trying to replicate in the previous version.

And what is the previous version of LO you are going back to? so I can test

https://bugs.documentfoundation.org/show_bug.cgi?id=48887

You may use command line to embed images:

soffice --convert-to html:HTML:EmbedImages file.odt

Thank you ! This worked for us. I had to embed a page in a mail, this was the easiest way in Thunderbird.

I reverted to version 5.1.6.2 and it “works” as I was used to. After reading bug reports (including the one pointed to in this question’s current answer), I understand that most folks did not like it “working” that way and it was changed in more recent versions. That would be fine, except I would like the option for it to work as before:

First, I’m running Windows 7.
In Writer, after editing my .odt file, I use “file” → “save as” → .html.
In 5.1.6.2, Writer creates one .html file in which all the pictures are embedded. The newer versions of Writer create one .html file with gobs of .jpg files with long names with long strings of numbers in them (one per picture in the document). Yeah, sure I can zip the whole mess up and send it to our webmaster, but he has grown to prefer the One File Solution!

I thought that maybe using “break links” under the “edit” menu in the newest Writer version might embed those images. It does indeed break the links, but the images are not embedded. Instead, there’s a blank box where the image should be.

The Oliver’s patch made it comparatively easy (in code) to select either embedded or linked variant. You may want to file a feature request for an option, with a link to the mentioned bug report as See Also.

Oh, and the way I insert images into my .odt file, is to use “insert” → “image” .

Hello,
I have the same problem with version 5.4.5.1 you cannot embed image anymore into a html file, which for certain application make your project difficult to maintain.
Is there a way to have this possibility with a plugin?
Thank you
Patrice

You can export to XHTML. Then the images are embedded in base64 format. Applications that can read modern HTML 5 should be able to work with XHTML as well.

Years later, the OP has not yet awakened after pricking their hand on a spindle, but…

I came across the same issue. While saving a LibreOffice document as HTML ensures clean markup that can be much better pasted to Emails or web-based WYSIWYG editors (say, Reddit), I found it lacking overall. Convenient to use the same interface, but many things don’t work just right.

  • Images can’t be embedded by default, so copy-paste to another program sometimes results in a broken image.
  • Paragraph/Character/List styles are only partly supported, but what is lost will only be seen after reloading the document.
  • Apparently some bugs wrt treating headings as outline entries. (On my Windows system, it would reset to not recognizing Heading 1 as an outline level.)
  • Equations can be inserted, but open reloading the file they are just images (again, not embedded). Which is a shame, since the source code could have been stored as a HTML attribute for editing, but also their resolution is so low that characters end up with interrupted lines.

These issues are inherent to coopting a software designed around the open document format for HTML editing (as opposed to treating HTML purely as an import/export format).

I was already before thinking “Thundebird’s editor would be my favorite solution, if only it would allow directly editing HTML files”. Turns out, there are multiple softwares that have exactly that component.

  • SeaMonkey. A bigger “all in one internet suite”, but it also has a composer component.
  • Kompozer. Purely the HTML editing component, with some extensions. Listed as successor by Nvu. SeaMonkey embeds pasted images like Thunderbird, but Kompozer doesn’t. I was wrong about that.

Crucially, the editing process of Thunderbird’s message editor is all there in both, down to the hotkeys (including for the menu bar Alt+Letter Sequence access). Both add features on top of that, but the core is just there.

Edit. Compozer turns out to be badly supported. On Windows, the old binary “just works”, but on Linux

  • Compiling from source proofed to at least not work out of the box. It also doesn’t help that the last change was in 2016, so by now it might require compiling old versions of libraries yourself.
  • Compiled executables likewise depend on old library versions. Some I was able to resolve with installation of 32bit libraries, others not.

Among all the composer-based solutions, Seamonkey’s composer is the only one I found to be actively supported.

Always a stark reminder on realities of the software world, when it is easier to install an open source software on Windows than on Linux :confused: