Last Comment Bug 749527 - When trying to 'copy' a picture directly from Firefox into a windows live chat box, it copys the image location (link) instead of the image.
: When trying to 'copy' a picture directly from Firefox into a windows live cha...
Status: RESOLVED FIXED
[qa+]
: regression
Product: Firefox
Classification: Client Software
Component: Untriaged (show other bugs)
: 12 Branch
: x86 Windows 7
: -- minor with 10 votes (vote)
: Firefox 15
Assigned To: Brian R. Bondy [:bbondy]
:
Mentors:
: 751019 757596 (view as bug list)
Depends on: 752505 796346
Blocks: 555176
  Show dependency treegraph
 
Reported: 2012-04-26 22:43 PDT by Daniel
Modified: 2012-10-02 16:23 PDT (History)
19 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
affected
+
verified
+
verified
verified


Attachments
Patch 1. (4.22 KB, patch)
2012-04-27 08:27 PDT, Brian R. Bondy [:bbondy]
no flags Details | Diff | Review
Patch v2. (1.14 KB, patch)
2012-04-28 07:27 PDT, Brian R. Bondy [:bbondy]
ehsan: review+
akeybl: approval‑mozilla‑aurora+
akeybl: approval‑mozilla‑beta+
Details | Diff | Review

Description Daniel 2012-04-26 22:43:47 PDT
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0
Build ID: 20120420145725

Steps to reproduce:

Attempted to share a picture to a windows live chat box ( right clicked and clicked 'copy'  then in the chat box, 'pasted')


Actual results:

When after clicking 'paste' in the chat box after right clicking copy on an image, it copied the image location and instead of showing the picture in the chat box.


Expected results:

It should have shown the image, rather than the image location. Normally to get the image location i would have to press 'copy image location'  but in this case, 'copy' was used, and it still gave me the image location without showing the picture. 

(please note that before the latest update, the image would show with 'copy' and 'paste'.)
Comment 1 Alice0775 White 2012-04-27 03:32:46 PDT
I also experienced in Wordpad.
This may be same root problem.

Step To Reproduce:
1. Open http://www.mozilla.org/en-US/projects/
2. Right click on Firefox Icon and exec"Copy Image"
3. Open Wordpad (wordpad.exe)
4. Execute Paste Ctrl+V

Actual results:
  URL is pasted

Expected results:
  Image is pasted

Regression window(m-c)
Works(image is pasteed):
http://hg.mozilla.org/mozilla-central/rev/200a8d1fb452
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0a1) Gecko/20120104 Firefox/12.0a1 ID:20120104031035
Fails(image url is pasteed):
http://hg.mozilla.org/mozilla-central/rev/0eec6ba6a87a
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0a1) Gecko/20120104 Firefox/12.0a1 ID:20120104042859
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=200a8d1fb452&tochange=0eec6ba6a87a

Regression window(m-i)
Works(image is pasteed):
http://hg.mozilla.org/integration/mozilla-inbound/rev/d26fad81f51a
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0a1) Gecko/20120103 Firefox/12.0a1 ID:20120103191255
Fails(image url is pasteed):
http://hg.mozilla.org/integration/mozilla-inbound/rev/06de54d7d7b4
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0a1) Gecko/20120103 Firefox/12.0a1 ID:20120103195355
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=d26fad81f51a&tochange=06de54d7d7b4
Suspected:
52d9d7bbfad1	Brian R. Bondy — Bug 555176 - Provide the same formats we do on drag when copying images. r=jimm
Comment 2 Brian R. Bondy [:bbondy] 2012-04-27 05:21:22 PDT
I think this happens because wordpad and msn messenger choose to use the wrong clipboard format.  They take the text format before the HTML format.  We could fix this by not providing the text format for that operation while still providing the HTML format that caused GMail to not accept images originally.
Comment 3 Brian R. Bondy [:bbondy] 2012-04-27 08:27:42 PDT
Created attachment 619045 [details] [diff] [review]
Patch 1.

So a bit of history on this bug:
- First we only supplied CF_DIB format so we didn't work with pasting to gmail
- Then I added in all image formats so the application could pick the most appropriate
- But now some applications choose the wrong format

