Images copied to clipboard no longer contain transparency/alpha channel.

VERIFIED FIXED in Firefox 66

Status

()

defect
P3
normal
VERIFIED FIXED
4 months ago
3 months ago

People

(Reporter: bugzilla, Assigned: aosmond)

Tracking

({regression, testcase})

65 Branch
mozilla67
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox-esr60 unaffected, firefox65 wontfix, firefox66 fixed, firefox67 fixed)

Details

Attachments

(2 attachments)

Reporter

Description

4 months ago

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0

Steps to reproduce:

From this Reddit thread: https://www.reddit.com/r/firefox/comments/apl1he/firefox_v65_images_copied_to_clipboard_no_longer/ when viewing the image https://www.mariowiki.com/images/9/9c/Goomba_-_MarioPartyStarRush.png and then right-clicking on image and Copy Image and then pasting into Gimp for example, the alpha/transparency channel is lost.

I ran a moz-regression with the following results:

Using url: https://hg.mozilla.org/integration/mozilla-inbound/json-pushes?changeset=6c28ad7f98a7629f5a1b2f123aaad66f1f6233f0&full=1
2019-02-12T00:41:06: DEBUG : Found commit message:
Bug 1501482. r=tnikkel

Differential Revision: https://phabricator.services.mozilla.com/D11897
pushlog_url: https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=a424be1d8a667c799cbe4f337626591b1087f14d&tochange=6c28ad7f98a7629f5a1b2f123aaad66f1f6233f0
repo_name: mozilla-inbound

I do not have access to bug 1501482 to see what it is.

Actual results:

Alpha/Transparency channel is lost during copy operation.

Expected results:

It should have retained the alpha channel information.

Comment 1

4 months ago
Posted image testcase.png

Comment 2

4 months ago
regression-window

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
20190211215545

Thank you for the report. I'm surprised to see this has ever worked in GIMP when it doesn't work in other applications and bug 460969 has been open since 2008.

Narrow push log:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=ae143b5f65fb4a80538e765541de7f999c909233&tochange=6c28ad7f98a7629f5a1b2f123aaad66f1f6233f0

Status: UNCONFIRMED → NEW
Has Regression Range: --- → yes
Has STR: --- → yes
Ever confirmed: true
Flags: needinfo?(aosmond)
Keywords: regression, testcase
See Also: → 460969
Reporter

Comment 3

4 months ago

Yeah, I couldn't get Irfanview to see the Alpha no matter what I used (even copying from GIMP). Apparently GIMP can see something in the clipboard that Irfanview doesn't.

Blocks: 1501482
Component: Untriaged → Widget: Win32
Product: Firefox → Core

Andrew, can you take a look here since you worked on bug 1501482?

Assignee

Comment 5

4 months ago

Reviewing the code, I suspect we need to add the bpp option for the BMP encoder to ensure the alpha channel gets added.

Assignee

Updated

4 months ago
Assignee: nobody → aosmond
Priority: -- → P3
Assignee

Comment 6

4 months ago

I tried without the fix, missing the alpha channel, with the fix, has the alpha channel:

try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=7feffb54ee92e477b6d18dbe7ef245c00eed3895&selectedJob=228452811

Flags: needinfo?(aosmond)
Assignee

Comment 7

4 months ago

In order to get the alpha channel when encoding BMP images from a
surface, we need to supply bmp=32 in the encoder options.

Comment 8

4 months ago
Pushed by aosmond@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/80e1aa2d7459
Fix how the alpha channel was missing from pasted clipboard images. r=tnikkel

Comment 9

4 months ago
bugherder
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Reporter

Comment 10

4 months ago

Has this been pushed to the latest Nightly yet? Still not working there.

Name Firefox
Version 67.0a1
Build ID 20190215162352

Reporter

Comment 11

4 months ago

Ok, Nightly just updated again and now it works, at least as far as Gimp seeing the Alpha channel.

Name Firefox
Version 67.0a1
Build ID 20190215184035

Assignee

Comment 12

4 months ago

(In reply to MarkRH from comment #11)

Ok, Nightly just updated again and now it works, at least as far as Gimp seeing the Alpha channel.

Name Firefox
Version 67.0a1
Build ID 20190215184035

Thanks for confirming. I'll request uplift.

Status: RESOLVED → VERIFIED
Assignee

Comment 13

4 months ago

Comment on attachment 9043984 [details]
Bug 1527235 - Fix how the alpha channel was missing from pasted clipboard images.

Beta/Release Uplift Approval Request

Feature/Bug causing the regression

Bug 1501482

User impact if declined

Images with transparency that are pasted from the clipboard on Windows will lose it.

Is this code covered by automated tests?

Yes

Has the fix been verified in Nightly?

Yes

Needs manual test from QE?

No

If yes, steps to reproduce

List of other uplifts needed

None

Risk to taking this patch

Low

Why is the change risky/not risky? (and alternatives if risky)

I only changed the configuration of the BMP encoder to output BMPs in a form that supports alpha instead of the default which is without. The encoder itself has long supported encoding with/without alpha.

String changes made/needed

None

Attachment #9043984 - Flags: approval-mozilla-beta?

Comment on attachment 9043984 [details]
Bug 1527235 - Fix how the alpha channel was missing from pasted clipboard images.

Fix for recent regression (from 65), verified in Nightly.
OK to uplift for beta 8.

Attachment #9043984 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Reporter

Comment 16

4 months ago

Just wanted to confirm that it now works for me in 66 beta 9 (did not in beta 8).

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