Responsive Design OCR
This commit is contained in:
@ -8,20 +8,30 @@ $(document).ready(function() {
|
||||
});
|
||||
});
|
||||
|
||||
var loading = false;
|
||||
|
||||
function analyze() {
|
||||
var img = document.getElementById("canvas").toDataURL();
|
||||
|
||||
Tesseract.recognize(img).progress((progress) => {
|
||||
console.log(progress, "$$$$");
|
||||
|
||||
if (progress.status == "recognizing text") {
|
||||
$(".determinate").css("width", progress.progress * 100 + "%");
|
||||
loading = true;
|
||||
}
|
||||
}).then((result) => {
|
||||
console.log(result);
|
||||
loading = false;
|
||||
$(".output").text(result.text);
|
||||
$('.modal').modal("open");
|
||||
|
||||
$(".determinate").css("width", "0%");
|
||||
});
|
||||
}
|
||||
|
||||
setInterval(updateProgress(), 500);
|
||||
|
||||
function updateProgress(percent) {
|
||||
if(loading == true) {
|
||||
$(".determinate").css("width", progress.progress * 100 + "%");
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user