[whatwg] Supporting scanners on the web
jmuizelaar at mozilla.com
Fri Sep 27 11:13:34 PDT 2013
On 2013-09-27, at 1:29 AM, Jonas Sicking wrote:
> On Thu, Sep 26, 2013 at 8:19 AM, Benjamin Smedberg
> <benjamin at 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.
The code above could easily run in a worker and can scale a 4288 × 2848 image
in under a second
More information about the whatwg