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

Re: Image.toBlob()

From: Bronislav Klučka <Bronislav.Klucka@bauglir.com>
Date: Fri, 03 Feb 2012 04:34:48 +0100
Message-ID: <4F2B55D8.7010202@bauglir.com>
To: public-webapps@w3.org

On 2.2.2012 23:24, Anne van Kesteren wrote:
> On Sat, 28 Jan 2012 09:27:08 +0100, Bronislav Klučka 
> <Bronislav.Klucka@bauglir.com> wrote:
>> would it be possible to have Image.toBlob() function? We are 
>> introducing Canvas.toBlob(), image (and maybe video, audio) would be 
>> nice addition
> Are the additional resource required to drawing the image on <canvas> 
> first a bottleneck?
There may be additional changes to images being applied in document 
(CSS: width, height, CSS filters) and I would prefer drawImage to have 
the displayed image as its source, but then I have no way to get to the 
underlying/original data of that resource (before any transformation).
Basically anything, that can be understood as an resource should have 
toBlob() (Canvas, Image, Video, Audio, Document).
But as Charles mentioned before me, maybe stream would be even better. 
Assuming we would redefine Blob as a descendant of stream - file stream 
(seekable stream in oppose to nonseekable stream e.g. network stream). 
We have started with a lot of helpers to avoid working with chunks of 
bytes, when working with resources (XHR Blob send; draw image on canvas, 
play audio), then there are APIs like AudioApi allowing to work with 
underlying data, but still media specific. And it would be nice to have 
one basic way to reduce any resource to sequence of bytes.

Received on Friday, 3 February 2012 03:35:23 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:38 UTC