Bug 63211 - MAILMERGE: looses embedded image when e-mailing as html
Summary: MAILMERGE: looses embedded image when e-mailing as html
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Ciorba Edmond
URL:
Whiteboard: target:4.2.0 target:5.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-06 19:43 UTC by Ferry Toth
Modified: 2023-06-30 16:38 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
ODT with embedded gif (10.96 KB, application/vnd.oasis.opendocument.text)
2013-04-15 09:14 UTC, Ferry Toth
Details
resulting XTML (4.57 KB, application/xhtml+xml)
2013-04-15 09:14 UTC, Ferry Toth
Details
resulting HTML (836 bytes, text/html)
2013-04-15 09:15 UTC, Ferry Toth
Details
external GIF used by the html file (1.20 KB, image/gif)
2013-04-15 09:16 UTC, Ferry Toth
Details
test file with embeded image (278.79 KB, application/vnd.oasis.opendocument.text)
2018-01-16 18:20 UTC, worms
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ferry Toth 2013-04-06 19:43:02 UTC
When I send a Writer document after a mail merge to a list of e-mail addresses formated as HTML the embedded image is lost.

Recipients receive a message that contains the code below. Strangely when exporting the document to xhtml the image is exported as:<img style="height:6.526cm;width:4.895cm;" alt="" src="data:image/*;base64,R0lGODlh8ABAAfcAABwcH etc. etc./>. So the code to produce inline images is already present.

Or am I doing something wrong?

Ferry

received code
+++++++++++++
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="LibreOffice 3.6  (Linux)">
	<META NAME="CREATED" CONTENT="0;0">
	<META NAME="CHANGEDBY" CONTENT="Ferry Toth">
	<META NAME="CHANGED" CONTENT="20130406;21000100">
	<STYLE TYPE="text/css">
	<!--
		@page { margin: 2cm }
		P { margin-bottom: 0.21cm }
		A:link { so-language: zxx }
	-->
	</STYLE>
</HEAD>
<BODY LANG="nl-NL" DIR="LTR">
<P ALIGN=LEFT STYLE="margin-bottom: 0cm">Hallo Ferry</P>
<P ALIGN=LEFT STYLE="margin-bottom: 0cm"><IMG SRC="lu74wqv2_tmp_m7cd36300.gif" NAME="Afbeeldingen92" ALIGN=LEFT WIDTH=185 HEIGHT=247 BORDER=0>Text goes here...

....

</P>
</BODY>
</HTML>
Comment 1 Rainer Bielefeld Retired 2013-04-13 07:27:52 UTC
Not a valid bug report, but a user error. 
There is no "Picture embedding in HTML document. On the target PC the linked picture is not available, and so of course it will not be shown. If on the target PC a "lu74wqv2_tmp_m7cd36300.gif" is available in the same folder as the html document it will be shown in the document.
I do not know any help or other manual promising that local pictures will be mailed additionally with a mailed HTML document.

@Ferry Toth
Thank you for your feedback! Unfortunately you are wrong here, this is our  Bug tracking system, not a helpdesk! You can get assistance on
<http://ask.libreoffice.org/questions/>
or on the public users mailing list <users@libreoffice.org>, a mailing list from <http://www.documentfoundation.org/contribution/#lists> or
<http://wiki.documentfoundation.org/Local_Mailing_Lists> 

Please feel free to reopen this Bug if discussion with other users leaded to an assessment that we have a LibO bug  with a current LibO Version and a clear and comprehensible description of the problem due to  <http://wiki.documentfoundation.org/BugReport>. In any case please use LibO Menu 'Help -> Feedback/Bugreport' for bug reports!

And please attach documents using "Add an attachment (proposed patch, testcase, etc.)" function instead or citing source code.
Comment 2 Ferry Toth 2013-04-15 09:13:38 UTC
Rainer,

I think you are dismissing my bug report a bit too quick. As a user I do make errors and try not to bother you with those. When I find a bug that affects me, I try to report it here. This not my first.

I'll try to explain a bit more clear:
- The following has been tested using LibO 3.6.2.2 on Ubuntu x64 quantal (12.10)
- I have a Writer document with an embedded picture of type gif.
- I do a mail merge and send it to a list of recipients, including my self.
- The format of the sent mailing is html
- When I receive my copy of the mailing the picture is not present, there is an empty placeholder.

Looking at the html code of the received e-mail is shown in my first post.

Clearly this is a bug in LibO, as the html code is generated by LibO.

My other efforts to see if LibO can generate html with embedded images is just an experiment to see where things fail. I attached a sample document test.odt.

My findings are:
- when LibO exports the document as xhtml (test.xhtml) the image is embedded with mime type * (is that correct?) and displays correctly when the original image was gif on firefox and chrome.
- when LibO saves as html the gif is saved as separate file
- it seems there is a code path for xhtml and html
- when the image in the odt is svm it doesn't export well at all, with gif it works

and finally:
- when doing a mail merge LibO sends out the e-mail directly to the smtp server, it appears the html code path is used and the image is not embedded even though it could be.

Attaching my sample files right after this.

Ferry
Comment 3 Ferry Toth 2013-04-15 09:14:32 UTC
Created attachment 77983 [details]
ODT with embedded gif
Comment 4 Ferry Toth 2013-04-15 09:14:58 UTC
Created attachment 77984 [details]
resulting XTML
Comment 5 Ferry Toth 2013-04-15 09:15:54 UTC
Created attachment 77985 [details]
resulting HTML

