W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2013

Re: Reading image bytes to a PNG in a typed array

From: Glenn Maynard <glenn@zewt.org>
Date: Wed, 16 Jan 2013 09:50:53 -0600
Message-ID: <CABirCh_SRxWKh3nv7PerdggUg+OTMuXdF-aBmTiSmnDt6WWLRg@mail.gmail.com>
To: Florian Bösch <pyalot@gmail.com>
Cc: Kyle Huey <me@kylehuey.com>, Webapps WG <public-webapps@w3.org>
On Wed, Jan 16, 2013 at 9:40 AM, Florian Bösch <pyalot@gmail.com> wrote:

> Perhaps we should think of a better scheme to export data than toFoo().
> Maybe toData('url'), toData('arraybuffer') toData('blob') or perhaps
> toData(URL), toData(ArrayBuffer) or toData(Blob). I tend to think that if
> you're starting to write toA, toB, toC, toX methods on an object, you've
> not thought this really trough what's a parameter, and what's a method.

We should be avoiding the need to return data in a bunch of different
interfaces in the first place.  If the data is large, or takes a long or
nondeterministic amount of time to create (eg. something that would be
async in the UI thread), return a Blob; otherwise return an ArrayBuffer.
 The user can convert from there as needed.

Glenn Maynard
Received on Wednesday, 16 January 2013 15:51:20 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:58 UTC