From 8dde7325143b6f02992140b47b9ae46e1dd85df3 Mon Sep 17 00:00:00 2001 From: mshwed Date: Thu, 5 Sep 2019 09:20:59 -0400 Subject: [PATCH] Fixed linting issues --- src/core/operations/OCR.mjs | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/core/operations/OCR.mjs b/src/core/operations/OCR.mjs index 35081f14..5b4e6d79 100644 --- a/src/core/operations/OCR.mjs +++ b/src/core/operations/OCR.mjs @@ -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)) { @@ -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})`);