<br><br><div class="gmail_quote">On Thu, May 20, 2010 at 5:48 PM, Maciej Stachowiak <span dir="ltr"><<a href="mailto:mjs@apple.com">mjs@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div><div></div><div class="h5"><br><div><div>On May 20, 2010, at 1:00 PM, David Levin wrote:</div><br><blockquote type="cite"><br><br>On Thu, May 20, 2010 at 11:30 AM, Maciej Stachowiak <<a href="mailto:mjs@apple.com" target="_blank">mjs@apple.com</a>> wrote:<br>
><br>> 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.<br>

<br>The criticism for the OffscreenCanvas was <br>1. it made the core use case of image resizing rather complicated and<br>2. depending on the browser's implementation, there may be faster ways to do the image resizing than doing it on a worker.<br>

<br><div>The net suggestion that "This supports the idea of specialized API..." -- <a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-March/025590.html" target="_blank">http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-March/025590.html</a><br>

<br><div>This is exactly what we are doing (and it addresses those criticisms).</div></div></blockquote></div><div><br></div></div></div><div>Is the purpose of this API performance or convenience?</div></div></blockquote>
<div><br></div><div>Ideally performance and convenience. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><br><div>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.</div>
</div></blockquote><div><br></div><div>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).</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div> Is that really so much more common than any other resizing that it needs a specialized convenience API?</div>
</div></blockquote><div><i><span class="Apple-style-span" style="font-style: normal;"><br></span></i></div><div>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).</div>
<div><br></div><div>In addition to that anecdotal evidence, here are several other places this comes up which I can list quickly:</div><div><ul><li>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).</li>
<li>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).</li>
<li>Similarly Gmail now allows dragging images into email (<a href="http://gmailblog.blogspot.com/2010/05/drag-images-into-messages.html">http://gmailblog.blogspot.com/2010/05/drag-images-into-messages.html</a>). The full resolution image isn't necessary for this. It would be better to have a resized image.</li>
<li>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.)</li>
<li>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.</li>
</ul></div><div> dave</div><div><br></div></div>