Closed Bug 1527235 Opened 1 year ago Closed 1 year ago

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

Categories

(Core :: Widget: Win32, defect, P3)

65 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla67
Tracking Status
firefox-esr60 --- unaffected
firefox65 --- wontfix
firefox66 --- fixed
firefox67 --- fixed

People

(Reporter: bugzilla, Assigned: aosmond)

References

Details

(Keywords: regression, testcase)

Attachments

(2 files)

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.

Attached image testcase.png

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

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

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

Assignee: nobody → aosmond
Priority: -- → P3

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)

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

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
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67

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

Name Firefox
Version 67.0a1
Build ID 20190215162352

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

(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

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+

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.