NeutrinosPlatform / cordova-plugin-mobile-ocr

A cordova plugin that can accept image URI or Base64 data and returns the text present in the image as string without need for network. You can also try :- https://github.com/NeutrinosPlatform/cordova-plugin-ml-text
MIT License
49 stars 30 forks source link

Main Exeption Android #47

Open dreamslabmg opened 1 year ago

dreamslabmg commented 1 year ago

i dunno why but i have this "main loop exeption" with an alert when i run the feature please help me

This is my code: if (/Android/i.test(navigator.userAgent)) { navigator.camera.getPicture(onSuccess, onFail, { quality: 100, destinationType: Camera.DestinationType.DATA_URL , sourceType: Camera.PictureSourceType.PHOTOLIBRARY, correctOrientation: true, });

function onSuccess(imageData) { var image = document.getElementById('render'); image.src = "data:image/jpeg;base64," + imageData; image.style.display = "flex"; prinscatta.style.display = "none"; textocr.recText(4,imageData,onSuccess,onFail); function onSuccess(recognizedText) { testoiniziale2 = recognizedText; console.log(testoiniziale2); boxtraduzione2.value = recognizedText; alert(recognizedText); } function onFail(message) { alert(message); } }

function onFail(message) { window.plugins.toast.showWithOptions( { message: message, duration: "short", position: "bottom" } ); }