LibreOffice/MS Office integration: Convert image data referencing MIME parts via imap/mailbox URLs to data URLs (for viewed messages)

RESOLVED FIXED in Thunderbird 52.0

Status

RESOLVED FIXED
2 years ago
10 months ago

People

(Reporter: jorgk, Assigned: mkmelin)

Tracking

(Blocks: 1 bug)

Trunk
Thunderbird 52.0
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

2 years ago
Since we're talking to TDF/LibreOffice as a new home for Thunderbird, let's keep everybody happy by improving the interoperability.

Currently pictures copied from TB to *Office end up as ugly placeholders, in MS Office pasting invisibly and in LibreOffice showing some funny imap/mailbox URL.

We can improve this by placing the images as data URLs onto the clipboard.
(Assignee)

Comment 1

2 years ago
Created attachment 8809368 [details] [diff] [review]
bug1315480_copy_data_urls.patch

Covers the copy/drag of a part of content + the context menu "Copy Image" case.
Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
Attachment #8809368 - Flags: review?(jorgk)
(Reporter)

Comment 2

2 years ago
Comment on attachment 8809368 [details] [diff] [review]
bug1315480_copy_data_urls.patch

Review of attachment 8809368 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good. I haven't tested it yet. I'll get to this in the next 24 hours.

Nice effort that will keep our *Office users happy ;-)

::: mail/base/content/mailWindow.js
@@ +68,5 @@
> +  let sourceDoc = getBrowser().contentDocument;
> +  let selection = sourceDoc.getSelection();
> +  let draggedImg = null; // Will be set to the img for single image drag.
> +  for (let img of sourceDoc.images) {
> +    if (/^(http|data):/.test(img.src)) {

Further down you do:
if (/^(https?|data):/i.test(img.src)) {
(Reporter)

Comment 3

2 years ago
Comment on attachment 8809368 [details] [diff] [review]
bug1315480_copy_data_urls.patch

Ain't workin' ;-(

Test case: HTML message with two embedded images. Select all in the original message, drag onto a composition. Result: Only one image dragged over.
Attachment #8809368 - Flags: review?(jorgk)
(Assignee)

Comment 4

2 years ago
Created attachment 8809525 [details] [diff] [review]
bug1315480_copy_data_urls.patch

Now all the dragged material should be copied
Attachment #8809368 - Attachment is obsolete: true
Attachment #8809525 - Flags: review?(jorgk)
(Reporter)

Comment 5

2 years ago
Sorry, now the test case from comment #3 works, but the single image drag doesn't. It inserts a imap: URL.
(Assignee)

Comment 6

2 years ago
Created attachment 8809538 [details] [diff] [review]
bug1315480_copy_data_urls.patch

Third time's a charm?
Attachment #8809538 - Flags: review?(jorgk)
(Assignee)

Updated

2 years ago
Attachment #8809525 - Attachment is obsolete: true
Attachment #8809525 - Flags: review?(jorgk)
(Reporter)

Comment 7

2 years ago
Comment on attachment 8809538 [details] [diff] [review]
bug1315480_copy_data_urls.patch

(In reply to Magnus Melin from comment #6)
> Third time's a charm?

Yep. r=jorgk.

This will keep our *Office friends happy.
Attachment #8809538 - Flags: review?(jorgk) → review+
(Assignee)

Comment 8

2 years ago
https://hg.mozilla.org/comm-central/rev/c8666b9f31bc868950a698b2cc28896d45a09030 -> FIXED
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 52.0
(Reporter)

Updated

2 years ago
Depends on: 1317031
(Reporter)

Comment 9

2 years ago
I noticed that this doesn't work when dragging embedded images from other compose windows.

Or would you like a new bug for that?
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Comment 10

2 years ago
Yes, let's limit this bug to viewed messages.
Status: REOPENED → RESOLVED
Last Resolved: 2 years ago2 years ago
Resolution: --- → FIXED
Summary: LibreOffice/MS Office integration: Convert image data referencing MIME parts via imap/mailbox URLs to data URLs → LibreOffice/MS Office integration: Convert image data referencing MIME parts via imap/mailbox URLs to data URLs (for viewed messages)
(Reporter)

Updated

2 years ago
Blocks: 1317049
(Reporter)

Comment 11

2 years ago
OK, to be continued in bug 1317049.
(Reporter)

Comment 12

2 years ago
You might want to port this to SM.
Flags: needinfo?(rsx11m.pub)
(Reporter)

Updated

2 years ago
Blocks: 1322155
(Reporter)

Updated

2 years ago
Depends on: 1354452
(Reporter)

Updated

10 months ago
Flags: needinfo?(rsx11m.pub)
You need to log in before you can comment on or make changes to this bug.