W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2013

Re: [whatwg] Supporting scanners on the web

From: Jeff Muizelaar <jmuizelaar@mozilla.com>
Date: Fri, 27 Sep 2013 14:13:34 -0400
Message-Id: <B6E1DE41-A274-425E-92A2-5AD37D503C11@mozilla.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: WHAT Working Group <whatwg@whatwg.org>, Benjamin Smedberg <benjamin@smedbergs.us>

On 2013-09-27, at 1:29 AM, Jonas Sicking wrote:

> On Thu, Sep 26, 2013 at 8:19 AM, Benjamin Smedberg
> <benjamin@smedbergs.us> wrote:
>> One of the use cases that has come up for why people are still using plugins
>> is supporting scanning to the web, in particular multi-page scanning. It
>> seems to me that we could hook this up to <input type="file" multiple>, but
>> that we should try to provide UAs with a hint that a page expects a document
>> instead of images.
> 
> What we've done in Firefox for Android is to treat <input type=file
> accept="image/*"> as a hint that the page wants an image any source.
> So we give the user options to use any built-in gallery or camera apps
> for example.
> 
> We could do the same on desktop platforms and display an additional
> button next to the normal "select file" button if we detected that
> there are additional image sources like cameras or scanners available.
> 
> There's also been proposals around <input type=file accept="image/*"
> capture>. This was supposed to mean "invoke media specific capturing
> methods". I think there was also something like <input type=file
> capture=camera> being proposed which would specifically enable
> camera-backed capturing.
> 
>> * Should we give the site any way to specify preferred resolution or color
>> depth for an image? Or should the site be prepared process any images to the
>> required resolution, convert to monochrome, etc.
> 
> The most requested ability is to resize images to a particular
> resolution. This is something that can be done using canvas, but not
> for videos or animated images. And currently you can't do it off the
> main thread, which is an issue for larger images.
> 
> It would be nice to expose a image-resize API to the web.

This can already easily be done with javascript:
http://people.mozilla.org/~jmuizelaar/image-scaling/scale.html

The code above could easily run in a worker and can scale a 4288  2848 image
in under a second

-Jeff
Received on Friday, 27 September 2013 18:14:03 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:09 UTC