New issue
Advanced search Search tips

Issue 698487 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 437662



Sign in to add a comment

Add a LayoutTest for canvas.drawImage using an APNG image

Project Member Reported by noel@chromium.org, Mar 4 2017

Issue description

<canvas>.drawImage() should draw the initial frame (or poster frame) of an animated image, per the spec.

Add a test case using an animated PNG image (APNG). There is a similar test for a GIF, but not for WEBP.  Write the test that covers them all.
 

Comment 1 by noel@chromium.org, Mar 4 2017

I created a GIF image that has a single frame with color at frame 0.  THis is followed by "count-down" image frames, all of which have no color (they are black, white, and gray only, viz., they have no color).  Basic idea attached ...
count-down-color-test-image-frames.png
176 KB View Download

Comment 2 by noel@chromium.org, Mar 4 2017

Created a GIF image using the above idea of width: 315px, height: 236px, and 74 frames in total, where only frame 0 has color. I converted the GIF to APNG, and WEBP animated (these test resources attached).

count-down-color-test.gif
213 KB View Download
count-down-color-test.png
467 KB View Download
count-down-color-test.webp
261 KB View Download

Comment 3 by noel@chromium.org, Mar 4 2017

Status: Started (was: Assigned)
Wrote a layout test: see https://codereview.chromium.org/2728193004
Project Member

Comment 4 by bugdroid1@chromium.org, Mar 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/427dfb952160b6402103f5db70a0e3dc6c5c500d

commit 427dfb952160b6402103f5db70a0e3dc6c5c500d
Author: noel <noel@chromium.org>
Date: Sat Mar 11 03:40:37 2017

Add canvas.drawImage test for animated image types

canvas.drawImage() for animated images should draw the initial frame
(or poster frame) of the animated image, per spec. Add a layout test
that covers GIF, APNG, and WEBP animated images, ensure the test can
also be run manually in any browser [1].

[1] Manual testing: the test uses <canvas> to read the image pixels,
so serve the test page from a local web server (Chrome's same origin
policy prevents the pixel read otherwise). If you have python handy,
a script can be used:

#!/bin/bash -
# Simple python server: run in the local directory you want to serve
# then load http://localhost:8888 in your browser.
python -m SimpleHTTPServer 8888

BUG= 698487 

Review-Url: https://codereview.chromium.org/2728193004
Cr-Commit-Position: refs/heads/master@{#456273}

[add] https://crrev.com/427dfb952160b6402103f5db70a0e3dc6c5c500d/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-animated-images-expected.txt
[add] https://crrev.com/427dfb952160b6402103f5db70a0e3dc6c5c500d/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-animated-images.html
[add] https://crrev.com/427dfb952160b6402103f5db70a0e3dc6c5c500d/third_party/WebKit/LayoutTests/images/resources/count-down-color-test.gif
[add] https://crrev.com/427dfb952160b6402103f5db70a0e3dc6c5c500d/third_party/WebKit/LayoutTests/images/resources/count-down-color-test.png
[add] https://crrev.com/427dfb952160b6402103f5db70a0e3dc6c5c500d/third_party/WebKit/LayoutTests/images/resources/count-down-color-test.webp

Blocking: 437662
Status: Fixed (was: Started)

Comment 6 Deleted

Sign in to add a comment