W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2010

[whatwg] canvas, img, file api and blobs

From: Stef Epardaud <stef@epardaud.fr>
Date: Mon, 15 Feb 2010 15:43:39 +0100
Message-ID: <20100215144338.GA13800@inforealm.org>
Hello,

I am trying to write a client-side application in HTML5 that resizes
images before uploading them to the server. I saw several demos that did
this resizing using canvas and img, but I have only seen how to get a
data URL out of a canvas, and since Base64 is about 1.37% larger than
the equivalent binary data (according to http://en.wikipedia.org/wiki/Base64),
I wonder why it is not possible to get a Blob out of the canvas?
Especially since the File API supports uploading Blobs.

In many cases it is useful to resize images on the client so that upload
size can be limited (to save bandwidth) and uploading in base64 would
mitigate this.

In a related question, is there any guarantee that when we draw an image
with EXIF information into a canvas for resizing, we get (or not) the
EXIF back in the resized image (currently via toDataURL())?

Thanks
-- 
St?phane Epardaud
Received on Monday, 15 February 2010 06:43:39 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:21 UTC