WICG / shape-detection-api

Detection of shapes (faces, QR codes) in images
https://wicg.github.io/shape-detection-api
Other
306 stars 36 forks source link

Replace supportedFormats with static getSupportedFormats() method #54

Closed reillyeon closed 5 years ago

reillyeon commented 5 years ago

The problem with the current supportedFormats attribute are two-fold,

  1. The property can be read synchronously which is incompatible with modern user agent designs which run script in a sandboxed process and so would have to cache the value of this attribute at startup in order to provide its value synchronously or pause script execution until it can be fetched asynchronously.
  2. While a developer can select the barcode formats they would like to use through BarcodeDetectorOptions they must first create a new BarcodeDetector in order to get access to this property.

This attribute should instead be (a) static and (b) a method returning a Promise.

yell0wd0g commented 5 years ago

https://bugs.chromium.org/p/chromium/issues/detail?id=925167