diff --git a/src/components/svg-icon.vue b/src/components/svg-icon.vue index 362377c..b4d2c16 100644 --- a/src/components/svg-icon.vue +++ b/src/components/svg-icon.vue @@ -3,6 +3,9 @@ + + + @@ -13,7 +16,7 @@ icon: { type: String, validator(value) { - return ['image','videocam','visibility'].includes(value) + return ['image','videocam','visibility','photo_library','no_photography','photo_camera'].includes(value) } }, fillColor: { diff --git a/src/pages/detect.vue b/src/pages/detect.vue index 8200cdd..adf0eb8 100644 --- a/src/pages/detect.vue +++ b/src/pages/detect.vue @@ -30,7 +30,7 @@ - + @@ -40,7 +40,7 @@ - + @@ -82,6 +82,17 @@ + + + + + + + + + + + @@ -345,8 +356,13 @@ this.detectorLabels.forEach( s => s.detect = false ) } }, - selectImage () { - if (this.isCordova) { + selectImage (mode) { + if (mode == "camera") { + this.$refs.image_chooser.setAttribute("capture","environment") + } else { + this.$refs.image_chooser.removeAttribute("capture") + } + if (this.isCordova && mode == "camera") { navigator.camera.getPicture(this.getImage, this.onFail, { quality: 50, destinationType: Camera.DestinationType.DATA_URL, correctOrientation: true }); } else { var loadResult = this.$refs.image_chooser.click()