You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, can you add the option for output types please? Could look something like this:
`async function getTextFromImage(filePath, outputType) {
await (0, _tar.extract)({
file: inputPath,
cwd: '/tmp'
});
Hi, can you add the option for output types please? Could look something like this:
`async function getTextFromImage(filePath, outputType) {
await (0, _tar.extract)({
file: inputPath,
cwd: '/tmp'
});
if (outputType !== 'stdout' || outputType !== 'txt' || outputType !== 'pdf'|| outputType !== 'hocr'|| outputType !== 'tsv') {
return "BAD_OUTPUT_TYPE"
}
const stdout = (0, _child_process.execFileSync)(outputPath, [filePath, outputType, '-l', 'eng'], {
cwd: '/tmp/tesseract-standalone',
env: {
LD_LIBRARY_PATH: './lib',
TESSDATA_PREFIX: './tessdata'
}
});
(0, _child_process.execSync)(
rm ${filePath}
);return stdout.toString();
}`
The text was updated successfully, but these errors were encountered: