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 3 users
Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux, Android
Pri: 3
Type: Bug

Blocked on:
issue 672571



Sign in to add a comment
ImageData not a valid parameter for detect in Barcode Scanner
Project Member Reported by paulkin...@google.com, Dec 3 2016 Back to list
Demo: https://jsbin.com/hameva/edit?html,css,js

Spec says imageData from a canvas is a valid paramter for ImageBitmapSource, but when provided I get

TypeError: Failed to execute 'detect' on 'BarcodeDetector': The provided value is not of type '(CSSImageValue or HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or OffscreenCanvas)'
 
Cc: xianglu@chromium.org
Labels: ShapeDetection
Blockedon: 672571
Status: Started
Got a CL doing the trick needed here (https://crrev.com/2550413005/)
but it needed some dirty trick with the input parameter, instead
wait until  https://crbug.com/672571  is landed and use ImageBitmapSource.
Project Member Comment 3 by bugdroid1@chromium.org, Dec 15 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b935b59277c7f3cdc38d560fb6e305274f4e995c

commit b935b59277c7f3cdc38d560fb6e305274f4e995c
Author: mcasas <mcasas@chromium.org>
Date: Thu Dec 15 03:40:31 2016

ShapeDetection: use ImageBitmapSource as input and support ImageData

This CL :

- s/CanvasImageSource/ImageBitmapSource/ in the idl following
https://wicg.github.io/shape-detection-api/#face-detection-api and
https://wicg.github.io/shape-detection-api/#barcode-detection-api

 CanvasImageSource [1] is almost a subset of ImageBitmapSource [2]
(the former can be a CSSImageValue, but we don't care much
about it for this Spec), so this CL is small in that sense.

- Adds support for ImageData as a source for detect()ion,
and adds a LayoutTest for it.

[1] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.idl?q=file:%5C.idl+CanvasImagesource&sq=package:chromium&l=33&dr=C
[2] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.idl?type=cs&q=file:%5C.idl+Imagebitmapsource&sq=package:chromium&l=38

BUG= 670975 

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

[add] https://crrev.com/b935b59277c7f3cdc38d560fb6e305274f4e995c/third_party/WebKit/LayoutTests/shapedetection/detection-ImageData.html
[modify] https://crrev.com/b935b59277c7f3cdc38d560fb6e305274f4e995c/third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.idl
[modify] https://crrev.com/b935b59277c7f3cdc38d560fb6e305274f4e995c/third_party/WebKit/Source/modules/shapedetection/FaceDetector.idl
[modify] https://crrev.com/b935b59277c7f3cdc38d560fb6e305274f4e995c/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp
[modify] https://crrev.com/b935b59277c7f3cdc38d560fb6e305274f4e995c/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.h

Comment 4 by mcasas@chromium.org, Dec 15 2016
Labels: Needs-Verification
Status: Fixed
Sign in to add a comment