This commit is contained in:
ThatOneCalculator 2022-08-08 15:58:31 -07:00
parent 50eb7b693f
commit c1179b35ef
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "misskey", "name": "misskey",
"version": "12.118.1-calc.rc.4", "version": "12.118.1-calc.rc.4.1",
"codename": "aqua", "codename": "aqua",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -146,6 +146,7 @@ export default defineComponent({
caption: async () => { caption: async () => {
const img = document.getElementById('imgtocaption'); const img = document.getElementById('imgtocaption');
const textarea = document.getElementById("captioninput");
await worker.load(); await worker.load();
await worker.loadLanguage('eng'); await worker.loadLanguage('eng');
await worker.initialize('eng', OEM.LSTM_ONLY); await worker.initialize('eng', OEM.LSTM_ONLY);
@ -153,9 +154,8 @@ export default defineComponent({
tessedit_pageseg_mode: PSM.SINGLE_BLOCK, tessedit_pageseg_mode: PSM.SINGLE_BLOCK,
}); });
const { data: { text } } = await worker.recognize(img); const { data: { text } } = await worker.recognize(img);
const allowedLength = 512 - this.inputValue.length; const allowedLength = 512 - textarea.value.length;
// @ts-ignore textarea.value += text.slice(0, allowedLength);
document.getElementById("captioninput").value += text.slice(0, allowedLength);
}, },
}, },
}); });