mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-28 14:58:09 +09:00
im stuff
This commit is contained in:
parent
0797096062
commit
0b5c2f03ae
@ -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 New Issue
Block a user