Readonly attribute unsigned long long size Readonly attribute blob // throws an exception if accessed before onblobready is called. at most one of the following functions will be called for a single FutureBlob Readonly attribute DOMString url // whatever name - URL, urn, URN, etc. Var streamingBlob = image.toStreamingBlob(mimeType /* req */, width /* req */, height /* req */, qualityLevel /* op */, preserveAspectRatio /* op */, rotateExif /* op */) Returning a SizelessBlob immediately from a method on image Readonly attribute unsigned short started // default 0Ĭreating an entirely new object for this task made the task seem more complicated and involved than necessary, and this problem could be solved via modifications to the Image object. NamedConstructor=ImageResizer(blob, onsuccess, onerror, type, width, height)]Īttribute DOMString type // default "image/png"Īttribute float qualityLevel // default 1.0, must be 0.0 to 1.0, else reverts to default NamedConstructor=ImageResizer(blob, onsuccess, onerror, type), NamedConstructor=ImageResizer(blob, onsuccess, onerror), NamedConstructor=ImageResizer(blob, onsuccess), the blob will represent a new image that is 300x300.įor reference, we've also included a list of other designs that we thought of along with the reasons why they were dropped: Image will retain aspect ratio and correct for EXIF rotation. I.getBlob("image/jpeg", 300, 350, successEvt, errEvt. url contains location of an image file If the image source is of a different origin than the script context, then getBlob raises a SECURITY_ERR exception. Default values for preserveAspectRatio and rotateExif are true.Īll EXIF metadata will be retained except for any saved thumbnails, and the EXIF rotation property will be appropriately modified. If null (or a negative value) is passed in for the width or height, then the function will use the source's measurement for that dimension. If MIME type does not equal "image/jpeg", then quality level is ignored. Quality level should be between 0.0 and 1.0, and any value outside of that range will be reverted to the default, 0.85. The blob will be passed as an argument to the success callback function, or upon error, error data will be passed into the error callback function as an argument. GetBlob(mimeType /* req */, width /* req */, height /* req */, successEvent /* req */, errorEvent /* op */, qualityLevel /* op */, preserveAspectRatio /* op */, rotateExif /* op */) getBlob will be an instance function of the javascript Image object which asynchronously gets a blob of the image, resized to the given width and height, encoded into jpeg or png. Or, limit the size of an image file before uploading it to a web server. In real-time chat, quickly give other users a thumbnail view of the image file.Ģ. Each step will have its own bug, and this will be dependent on the approval of each of those steps.īegin with a user giving a local image file to a webpage. Tests will be added at each steps, as appropriate. Transfer all metadata (except thumbnails and in the above case, EXIF orientation) Derive EXIF orientation metadata from image and rotate image accordingly if the rotateExif parameter is trueĥ. Resize the image and place it into a BlobĤ. Create another thread (which will do the resizing in the future), and callback to the main threadĢ. Add functionality for conditional compilation of added files.ġ. Implementation will take place in the following steps:Ġ. Image.getBlob(mimeType /* req */, width /* req */, height /* req */, successEvent /* req */, errorEvent /* op */, qualityLevel /* op */, preserveAspectRatio /* op */, rotateExif /* op */) This API will be attached to the Image object, and its usage will be:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |