mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 08:53:48 +01:00
fixxx
This commit is contained in:
parent
9af1b244d3
commit
5a59eb9838
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"version": "12.118.1-calc.rc.4.7",
|
||||
"version": "12.118.1-calc.rc.4.8",
|
||||
"codename": "aqua",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -146,21 +146,18 @@ export default defineComponent({
|
||||
|
||||
caption: async () => {
|
||||
const img = document.getElementById('imgtocaption') as HTMLImageElement;
|
||||
fetch(img.src)
|
||||
.then((response) => {
|
||||
return response.blob();
|
||||
})
|
||||
.then((blob) => {
|
||||
worker.load();
|
||||
worker.loadLanguage('eng');
|
||||
worker.initialize('eng');
|
||||
const { data: { text } } = worker.recognize(blob);
|
||||
console.log(text);
|
||||
// document.getElementById('recognized-text').innerText = text;
|
||||
// const allowedLength = 512 - this.inputValue.length;
|
||||
// this.inputValue += text.slice(0, allowedLength);
|
||||
worker.terminate();
|
||||
});
|
||||
const imgurl = img.src;
|
||||
console.log(imgurl)
|
||||
const imgblob = await fetch(imgurl).then(r => r.blob());
|
||||
await worker.load();
|
||||
await worker.loadLanguage('eng');
|
||||
await worker.initialize('eng');
|
||||
const { data: { text } } = await worker.recognize(imgblob);
|
||||
console.log(text);
|
||||
// document.getElementById('recognized-text').innerText = text;
|
||||
// const allowedLength = 512 - this.inputValue.length;
|
||||
// this.inputValue += text.slice(0, allowedLength);
|
||||
await worker.terminate();
|
||||
},
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user