WICG / shape-detection-api

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

Specify behavior when BarcodeDetectorOptions.formats is not present #75

Closed reillyeon closed 5 years ago

reillyeon commented 5 years ago

This change resolves confusion around the barcodeDetectorOptions argument to the BarcodeDetector constructor. As it is an optional parameter in trailing position it will always be default initialized and so always present. However, the formats member does not have a default value and so may not be present. This change clarifies the behavior in these cases.

Fixes #74.


Preview | Diff

bzbarsky commented 5 years ago

Thank you. Note that the behavior is still not really defined when barcodeDetectorOptions.formats is not present or when it's present but does not trigger either of the two exception clauses. Presumably the intent is that in both cases something (what?) should be stored in some internal slots in the object and that the something should somehow affect the behavior of detect calls, but the steps for detect don't really reference any state like that.

reillyeon commented 5 years ago

Thanks for the feedback. I've filed #77 to be more specific about how format hinting is expected to work.

bzbarsky commented 5 years ago

Thank you!