Closed mihaibalaban closed 6 years ago
Please add more information;
Platform android plugin version: 2.0.1
and this is the code: cameraPlate() { this.camera.getPicture( { quality: 100, destinationType: this.camera.DestinationType.FILE_URI, sourceType: this.camera.PictureSourceType.CAMERA, encodingType: this.camera.EncodingType.JPEG, mediaType: this.camera.MediaType.PICTURE, saveToPhotoAlbum: false, cameraDirection: this.camera.Direction.FRONT, targetWidth: 500, targetHeight: 500, allowEdit: false, } ).then(imageData => { this.photo = imageData; this.openALPR.scan(this.photo).then( (result: [OpenALPRResult]) => { console.log(result[0].number) console.log(result) }),
(error => {
console.error('eroare: ' + error)
});
}), (error => {
alert('eraore:' + error)
console.log(error)
});
}
Please provide all the information I requested in my previous response. Have you tried debugging using Android Studio / other tools already?
i am using the default region, and the image is this http://www.plateshack.com/y2k/Austria2/austriasteiermark.jpg , thanks
Hi @mihaibalaban, I've tried reading the image you provided with our sample application (https://github.com/melvinversluijs/ionic3-sample), and this works fine.
Could you try removing the allowEdit options from your CameraOptions? The Cordova Camera docs clearly states that this is bugged for Android and should not be used (https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-camera/#android-quirks). Also the targetWidth and targetHeight, this is probably not to good for the image quality either. Lastly using the front camera for taking an image of a license plate also seems a bit weird.
You can use our sample application as reference.
Hope this helps.
Kind regards, Melvin
Thanks, melvinversluijs, now it works but i have to take the pictures in landscape.
Hi,
I've managed to update the plugin.xml file so I can get it working on Android platform 7.1.x, which is great.
However, I'm also finding that I am forced to take pictures in landscape mode. Is there a workaround for this? I've tried adding correctOrientation: true
to the camera options, but it doesn't make any difference.
Any ideas?
@beard7 could you please create a new issue to track your specific problem? And would you mind creating a PR with your changes in plugin.xml
so others can benefit from your fix.
Hi @iMicknl
I wouldn't call my changes a fix, as such, as it would break the plugin on Android platforms < 7. It's really just a case of changing the paths into which the resources are copied in plugin.xml
:
<source-file src="src/android/lib/jni" target-dir="src/main/java/com/openalpr"/>
<source-file src="src/android/lib/util" target-dir="src/main/java/com/openalpr"/>
<source-file src="src/android/lib/armeabi-v7a" target-dir="jniLibs"/>
Either that or just manually move the files in the app
folder to match the targer dir shown above after installing your plugin.
I seem to be having the same issue in Ionic 4.
`
console.log("hit");
this.openalpr.scan(croppedImage.data, openAlprOptions).then((result: [OpenALPRResult]) => {
console.log("not hit");
})
.catch(error => {
console.log("not hit");
});`
I pass image from the camera to scanning function form plugin and the function isn't returning nothing and there is no error.