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