I'm making a quick script that is supposed to use OCR tool (tesseract) on image in clipboard to convert it to text and output it. It looks like this:
#!/bin/sh
temp="$(mktemp tmpXXX.png)"
xclip -selection clipboard -t image/png -o > $temp
tesseract $temp stdout 2>/dev/null
rm $temp
What I'm wondering is why doesn't this one-liner tesseract <(xclip -selection clipboard -t image/png -o) stdout work?
From what I know, process substitution is supposed to make temporary file (similar to my full script) that tesseract uses as input file. Alas, this leads to an error:
Error in pixReadStream: Unknown format: no pix returned
Error in pixRead: pix not read
Error during processing.
Does anybody have an idea why this happens?
Thanks in advance.