you need the gif file as well to view this in your browser
Comment 6 Ferry Toth 2013-04-15 09:16:26 UTC
Created attachment 77986 [details]
external GIF used by the html file
Comment 7 Ferry Toth 2013-04-15 09:18:13 UTC
I believe based on my previous e-mails I can safely reopen this bug.
Comment 8 Rainer Bielefeld Retired 2013-04-15 10:42:06 UTC
>I think you are dismissing my bug report a bit too quick

@Ferry Toth
No! As I told you, HTML does not contain pictures, only links to picture sources. If you mail as HTML with picture links to web contents (like <http://upload.wikimedia.org/wikipedia/commons/thumb/9/9f/Salam_Fayyad_%28cropped%29.jpg/85px-Salam_Fayyad_%28cropped%29.jpg>) in your document the recipient will see the pictures in his mail (if he has internet connection). If your source document contains embedded pictures or linked pictures on your HDD these pictures can not be visible in a HTML format mail. Sender is responsible to use the appropriate mail formatting for his needs.

Please do not change Bug Status before you do not have more experience.
Please follow advice before you answer to comments.
Comment 9 Ferry Toth 2013-04-15 15:17:15 UTC
Rainer,

Of course html can contain embedded images. You might want to click on my second attachment.

But if you mean html e-mail cannot, you might be right. 

The point is: LibO should create a multipart mime message that includes the image, and it doesn't.

And I thought the intention is to send a formatted mailing including the images, and not work around it by sharing the images through some web server.

Isn't it?

Ferry
Comment 10 Rainer Bielefeld Retired 2013-04-15 16:00:33 UTC
> Of course html can contain embedded images

@Ferry (In reply to comment #9)
Source? RFC-No?

Of course you can submit an enhancement request for Messages with other formats including pictures and other objects, but you will have to mention a real killer application what shows that the goal can not be reached with odt, .doc., .pdf. I am more than doubtful that there is any chance that such an request would be accepted by a developer.
Comment 11 Andras Timar 2013-04-15 21:15:30 UTC
I tend to agree with Ferry. When a user choose HTML mail output in mail merge wizard, (s)he expects a normal HTML mail with images. From the technical point of view, it can be implemented either with multipart mime message, or with a single html file with embedded images. I think the latter is easier to implement, in Writer HTML export filter (sw/source/filter/html/) instead of saving the image to a temporary file and link its name, we could create the base64 data from it, and embed it. All modern browsers can display such html file. I think it is an easy hack.
Comment 12 Ferry Toth 2013-04-17 21:07:02 UTC
Rainer,

If you open the attachement XTML above in about anything the IE (I've tried FF, Chrome, Rekonq, Konqueror) you'll see that it opens with an embbed gif.

The file is generated by Writer.

I don't seem to understand what you mean by comment #10.

Ferry
Comment 13 Commit Notification 2013-07-11 11:36:47 UTC
Ciorba Edmond committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5dd1b3da57862a6577717544dde56482add89170

fdo#63211 - embed images in HTML export.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2013-07-19 13:06:28 UTC
Ciorba Edmond committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/help/commit/?id=59090e419fef3a6ec7a5270585d72312dafb78d2

Updating helpcontent for changes in fdo#63211, fdo#65456, fdo#65457.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 15 Ferry Toth 2013-09-28 20:18:32 UTC
When would this patch appear in LibO? Or better, how can I find if a certain patch has been applied to a certain build?

I just tried with 4.1.1.2 from the Ubuntu Libreoffice PPA but it is not there yet.
Comment 16 Cor Nouws 2013-12-19 21:48:28 UTC
(In reply to comment #15)
> When would this patch appear in LibO? 

https://wiki.documentfoundation.org/ReleaseNotes/4.2#Writer
Comment 17 Ferry Toth 2013-12-20 22:31:20 UTC
Well, it must be Christmas already.

Thank you, thank you all involved!

Merry Christmas!

Ferry
Comment 18 Spectas Riogrande 2014-01-30 15:47:23 UTC
That's great, thanks to everybody!

If I may draw your attention to bug #70233 and #70235, which are both email related. So if there is anyone, looking for new projects related to the email engine, this would be great! ;-)

Kind regards! Spectas
Comment 19 Armin Le Grand (allotropia) 2015-11-23 14:46:38 UTC
FYI: This feature broke the HTMNL import, see tdf#94088. Changing the HTML export to embedded graphics but not adapting the HTML import is from my POV a incomplete feature.
Comment 20 Cor Nouws 2015-11-23 15:08:05 UTC
(In reply to Armin Le Grand from comment #19)
> FYI: This feature broke the HTMNL import, see tdf#94088. Changing the HTML
> export to embedded graphics but not adapting the HTML import is from my POV
> a incomplete feature.

I think you are right here.
Comment 21 Commit Notification 2016-03-23 13:59:26 UTC
Oliver Specht committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=46fa816aa0a713c54836b9689fa7a1c9ff55ef5a

tdf#63211: saving embedded images to HTML optional

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 22 Cor Nouws 2016-03-23 15:30:43 UTC
@Oliver: thanks a lot :) !
Comment 23 worms 2018-01-16 18:19:03 UTC
Sorry to reopen this bug, but it's not solved
I try to send with MailMerge Wizard a form with embeded jpg image, but recipients receive mail with no image
I have tried with 5.2.1 version and last official 5.3.7.2 version

Regards
Comment 24 worms 2018-01-16 18:20:07 UTC
Created attachment 139133 [details]
test file with embeded image
Comment 25 Xisco Faulí 2018-01-17 09:11:34 UTC
Dear worms,
This bug has been in RESOLVED FIXED status for more than 6 months.
If the issue is still reproducible with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/, please report a new issue to https://bugs.documentfoundation.org/enter_bug.cgi providing, if     needed, the steps and documents to reproduce it.
Thanks for your understanding and collaboration.
Closing as RESOLVED FIXED