docassemble icon indicating copy to clipboard operation
docassemble copied to clipboard

Feature Request: Provide a field to take a picture using camera

Open ikus060 opened this issue 2 years ago • 1 comments

I saw a field to upload an image to the form.

I would love to see a field type to allow the user to take a picture using the camera. That would be very helpful for mobile users.

According to html spec. We only need to add the "capture" attribute to the <input ..

<input type="file" accept="image/*" capture />

ikus060 avatar Sep 21 '22 11:09 ikus060

I used to have this but I turned it off. I forgot exactly why it was problematic. One thing that remains is datatype: user, which uses capture to specify the user-facing camera.

The reality is that on mobile, datatype: file lets the user choose the camera if they want to use the camera. So I'm not sure it makes things any more convenient for users to prevent them from uploading an image from their stored images.

Anyway, I'll look into this and try to recall why I turned off the capture feature for datatype: camera.

jhpyle avatar Sep 21 '22 13:09 jhpyle

After from testing with various mobile device, datatype: camera is doing exactly what I want.

Closing this ticket.

ikus060 avatar Oct 18 '22 19:10 ikus060

Hello, Was there some findings on how to capture images using the camera on tablet or smartphone from within DA interview?

We are trying to have user upload camera captured image as part of the pdf document which is generated on interview completion. Also, is it possible to pass as parameter which camera - front or back - to start for uploading the image.

Can you please provide some pointer on the right way to approach this setup? I have tried to use HTML5 to capture image and add it to pdf but is there a better way to accomplish this?

myaptad avatar Feb 23 '23 19:02 myaptad

See https://docassemble.org/docs/fields.html#file

datatype: camera is just like file, except it limits the allowable file types to image files.

datatype: user is just like camera, except with an HTML5 input type that suggests using the device’s front (user-facing) camera.

datatype: environment is just like camera, except with an HTML5 input type that suggests using the device’s rear (environment-facing) camera.

jhpyle avatar Mar 12 '23 00:03 jhpyle

Thanks for the response. Both datatype : user and environment open rear camera on android devices. Is there setting on the device needed for this to work as intended?

Will try slack for the captcha question.

myaptad avatar Mar 12 '23 08:03 myaptad

Please disregard this. It works on other android devices and only one device which I tested on first, it didn't. I believe it to be settings related issue. thanks

myaptad avatar Mar 12 '23 17:03 myaptad