Fixed 267U.pre3
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import define from "../../../define.js";
|
||||
import { createWorker } from "tesseract.js";
|
||||
export const meta = {
|
||||
tags: [
|
||||
"drive"
|
||||
],
|
||||
requireCredential: true,
|
||||
kind: "read:drive",
|
||||
description: "Return caption of image",
|
||||
res: {
|
||||
type: "string",
|
||||
optional: false,
|
||||
nullable: false
|
||||
}
|
||||
};
|
||||
export const paramDef = {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: {
|
||||
type: "string"
|
||||
}
|
||||
},
|
||||
required: [
|
||||
"url"
|
||||
]
|
||||
};
|
||||
export default define(meta, paramDef, async (ps)=>{
|
||||
const worker = await createWorker("eng", undefined, {
|
||||
logger: (m)=>console.log(m)
|
||||
});
|
||||
const { data: { text } } = await worker.recognize(ps.url);
|
||||
await worker.terminate();
|
||||
return text;
|
||||
});
|
||||
Reference in New Issue
Block a user