Hello,
I've been trying for days to do the following, and run into the same NoneType problem. Here is what I am after: in addition to entering text, numbers, checkmarks, and dates in a form dialog, I would like to also take a picture, and store it locally.
The "picture" row in the form dialog would have two buttons, one to take a picture, and one to show a preview of it. The form dialog return dictionary would return the path to the picture as the value for that given photo row.
Example:
fields = [{'type':'text', 'title':'First Name', 'key':'fname', 'value':''}, {'type':'photo', 'title':'ID card', 'key':'ID_photo', 'value':''}]
dialogs.form_dialog(fields = fields)
And say the user enters "Bob" as first name, and uses the buttons to take a picture that gets stored locally at path pictures/some_unique_id.jpeg
Then the form dialog would return:
{'fname':'Bob', 'ID_photo':'pictures/some_unique_id.jpeg'}
In my attempts, I have used the photos module, the capture_image()
function to get the image, and the image.save(path)
function to save it.
Any help would be greatly appreciated,
Merry Christmas to you all,
G