Closed grimaldistudio closed 5 years ago
Tnx for your reply, i am very happy.
environment: Cordova CLI: 7.1.0 Ionic CLI Version: 2.2.3 Ionic App Lib Version: 2.2.1 ios-deploy version: 2.0.0 ios-sim version: 5.0.13 OS: macOS Node Version: v7.2.1 Xcode version: Xcode 10.1 Build version 10B61
Code:
document.addEventListener('deviceready', function () {
scan.scanDoc(1, onSuccess, onFail);
});
function onSuccess(imageURI) {
$scope.captured = imageURI;
}
function onFail(message) {
if (window.cordova && $cordovaToast)
$cordovaToast.showLongBottom('There was an unexpected error');
}
}
note: i select all the image area.
Cheers,
Domenico
Couple of questions mostly because I am a newbie in ionic.
$scope.captured = imageURI;
in this line of code what exactly is $scope.captured
. Whoops accidentally closed the issue!! My bad!!
$scope.captured = imageURI;
-> AngularJs to show image in view <img ng-src="captured" />
, but if i replace with console.log(imageURI);
app crash too.Cheers, Domenico
Finally i did it! I made a 'spin off' of my project with only document scanner function but the core is the same. I hope it can be useful for tracing the problem.
Note:do you need the source code? ionic v1 + cordova?
Download apk here: http://tinyurl.com/y2ztzu88
Hi Chris, yeah...some time has passed :)
of course, download src code here: https://tinyurl.com/y4mkxs9u
If you need details, ask me. Tnx for your effort!
hi, i'm sorry there was an error, now corrected. Please download again.
Hi Chris, I entered the precompiled login with username and password.
In any case I sent the new code without login. note: there is a "Scan Document" button.
Tnx Domenico
Hi Chris, did you see my last update?
Tnx Domenico
Hey @grimaldistudio
I totally dropped the ball on this, my bad. Will look into this as soon as I get some time off. Maybe tomorrow or day after. You referenced another issue here. As mentioned there, do you think being able to adjust quality of the plugin output will help? Those were the lines along which I was thinking. Anyhow I will get back to you with what I have sooner than later.
Hey @grimaldistudio so I ran your app but I could not replicate this. What device did you test this on? Will try to get the same device on my side to test.
I think I have an idea on how to solve this (Get min and max res of OpenGL renderer and if the image is smaller than the min or larger than the max then scale the image up/down as necessary while keeping the aspect ratio). Will look into this and get back to you.
I test on Samsung s6 -> remember to select the whole area. ->do you think being able to adjust quality of the plugin output will help? Yes, I think this is it
Thank you for your work, I hope you can solve it as soon as possible. Domenico
We're looking at using/contributing to this plugin, but I'm a little dismayed at how slow things are being improved, and am wondering whether we should roll our own instead.
Is this a side project, or a part of a commerical project you're working on?
Hey @jpike88
Quick Note :- Please do not hijack a thread. Start a new issue of your own and we can continue the discussion there if you would like to.
To answer your question this plugin is not part of any commercial project. We are busy with customer engagement and this has taken a back seat, hence the slow down in addition of enhancements. Active Dev will start by July. We would absolutely appreciate any contribution and will actively participate in helping contributors.
If you would like to contribute to the ios library please refer this comment and also our fork of the scanner library
If you would like to contribute to the android library please refer our fork and also the original Just let me know if you need anything else, I will try and help to the best of my ability.
Hey @ all.
Finally got around to fixing the quality issue. From plugin version 4.1.0 onwards, you can now pass in quality property inside the options object.
As shown here :- {quality : 1.0}
.
As mentioned in the readme,
1.0
is the highest quality and5.0
is the lowest quality. Any values not in this range will default to the highest quality of1.0
Example :-
scan.scanDoc(onSuccess, onFail, {sourceType : 1, fileName : "myfilename", quality : 2.5});
// sourceType will by default take value 1 if no value is set | 0 for gallery | 1 for camera.
// fileName will take default value "image" if no value set. Supported only on 4.x.x plugin version
function onSuccess(imageURI) {
alert(imageURI);
console.log(imageURI);
//var image = document.getElementById('myImage');
//image.src = imageURI; // For iOS, use image.src = imageURI + '?' + Date.now(); to solve issue 10 if unique fileName is not set.
}
function onFail(message) {
alert('Failed because: ' + message);
}
Closing this issue as upgrading to plugin version 4.1.0
should solve all of the following related issues #35, #46 & #47. If there are any problems in your trials please raise a new issue.
Hi, the plugin works fine but if you do not crop the image then the app crashes:
java.lang.RuntimeException: Canvas: trying to draw too large(122556768bytes) bitmap. at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:260) at android.graphics.Canvas.drawBitmap(Canvas.java:1420) at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:545) at android.widget.ImageView.onDraw(ImageView.java:1286) at android.view.View.draw(View.java:18318) ....
What can i do?
Tnx