Re: [img-conversion] Convert to spec (#14)

>        </h2>
> +      <pre class="idl">
> +typedef (HTMLImageElement or Blob) ImageSource;
> +
> +partial interface ImageData {
> +  [NewObject] Promise&lt;Blob&gt; toBlob (optional DOMString type, optional EncoderOpts options);
> +  [NewObject] static Promise&lt;ImageData&gt; create (ImageSource source);
> +  static CanPlayTypeResult canDecodeType (DOMString mimeType);

I don't think it should cover video or animated formats, at least in a v1 of the spec. ImageData represents a single still image so I think it should only cover still image formats. Video is best handled by HTMLVideoElement. ImageData could cover animated formats like MJPEG, APNG, GIF etc. but ImageData could only represent one frame (probably the first), which kind of defeats the point of using an animated format. In the "future work" section of the explainer document, I describe how I think it would be best to in future add some kind of AnimatedImageData interface which would deal with animated image formats (and possibly video? IDK) providing access to an array of ImageData for each frame, along with metadata.

---
Reply to this email directly or view it on GitHub:
https://github.com/WICG/img-conversion/pull/14/files#r40194882

Received on Wednesday, 23 September 2015 11:59:28 UTC