So it is best to supply CF_DIB and CF_HTML on copy image operations. This is the same as Google Chrome and IE does.
Comment 4 :Ehsan Akhgari (busy, don't ask for review please) 2012-04-27 12:37:12 PDT
Comment on attachment 619045 [details] [diff] [review]
Patch 1.

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

Why are you not changing the behavior of cmd_copyImage, so that this fix gets applied everywhere that command is used?
Comment 5 Brian R. Bondy [:bbondy] 2012-04-28 05:58:32 PDT
> Why are you not changing the behavior of cmd_copyImage

Basically for the fear of having unknown side effects, such as in extensions.

This menu item didn't originally use cmd_copyImage, it used cmd_copyImageContents.
It was changed to cmd_copyImage when we wanted to support pasting to gmail.

Please let me know your preference:
- leave as is with the new command option that leaves the old ones unchanged (safest but leaves room for future errors)
- make cmd_copyImage and cmd_copyImageContents copying the image data + html format (safest for not breaking anything in extensions and for making sure they probably do the right thing)
- Remove cmd_copyImageContents and put the new functionality in cmd_copyImage
- Something else.


Thanks!
Comment 6 Brian R. Bondy [:bbondy] 2012-04-28 06:17:14 PDT
I'll go ahead with keeping the change from Bug 555176 to keep the menu item command change, while modifying what it means to cmd_copyImage.  This seems like the best option overall.
Comment 7 Brian R. Bondy [:bbondy] 2012-04-28 07:27:20 PDT
Created attachment 619295 [details] [diff] [review]
Patch v2.
Comment 8 BeachGuy SB 2012-04-28 10:01:35 PDT
This is also a problem in Corel PhotoPaint. If I right-click on an image in FireFox 12, and then choose 'New From Clipboard' in PhotoPaint, it copies the URL, not the image.
Comment 9 :Ehsan Akhgari (busy, don't ask for review please) 2012-04-28 14:03:43 PDT
Comment on attachment 619295 [details] [diff] [review]
Patch v2.

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

I think this makes sense.
Comment 10 Nick 2012-04-29 01:37:10 PDT
After this regression, "Copy Image" is functionally identical to "Copy Image Location".
Comment 11 Brian R. Bondy [:bbondy] 2012-04-29 04:42:25 PDT
Copy Image will add all of the clipboard formats, Copy Image Location will not.  So it depends on which application you are pasting to.  Some will for example choose the image data that is available on the clipboard.  In any case the patch that was recently r+ will be pushed soon and I will request to move it up in aurora and beta.
Comment 13 :Ehsan Akhgari (busy, don't ask for review please) 2012-05-02 21:08:27 PDT
https://hg.mozilla.org/mozilla-central/rev/83da4dad7aea
Comment 14 Artem Russakovskii 2012-05-02 21:18:56 PDT
Firefox 15?? Can it be pushed out any sooner?
Comment 15 ronfrancis 2012-05-03 04:56:23 PDT
Just a note that Copy and Paste is also broken in:
Corel PhotoPaint X4 (New from Clipboard)
CorelDraw X4 

And from what I've read on the forum:
Corel PhotoPaint X5 (current version. Don't know about CorelDraw X5.)
Adobe Illustrator CS3
InDesign
MS Windows Live Writer
One member said that it was broken with Word, but it works with my version which is 2002.
Comment 16 Brian R. Bondy [:bbondy] 2012-05-03 06:19:33 PDT
> Firefox 15?? Can it be pushed out any sooner?

I'll be requesting this for aurora and beta, but it just had to land in the nightly channel first.  So likely it will be included in v13.
Comment 17 Brian R. Bondy [:bbondy] 2012-05-03 06:21:12 PDT
Comment on attachment 619295 [details] [diff] [review]
Patch v2.

[Approval Request Comment]
Regression caused by (bug #):  555176 
User impact if declined: Pasting will not work as expected for images in some programs. 
Testing completed (on m-c, etc.): I've tried it on m-c.
Risk to taking this patch (and alternatives if risky): Very low.
String changes made by this patch: None.
Comment 18 Alex Keybl [:akeybl] 2012-05-03 09:02:18 PDT
Comment on attachment 619295 [details] [diff] [review]
Patch v2.

[Triage Comment]
Approved for Beta 13 and Aurora 14 given the low risk nature of the fix, and the undesirable user experience.
Comment 19 Artem Russakovskii 2012-05-03 09:05:30 PDT
Just FYI, it looks like FF Beta 13 as of yesterday included some changes related to this, and they introduced yet another variation (not sure if the patches here fix it) - copying an image in FF13B and pasting into something like Windows Live Writer copied it inline (as in, base64 encoded image, something like <img src="data:image/png;base64,...), which is better than copying an <img> tag and hotlinking but not as good as it used to be.
Comment 20 Brian R. Bondy [:bbondy] 2012-05-03 16:56:15 PDT
Re Command 19:

Tested with beta tip and it is working in wordpad, word2010, gmail
https://hg.mozilla.org/releases/mozilla-beta/rev/4ed2dffc85cd
Comment 21 Brian R. Bondy [:bbondy] 2012-05-03 17:08:49 PDT
Performed same test cases on aurora tip
http://hg.mozilla.org/releases/mozilla-aurora/rev/99726be033d0
Comment 22 ronfrancis 2012-05-03 18:56:38 PDT
Tested copy and paste with FF 2013.0b2 and Aurora 14.0a2
(I don't know if these are the latest builds.)

Corel Photopaint X4 still pastes the URL of the image when pressing "New from clipboard" and also pastes the URL into an existing document via "Paste" or CTRL_V hotkey.
CorelDraw X4 pastes the URL as well, but has the option to paste as a device independent bitmap in the menu. (Same functionality as Wordpad.)
Comment 23 Brian R. Bondy [:bbondy] 2012-05-03 18:57:53 PDT
You will have to wait until the next build on these channels, this just landed.
Comment 24 ronfrancis 2012-05-06 03:00:40 PDT
Thanks Brian.
Confirming that Copy and Paste functionality has been restored for both Corel X4 applications in Aurora 14.0a2 (2012-05-05).
I haven't tested Firefox 13 beta as the "Check for Update" function still says the version I tested previously is the latest.
Much appreciated.
Comment 25 Philip Chee 2012-05-08 04:26:23 PDT
This seems to have caused a regression in SeaMonkey. Not sure how to resolve this since this is wanted behaviour in Firefox.
Comment 26 Brian R. Bondy [:bbondy] 2012-05-08 06:11:57 PDT
Indicated how you should fix that in SeaMonkey in that bug.  This fix should stay the same here.
Comment 27 Ioana (away) 2012-05-11 02:33:50 PDT
Verified as fixed on:
Mozilla/5.0 (Windows NT 6.1; rv:13.0) Gecko/20100101 Firefox/13.0
(buildID: 20120509070325)

The image is copied and pasted without any issues in Windows Live Writer and Mail, Wordpad, Gmail.
Comment 28 Matthias Versen [:Matti] 2012-05-23 07:55:30 PDT
*** Bug 757596 has been marked as a duplicate of this bug. ***
Comment 29 r.brackhan 2012-05-29 16:16:14 PDT
Please note that this is not program specific. The is issue is from Firefox(v12) to the clipboard that is the problem.  Try to copy any image and go Run "clipbrd" you will only see the link, so the problem has nothing to do with corel, office, or any other program.
Comment 30 Brian R. Bondy [:bbondy] 2012-05-29 16:23:40 PDT
This is already fixed and verified in v13.  The regression was that Firefox provides an extra data format and those programs choose to use a format that you didn't expect.  To solve this problem we are providing less choices.
Comment 31 Philip Chee 2012-05-29 20:55:29 PDT
> we are providing less choices
"fewer choices" or "less choice"
Comment 32 Ioana (away) 2012-06-06 06:28:25 PDT
Verified as fixed on:
Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0 (20120605113340)

The image is copied to the clipboard when selecting "Copy Image" from Firefox.
Comment 33 Loic 2012-06-06 07:15:29 PDT
For the record: https://support.mozilla.org/en-US/questions/926093 (especially the 3rd page with last messages)
Comment 34 Alice0775 White 2012-06-15 08:49:55 PDT
*** Bug 751019 has been marked as a duplicate of this bug. ***
Comment 35 Ioana (away) 2012-07-18 09:46:56 PDT
Also verified on:
Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20100101 Firefox/15.0

Verified with some of the links on the support page from the above comment. All the images were copied to the clipboard when clicking "Copy Image" in Firefox.
Comment 36 Bill Dee 2012-10-02 14:39:45 PDT
Imo, you are attempting to fix bugs in external programs by fixing a non-bug in Firefox.

It is the job of the program doing the paste to choose which part of the copy-paste buffer to use for the paste. If they do not do it correctly, it is THEIR fault and THEIR problem, not Firefox's.

-----

"Copy Image" should copy ALL (3) 'versions' of an image, not just the image.

"Copy Image Location" should ONLY copy the text URL address or location.
"Copy Image Content" should ONLY copy the image.

There should also be a "Copy Image HTML" command.

-----

By "fixing" this, you have actually broken it, and reverted to the incorrect functionality that was fixed before in Bug 518249.

At the very least, although imo it is not correct, if you were to do as was done in this Bug 'fix', there should have been a new command added called "Copy Image All" to replace the reverted functionality. (however, that is confusing imo because it really should be as stated above)
Comment 37 :Ehsan Akhgari (busy, don't ask for review please) 2012-10-02 14:46:21 PDT
Bug 518249 is a GTK specific bug as far as I can tell.

Do you know of any other programs that would copy textual data when you invoke a copy image command?
Comment 38 Bill Dee 2012-10-02 15:20:40 PDT
Off hand, I can't think of any. However, I was sure there were some, if not many.

However, perhaps the "standard" has changed. Back when I was doing Windows programming, unless I am not remembering correctly, I thought part of the point of supporting multiple format storage ability in the (Windows) clipboard was to support the concept of allowing applications to be able to copy and paste whatever native format(s) was/were supported by the app, and/or might be supported by other apps.

So, for example, a text editor would only copy and paste text, or paste the text portion of the clipboard and ignore the rest. An graphics program would act similarly with images, or, for example, if you were in "text creation mode", use the text portion. A more multi-media app would perhaps choose a most-used format, with some way to support other formats, if the app supported them. ('word processors', etc.)

Although the following is from the eVile Wikipedia, I thought this was still the standard:

http://en.wikipedia.org/wiki/Clipboard_%28computing%29

''When data is added to the clipboard by an application, it typically makes it available in as many different data formats as it can. This includes both native and simpler (or more common) formats that would have a higher chance of being recognized by a wide variety of applications. Thus, when data is pasted into another application, the format that is closest to that application's native format can be used, preserving as much of the original data as possible. In Windows in particular, the internal clipboard functionality of the operating system will automatically translate data from known advanced formats to simpler formats (such as RTF to plain text, or Unicode to ANSI Text), increasing the likelihood that any given application can interpret some form of the original data.''

>>>>>

If the changes made by the bug fix stand, what is the possibility of getting the 'cmd_copyImageAll' functionality added? (and when?)
Comment 39 :Ehsan Akhgari (busy, don't ask for review please) 2012-10-02 15:47:00 PDT
(In reply to OMR from comment #38)
> Off hand, I can't think of any. However, I was sure there were some, if not
> many.
> 
> However, perhaps the "standard" has changed. Back when I was doing Windows
> programming, unless I am not remembering correctly, I thought part of the
> point of supporting multiple format storage ability in the (Windows)
> clipboard was to support the concept of allowing applications to be able to
> copy and paste whatever native format(s) was/were supported by the app,
> and/or might be supported by other apps.
> 
> So, for example, a text editor would only copy and paste text, or paste the
> text portion of the clipboard and ignore the rest. An graphics program would
> act similarly with images, or, for example, if you were in "text creation
> mode", use the text portion. A more multi-media app would perhaps choose a
> most-used format, with some way to support other formats, if the app
> supported them. ('word processors', etc.)
> 
> Although the following is from the eVile Wikipedia, I thought this was still
> the standard:
> 
> http://en.wikipedia.org/wiki/Clipboard_%28computing%29
> 
> ''When data is added to the clipboard by an application, it typically makes
> it available in as many different data formats as it can. This includes both
> native and simpler (or more common) formats that would have a higher chance
> of being recognized by a wide variety of applications. Thus, when data is
> pasted into another application, the format that is closest to that
> application's native format can be used, preserving as much of the original
> data as possible. In Windows in particular, the internal clipboard
> functionality of the operating system will automatically translate data from
> known advanced formats to simpler formats (such as RTF to plain text, or
> Unicode to ANSI Text), increasing the likelihood that any given application
> can interpret some form of the original data.''

Well the reality is that many Windows programs do not really expect image data to also accompany textual data, which is what this bug is about.  It's a sucky situation indeed.

> If the changes made by the bug fix stand, what is the possibility of getting
> the 'cmd_copyImageAll' functionality added? (and when?)

We can do that in bug 796346.  I'll morph it.
Comment 40 ronfrancis 2012-10-02 16:23:03 PDT
@OMR
According to comment #29 above;
[quote]
Please note that this is not program specific. The is issue is from Firefox(v12) to the clipboard that is the problem.  Try to copy any image and go Run "clipbrd" you will only see the link, so the problem has nothing to do with corel, office, or any other program.
[/quote]
I imagine that the poster was using Windows XP.
I never checked this with Vista or 7.

Note You need to log in before you can comment on or make changes to this bug.