Skip to content

Commit 8dde732

Browse files
committed
Fixed linting issues
1 parent f1659af commit 8dde732

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

src/core/operations/OCR.mjs

+3-18
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,13 @@ class OCR extends Operation {
3030
this.infoURL = "https://en.wikipedia.org/wiki/Optical_character_recognition";
3131
this.inputType = "ArrayBuffer";
3232
this.outputType = "string";
33-
this.args = [
34-
/* Example arguments. See the project wiki for full details.
35-
{
36-
name: "First arg",
37-
type: "string",
38-
value: "Don't Panic"
39-
},
40-
{
41-
name: "Second arg",
42-
type: "number",
43-
value: 42
44-
}
45-
*/
46-
];
33+
this.args = [];
4734
}
4835

4936
/**
5037
* @param {ArrayBuffer} input
5138
* @param {Object[]} args
52-
* @returns {Object}
39+
* @returns {string}
5340
*/
5441
async run(input, args) {
5542
if (!isImage(input)) {
@@ -72,11 +59,9 @@ class OCR extends Operation {
7259

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

78-
console.log(result);
79-
8065
return result.text;
8166
} catch (err) {
8267
throw new OperationError(`Error performing OCR on image. (${err})`);

0 commit comments

Comments
 (0)