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: Sat, 28 Jan 2012 11:21:36 +0100
Message-ID: <4F23CC30.6050409@bauglir.com>
To: Kyle Huey <me@kylehuey.com>
CC: public-webapps@w3.org

On 28.1.2012 10:19, Kyle Huey wrote:
> 2012/1/28 Bronislav Klučka <Bronislav.Klucka@bauglir.com 
> <mailto:Bronislav.Klucka@bauglir.com>>
>     Hello,
>     would it be possible to have Image.toBlob() function? We are
>     introducing Canvas.toBlob(), image (and maybe video, audio) would
>     be nice addition
>     Brona
> Proposing a more detailed spec would be a good place to start.  Some 
> example questions:
> 1. What does <img>.toBlob() do if the image failed to load?
> 2. Should <img>.toBlob() respect CORS?
> 3. Does <img>.toBlob() take a content type argument like the others?  
> If so, what does <img src="foo.jpg">.toBlob("image/png") do?
> 4. Is <img>.toBlob() asynchronous like <canvas>.toBlob()?
> I think the idea of implementing <img>.toBlob() is fine, but we need 
> to spec out the behavior first.
> - Kyle

Sure, sure just throwing the idea here.
I think whatever can be followed according to existing should be (the 
same signature as Canvas.toBlob, respecting crossorigin attribute, CORS)
If there is failure possible in Canvas.toBlob(), this method should 
follow it, if not, error should be thrown once called on error image
<img src="foo.jpg">.toBlob("image/png") should return PNG

Basically the idea is, that this should replace for creating canvas, 
painting image on such canvas and calling canvas.toBlob().

Received on Saturday, 28 January 2012 10:22:01 UTC

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