mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 14:07:38 -07:00
im stuff
This commit is contained in:
parent
0797096062
commit
0b5c2f03ae
2 changed files with 8 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "misskey",
|
||||
"version": "12.118.1-calc.rc.4.2",
|
||||
"version": "12.118.1-calc.rc.4.3",
|
||||
"codename": "aqua",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { length } from 'stringz';
|
||||
import { createWorker, PSM, OEM } from 'tesseract.js';
|
||||
import { createWorker } from 'tesseract.js';
|
||||
import MkModal from '@/components/ui/modal.vue';
|
||||
import MkButton from '@/components/ui/button.vue';
|
||||
import bytes from '@/filters/bytes';
|
||||
|
@ -145,17 +145,16 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
caption: async () => {
|
||||
const img = document.getElementById('imgtocaption');
|
||||
const img = document.getElementById('imgtocaption') as HTMLImageElement;
|
||||
const imgurl = img.src;
|
||||
await worker.load();
|
||||
await worker.loadLanguage('eng');
|
||||
await worker.initialize('eng', OEM.LSTM_ONLY);
|
||||
await worker.setParameters({
|
||||
tessedit_pageseg_mode: PSM.SINGLE_BLOCK,
|
||||
});
|
||||
const { data: { text } } = await worker.recognize(img);
|
||||
console.log(text);
|
||||
await worker.initialize('eng');
|
||||
const { data: { text } } = await worker.recognize(imgurl);
|
||||
console.log(`\n\n${text}\n\n`);
|
||||
const allowedLength = 512 - this.inputValue.length;
|
||||
this.inputValue += text.slice(0, allowedLength);
|
||||
await worker.terminate();
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue