[whatwg] Image resize API proposal

David Levin levin at google.com
Thu May 20 20:53:25 PDT 2010

On Thu, May 20, 2010 at 5:48 PM, Maciej Stachowiak <mjs at apple.com> wrote:

> On May 20, 2010, at 1:00 PM, David Levin wrote:
> On Thu, May 20, 2010 at 11:30 AM, Maciej Stachowiak <mjs at apple.com> wrote:
> >
> > I'm not clear on why this API is needed. ... This API seems much less
> general than offscreen canvas, so it's subject to the same criticism and you
> can't even make the argument that it also serves other use cases.
> The criticism for the OffscreenCanvas was
> 1. it made the core use case of image resizing rather complicated and
> 2. depending on the browser's implementation, there may be faster ways to
> do the image resizing than doing it on a worker.
> The net suggestion that "This supports the idea of specialized API..." --
> http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-March/025590.html
> This is exactly what we are doing (and it addresses those criticisms).
> Is the purpose of this API performance or convenience?

Ideally performance and convenience.

> It seems like the proposed API is so specialized that it's only really
> useful to resize an image immediately before transferring it over the
> network in some way.

Since you get back a blob, you could use blob.url to put the result in into
css.  As a css background, it may be nice to have a resized image (and one
that has been rotated/flipped according to the exif info).

Is that really so much more common than any other resizing that it needs a
> specialized convenience API?
Twice when this was brought up on whatwg developers out of the blue
mentioned that the image resizing was a useful thing for them (once early in
this thread and once long ago when canvas in workers was brought up).

In addition to that anecdotal evidence, here are several other places this
comes up which I can list quickly:

   - For example, take Facebook. If I upload a huge photo to Facebook, it
   seems to upload the whole thing and then resizes it on the server (down to
   something much smaller than 1600 X 1200).
   - This is similar for other social sites like dating sites or Orkut that
   only allow a maximum size of photo. Typically, either they force the user to
   resize the image (which is a horrible experience) or they resize the image
   on the client using gears (with workers and canvas) or flash, etc. (or
   canvas but for more than one browser that may hang the UI).
   - Similarly Gmail now allows dragging images into email (
   The full resolution image isn't necessary for this. It would be better to
   have a resized image.
   - Something like Google Docs or Wave which show real time participation
   of other people typing would benefit from getting a thumbnail of an inserted
   image to other people in the conversation. (One could envision this for any
   real time chat/communication website.)
   - When you upload photos to picasaweb from the Picasa client, it offers
   to resize them to 1600X1200 before uploading them. Also, it offers an option
   to upload a thumbnail first before uploading the bigger picture, so the
   album can appear even quicker (just at a really low resolution). Ideally, a
   website could do something similar.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100520/2a4d2319/attachment-0002.htm>

More information about the whatwg mailing list