code ing
This commit is contained in:
parent
30e20cb683
commit
dde7cecf43
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"version": "12.118.1-calc.rc.4.6",
|
"version": "12.118.1-calc.rc.4.7",
|
||||||
"codename": "aqua",
|
"codename": "aqua",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -146,16 +146,21 @@ export default defineComponent({
|
|||||||
|
|
||||||
caption: async () => {
|
caption: async () => {
|
||||||
const img = document.getElementById('imgtocaption') as HTMLImageElement;
|
const img = document.getElementById('imgtocaption') as HTMLImageElement;
|
||||||
const imgurl = img.src;
|
fetch(img.src)
|
||||||
await worker.load();
|
.then((response) => {
|
||||||
await worker.loadLanguage('eng');
|
return response.blob();
|
||||||
await worker.initialize('eng');
|
})
|
||||||
const { data: { text } } = await worker.recognize(imgurl);
|
.then((blob) => {
|
||||||
console.log(text);
|
worker.load();
|
||||||
// document.getElementById('recognized-text').innerText = text;
|
worker.loadLanguage('eng');
|
||||||
// const allowedLength = 512 - this.inputValue.length;
|
worker.initialize('eng');
|
||||||
// this.inputValue += text.slice(0, allowedLength);
|
const { data: { text } } = worker.recognize(blob);
|
||||||
await worker.terminate();
|
console.log(text);
|
||||||
|
// document.getElementById('recognized-text').innerText = text;
|
||||||
|
// const allowedLength = 512 - this.inputValue.length;
|
||||||
|
// this.inputValue += text.slice(0, allowedLength);
|
||||||
|
worker.terminate();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user