getImageData returns incorrect pixel information
Categories
(Core :: Graphics: Canvas2D, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr68 | --- | unaffected |
| firefox76 | --- | unaffected |
| firefox77 | --- | fixed |
| firefox78 | --- | fixed |
People
(Reporter: lavrton, Assigned: aosmond)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file, 1 obsolete file)
|
47 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-release+
|
Details | Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36
Steps to reproduce:
Try to getImageData of the red rectangle.
const ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgb(255, 0, 0)';
ctx.fillRect(0, 0, 100, 100);
const data = ctx.getImageData(50, 50, 1, 1).data;
console.log(data[0], data[1], data[2]);
https://jsbin.com/jaqaqeboro/edit?js,console,output
Actual results:
getImageData returns incorrect pixel information. For me, it was (252, 13, 27).
Expected results:
The expected result is (255, 0, 0).
The same happening with any color I tried.
Online demo: https://jsbin.com/jaqaqeboro/edit?js,console,output
Comment 1•5 years ago
|
||
Hi Anton,
I was able to reproduce the issue on Firefox Nightly 78.0a1 and Firefox Beta 77.0b9 however Firefox 76.0.1 returns (255.0.0) correctly.
I've ran mozregression and got the following pushlog:
Bug 455077 seems to have introduced this issue.
Andrew, could you take a look?
Thank you for reporting!
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Andrew, could that be the same problem as I noticed with the drawSnapshot() API over on bug 1631089?
Updated•5 years ago
|
Updated•5 years ago
|
| Assignee | ||
Comment 3•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 5•5 years ago
|
||
Backed out as requested: https://hg.mozilla.org/integration/autoland/rev/3fff015ec1c1314529cfaeb86fab0f86c7030657
| Assignee | ||
Comment 7•5 years ago
|
||
Comment on attachment 9151777 [details]
Bug 1639574 - Disable color management for CSS due to issues with canvas.
Beta/Release Uplift Approval Request
- User impact if declined: Canvas color management will be broken.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- 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): This simply reverts our behaviour to what it was in the previous release. The pref is used in very few places, and the branches done as a result are very small (massages CSS colors to be more correct for display). There is very good test coverage on this.
- String changes made/needed:
| Assignee | ||
Updated•5 years ago
|
Comment 8•5 years ago
|
||
| bugherder | ||
Comment 9•5 years ago
|
||
I assume we should reopen this bug and should keep it blocking bug 455077? Or where should the remaining work for canvas be tracked?
Comment 10•5 years ago
|
||
Comment on attachment 9151777 [details]
Bug 1639574 - Disable color management for CSS due to issues with canvas.
Driver for RC2, approved for uplift.
Comment 11•5 years ago
|
||
| bugherder uplift | ||
| Assignee | ||
Comment 12•5 years ago
|
||
I filed bug 1641229 to track the canvas issues.
| Assignee | ||
Comment 13•5 years ago
|
||
Updated•5 years ago
|
Comment 14•5 years ago
|
||
| bugherder uplift | ||
Description
•