Drag and drop of images from Firefox to Thunderbird as attachment results in BMP conversion, fails when sending
Categories
(Core :: Widget: Win32, defect, P5)
Tracking
()
People
(Reporter: rsx11m.pub, Unassigned, Mentored)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
(Keywords: good-first-bug, Whiteboard: [lang=c++][privacy][tpi:+])
Attachments
(2 files, 3 obsolete files)
(deleted),
patch
|
jimm
:
review-
|
Details | Diff | Splinter Review |
(deleted),
text/x-phabricator-request
|
Details |
Updated•13 years ago
|
Comment 3•13 years ago
|
||
Comment 4•12 years ago
|
||
Comment 6•12 years ago
|
||
Comment 7•12 years ago
|
||
Comment 9•12 years ago
|
||
Reporter | ||
Comment 10•12 years ago
|
||
Reporter | ||
Comment 11•12 years ago
|
||
Comment 12•11 years ago
|
||
Updated•11 years ago
|
Reporter | ||
Comment 13•11 years ago
|
||
Comment 14•11 years ago
|
||
Updated•10 years ago
|
Comment 15•10 years ago
|
||
Comment 16•10 years ago
|
||
Comment 17•10 years ago
|
||
Comment 18•10 years ago
|
||
Comment 19•9 years ago
|
||
Comment 20•9 years ago
|
||
Comment 21•9 years ago
|
||
Reporter | ||
Comment 22•9 years ago
|
||
Comment 23•9 years ago
|
||
Reporter | ||
Comment 25•9 years ago
|
||
Updated•8 years ago
|
Comment 26•8 years ago
|
||
Comment 27•8 years ago
|
||
Comment 28•8 years ago
|
||
Comment 29•8 years ago
|
||
Comment 30•8 years ago
|
||
Comment 31•8 years ago
|
||
Comment 32•8 years ago
|
||
Comment 33•8 years ago
|
||
Comment 34•8 years ago
|
||
Comment 35•8 years ago
|
||
Comment 36•8 years ago
|
||
Comment 37•8 years ago
|
||
Comment 38•8 years ago
|
||
Comment 39•8 years ago
|
||
Comment 40•8 years ago
|
||
Comment 41•8 years ago
|
||
Comment 42•8 years ago
|
||
Comment 43•8 years ago
|
||
Comment 44•8 years ago
|
||
Updated•8 years ago
|
Comment 45•8 years ago
|
||
Comment 46•8 years ago
|
||
Comment 47•8 years ago
|
||
Comment 48•8 years ago
|
||
Comment 49•8 years ago
|
||
Updated•8 years ago
|
Comment 50•8 years ago
|
||
Updated•8 years ago
|
Comment 51•8 years ago
|
||
Comment 52•8 years ago
|
||
Comment 53•8 years ago
|
||
Comment 54•7 years ago
|
||
Comment 55•7 years ago
|
||
Updated•7 years ago
|
Updated•5 years ago
|
Comment 57•4 years ago
|
||
This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.
Comment 58•3 years ago
|
||
Note that copying e.g. https://bug-attachments.documentfoundation.org/attachment.cgi?id=178031 to Windows clipboard uses a temporary JPG file, and dragging it to another application uses a BMP; both they use CF_HDROP clipboard format for the transfer that refers to the temporary file, so there seems to be different code paths here that account for this unfortunate difference.
The actual creation of the temporary BMP in the filesystem happens inside IDataObject::GetData call, with FORMATETC referring to CF_HDROP. So there should be something in the DnD data OLE object implementation if FF that is responsible for that.
The patches from jbonnafo looked to touch related area (even though they were adding unneeded breaks in switch after return statement, and so on).
Comment 59•3 years ago
|
||
nsDataObj::GetFile, that gets called for CF_HDROP, iterates through mDataFlavors; and it stops on whatever one of the three types it finds first:
- application/x-moz-nativeimage -> DropImage
- application/x-moz-file -> DropFile
- application/x-moz-file-promise -> DropTempFile
In case of copy to clipboard, mDataFlavors has:
- text/html
- text/html
- text/_moz_htmlinfo
- text/_moz_htmlcontext
- application/x-moz-file-promise-url
- application/x-moz-file-promise-dest-filename
- application/x-moz-file-promise
- application/x-moz-file-promise
- application/x-moz-nativeimage
- application/x-moz-nativeimage
- application/x-moz-nativeimage
So in this case, DropTempFile gets called for item 6.
In case of drag-n-drop, it has:
- text/x-moz-url
- text/x-moz-url
- text/x-moz-url
- text/x-moz-url
- text/x-moz-url
- text/x-moz-url
- text/x-moz-url-data
- text/x-moz-url-desc
- application/x-moz-custom-clipdata
- text/_moz_htmlcontext
- text/_moz_htmlinfo
- text/html
- text/html
- text/unicode
- text/plain
- application/x-moz-nativeimage
- application/x-moz-nativeimage
- application/x-moz-nativeimage
- application/x-moz-file-promise
- application/x-moz-file-promise
- application/x-moz-file-promise-url
- application/x-moz-file-promise-dest-filename
and DropImage gets called for item 15.
A simple fix could be converting the single loop in nsDataObj::GetFile into three separate loops, first one checking for x-moz-file-promise, then for the rest two. That is in case the calls to m_enumFE methods actually do something (I do not see what can they be useful for, actually, but I digress), otherwise one loop could store less preferred index, and keep searching until it finished the loop or found most preferred case, then perform the call corresponding to the found most preferred case.
But I do not know if x-moz-file-promise is actually preferable over x-moz-nativeimage. Is the elements order in mDataFlavors important? Why are there duplicates?
Comment 60•3 years ago
|
||
DropImage changes image type to BMP unconditionally, which makes
it undesirable for drag-and-drop operations. Only call it when
the flavor list doesn't have the other two options.
Also remove calls to m_enumFE->Reset and m_enumFE->Next, since
their results are unused in the processing here.
Updated•3 years ago
|
Comment 61•3 years ago
|
||
This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.
Updated•3 years ago
|
Comment 62•2 years ago
|
||
This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.
Comment 63•2 years ago
|
||
N-i for the review of the attached patch.
Comment 64•2 years ago
|
||
The patch itself looks pretty good but we want to settle bug 1765222 first as this makes assumptions that it would guarantee.
Comment 65•2 years ago
|
||
(In reply to David Parks [:handyman] from comment #64)
The patch itself looks pretty good but we want to settle bug 1765222 first as this makes assumptions that it would guarantee.
You mean the proposed fix for this bug 557708 relies on bug 1765222 being fixed. It's obvious when you think about it; I'm just clarifying what you mean by "this".
Comment 66•2 years ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Comment 67•2 years ago
|
||
Hello, is this bug still available? If it is, I will look into it, and once I grasp what's involved, I'll ask it to be assigned to me.
Comment 68•2 years ago
|
||
Yes this annoying bug is still available on Windows!
Comment hidden (off-topic) |
Comment hidden (off-topic) |
Description
•