Skip to content

Commit

Permalink
Fixed linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MShwed committed Sep 5, 2019
1 parent f1659af commit 8dde732
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions src/core/operations/OCR.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,13 @@ class OCR extends Operation {
this.infoURL = "https://en.wikipedia.org/wiki/Optical_character_recognition";
this.inputType = "ArrayBuffer";
this.outputType = "string";
this.args = [
/* Example arguments. See the project wiki for full details.
{
name: "First arg",
type: "string",
value: "Don't Panic"
},
{
name: "Second arg",
type: "number",
value: 42
}
*/
];
this.args = [];
}

/**
* @param {ArrayBuffer} input
* @param {Object[]} args
* @returns {Object}
* @returns {string}
*/
async run(input, args) {
if (!isImage(input)) {
Expand All @@ -72,11 +59,9 @@ class OCR extends Operation {

const result = await worker.recognize(image)
.progress(progress => {
if (isWorkerEnvironment()) self.sendStatusMessage(`${progress.status} - ${parseFloat(progress.progress).toFixed(2)}%`);
if (isWorkerEnvironment()) self.sendStatusMessage(`${progress.status} - ${(parseFloat(progress.progress)*100).toFixed(2)}%`);
});

console.log(result);

return result.text;
} catch (err) {
throw new OperationError(`Error performing OCR on image. (${err})`);
Expand Down

0 comments on commit 8dde732

Please sign in to comment.