Closed Bug 1814531 Opened 1 year ago Closed 7 months ago

Copy-paste of images on macOS converts image data to TIFF.

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, defect)

Firefox 109
defect

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: jfrisby, Assigned: jjaschke)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/109.0

Steps to reproduce:

Right click an image of any sort (PNG, JPG, WebP, etc).

Select "Copy Image".

Go into Messages.app.

Paste the image into a discussion.

Hit send.

Actual results:

The image will be pasted as an uncompressed TIFF file.

This means that the recipient often won't see the image unless they click it to get a QuickLook view of it -- presumably because of the immense size of the resulting TIFF.

In one case, I have a JPG with resolution 1080x1440 (279KB), and the resulting TIFF has resolution 1536x2048, includes an alpha channel, and is 12.6MB.

Expected results:

Image data should be pasted in its preexisting format (as happens with Safari and Chrome and as appears to happen when pasting to other apps such as Signal).

Component: Untriaged → DOM: Copy & Paste and Drag & Drop
Product: Firefox → Core

Sounds like a similar issue to bug 1769201. Edgar, do you follow Mirko's work? If yes, do you know something about these kind of issues?

Flags: needinfo?(echen)

(In reply to Masayuki Nakano [:masayuki] (he/him)(JST, +0900) from comment #1)

Sounds like a similar issue to bug 1769201.

No, I don't think this is something related to bug 1769201. This more like an issue with the image data we put into system clipboard.
Maybe something went wrong around https://searchfox.org/mozilla-central/rev/3ede9deb876ad5d6389cb51b371d4a4c8d788deb/widget/cocoa/nsClipboard.mm#594-614.

Flags: needinfo?(echen)
Severity: -- → S3
See Also: → 1396587

Any likelihood of this being addressed? It's become a practical problem for me: People I communicate with regularly have started asking me not to send images because they don't like having to download 10+MB every time.

This continues to happen on Firefox 118.0.1. Any chance of this ever being addressed, or am I just going to need to switch back to Chrome?

It could also be related to source image format, could you share the image link, so we could also try it out? Thanks!

Flags: needinfo?(jfrisby)

Our macOS widget code always puts TIFF data onto the clipboard: https://searchfox.org/mozilla-central/rev/2f5b657343ce18e4b8a56417f707022550f4b742/widget/cocoa/nsClipboard.mm#659-681

This could probably be fixed by using NSPasteboardTypePNG instead.

Edgar,

I can confirm that it happens regardless of what type of source image. Or, at least, I'm not aware of any image where it didn't happen.

Flags: needinfo?(jfrisby)

Previously, images of any kind were converted to TIFF format when copy/pasted into other apps.
Especially with the MacOS Messages app this led to a bad user experience
because the Messages app did not convert the TIFF data to some other (more compressed) image format.

With this patch the image is also added to the pasteboard in PNG format.
This allows the pasting app to choose a more compressed version of the image.

Assignee: nobody → jjaschke
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by jjaschke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/96b71d7bceb2
Add png to pasteboard on MacOS. r=edgar,mac-reviewers,spohl
Blocks: 1615397
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
QA Whiteboard: [qa-120b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: