Bug 40147

Summary: [Canvas] Should pass canvas/philip/tests/toDataURL.jpeg.alpha.html
Product: WebKit Reporter: Matthew Delaney <mdelaney7>
Component: CanvasAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Trivial CC: adele, ddkilzer, jbauman, kangax, mdelaney7, noel.gordon, pkasting
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.6   
Bug Depends on:    
Bug Blocks: 46506, 48575, 49365, 83973    

Description Matthew Delaney 2010-06-03 16:22:26 PDT
For image types that do not support an alpha channel, the image must be composited onto a solid black background using the source-over operator, and the resulting image must be the one used to create the data: URL.

Need support to pass this test under CG.
Comment 1 noel gordon 2010-11-29 20:26:06 PST
Sought clarification on the this section of the <canvas> spec, bug filed.
  http://www.w3.org/Bugs/Public/show_bug.cgi?id=11431

issue #1 Safari and Chrome-Mac don't composite JPEG toDataURL onto black.
 Needs a fix near http://trac.webkit.org/browser/trunk/WebCore/platform/graphics/cg/ImageBufferCG.cpp?rev=70143#L354
 to specify the background color via dictionary key kCGImageDestinationBackgroundColor 

issue #2 philip test toDataURL.jpeg.alpha
 Is this test correct?  Should the alpha channel be ignored (philip test), or should the unpremultiplied RGB values
 be used instead (FireFox, Safari).  http://www.w3.org/Bugs/Public/show_bug.cgi?id=11431 to resolve.
Comment 2 Mihai Parparita 2010-12-09 18:24:29 PST
*** Bug 48580 has been marked as a duplicate of this bug. ***
Comment 3 noel gordon 2011-01-11 17:18:28 PST
issue #2 philip test toDataURL.jpeg.alpha
  resolved http://www.w3.org/Bugs/Public/show_bug.cgi?id=11431 WONTFIX, the
  toDataURL.jpeg.alpha test is correct wrt the <canvas> spec text.  Updated
  chrome linux/win32 to conform to the standard on bug 51237
Comment 4 Peter Kasting 2011-02-15 15:36:10 PST
This test no longer seems to be failing on Chromium Mac.  Removing it from test_expectations.txt.  Please reopen if this is incorrect.
Comment 5 noel gordon 2011-03-08 00:12:45 PST
LayoutTests/platform/mac-snowleopard/canvas/philip/tests/toDataURL.jpeg.alpha-expected.txt contains

  Failed assertion: got pixel [193,255,192,255] at (50,25), expected [63,127,63,255] +/- 8

That's the result I see on chrome-mac, safari-mac at ToT webkit when I run the test.  So still not
fixed, reopening this bug.
Comment 6 Peter Kasting 2011-03-08 10:58:39 PST
Sounds like someone committed "expected failure" results and we need to fix them.
Comment 7 John Bauman 2011-09-26 15:46:49 PDT
Seems to be fixed (with corrected expected result) in 68366.

*** This bug has been marked as a duplicate of bug 68366 ***
Comment 8 noel gordon 2011-09-26 19:21:46 PDT
For the record, dictionary key kCGImageDestinationBackgroundColor didn't help.