Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 1 user
Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux, Android
Pri: 3
Type: Bug



Sign in to add a comment
ShapeDetection detect() doesn't support canvas object
Project Member Reported by paulkin...@google.com, Dec 3 2016 Back to list
Demo: https://output.jsbin.com/xovuset

Passing in a canvas into `detect` causes a NotFoundError: Unsupported source.

Expected result: not throwing the error (as per spec) :)

 
Cc: xianglu@chromium.org
Labels: ShapeDetection
Project Member Comment 2 by bugdroid1@chromium.org, Dec 8 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7d0018f762087ab6624de7dd09cf15207dda57c6

commit 7d0018f762087ab6624de7dd09cf15207dda57c6
Author: mcasas <mcasas@chromium.org>
Date: Thu Dec 08 02:12:42 2016

ShapeDetection: add support for all CanvasImageSource input types

Currently ShapeDetector::detectFacesOn{ImageBitmap,Videoelement}()
extract the pixels out of the corresponding object; I haven't noticed
that CanvasImageSource::getSourceImageForCanvas() is a virtual method,
implemented for each CanvasImageSource, doing exactly what I needed,
which is extracting an WTF::Image.

getSourceImageForCanvas() implementations have the same checks
being performed on ToT now, so swapping one for the other is
not reducing the early-bail outs.

So, this CL factors out the code to use getSourceImageForCanvas(),
making the Shape Detection detect() work for all these different
input types, and adds LayoutTests for them.

BUG= 670977 , 659138

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

[add] https://crrev.com/7d0018f762087ab6624de7dd09cf15207dda57c6/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLCanvasElement.html
[modify] https://crrev.com/7d0018f762087ab6624de7dd09cf15207dda57c6/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLImageElement.html
[modify] https://crrev.com/7d0018f762087ab6624de7dd09cf15207dda57c6/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLVideoElement.html
[modify] https://crrev.com/7d0018f762087ab6624de7dd09cf15207dda57c6/third_party/WebKit/LayoutTests/shapedetection/detection-ImageBitmap.html
[modify] https://crrev.com/7d0018f762087ab6624de7dd09cf15207dda57c6/third_party/WebKit/LayoutTests/shapedetection/detection-options.html
[modify] https://crrev.com/7d0018f762087ab6624de7dd09cf15207dda57c6/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp
[modify] https://crrev.com/7d0018f762087ab6624de7dd09cf15207dda57c6/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.h

Cc: paulkinlan@chromium.org
Status: Fixed
Sign in to add a comment