Open mmroczka opened 7 months ago
Hi,
I won't have time to debug this, can you check which version you have? It's still working for me with:
$ tesseract -v
tesseract 5.3.2
leptonica-1.82.0
libgif 5.2.1 : libjpeg 8d (libjpeg-turbo 2.1.5.1) : libpng 1.6.40 : libtiff 4.5.1 : zlib 1.2.11 : libwebp 1.3.1 : libopenjp2 2.5.0
Found NEON
Found libarchive 3.6.2 zlib/1.2.11 liblzma/5.4.1 bz2lib/1.0.8 liblz4/1.9.4 libzstd/1.5.4
Found libcurl/8.1.2 SecureTransport (LibreSSL/3.3.6) zlib/1.2.11 nghttp2/1.45.1
Im still on Mac OS Monterey though (12.7.1
).
You may want to ask the question on the Alfred forum too: https://www.alfredforum.com/topic/12006-ocr-extract-text-from-snapshot/
I encountered the same problem. It could be due to the system permissions of the /tmp directory when under multi-user operating systems. Changing the path in the script to this could solve my issue:
And I am on Mac OS 14.1.1 my tesseract version is:
$ tesseract -v
tesseract 5.3.3
leptonica-1.84.0
libgif 5.2.1 : libjpeg 8d (libjpeg-turbo 3.0.0) : libpng 1.6.40 : libtiff 4.6.0 : zlib 1.2.12 : libwebp 1.3.2 : libopenjp2 2.5.0
Found NEON
Found libarchive 3.7.2 zlib/1.2.12 liblzma/5.4.4 bz2lib/1.0.8 liblz4/1.9.4 libzstd/1.5.5
Found libcurl/8.1.2 SecureTransport (LibreSSL/3.3.6) zlib/1.2.12 nghttp2/1.55.1
I encountered the same problem. It could be due to the system permissions of the /tmp directory when under multi-user operating systems. Changing the path in the script to this could solve my issue:
And I am on Mac OS 14.1.1 my tesseract version is:
$ tesseract -v tesseract 5.3.3 leptonica-1.84.0 libgif 5.2.1 : libjpeg 8d (libjpeg-turbo 3.0.0) : libpng 1.6.40 : libtiff 4.6.0 : zlib 1.2.12 : libwebp 1.3.2 : libopenjp2 2.5.0 Found NEON Found libarchive 3.7.2 zlib/1.2.12 liblzma/5.4.4 bz2lib/1.0.8 liblz4/1.9.4 libzstd/1.5.5 Found libcurl/8.1.2 SecureTransport (LibreSSL/3.3.6) zlib/1.2.12 nghttp2/1.55.1
Can confirm this works, use ~/tmp/...
is better IMO
Can confirm this works, use
~/tmp/...
is better IMO
The original /tmp
allowed for the periodic cleaning by MacOS of temporary files. I wanted to keep that behavior. So, since /tmp
is a symlink to /private/tmp
, I made a ~/tmp
a symlink: ln -s /private/tmp ~/tmp
.
(And updated the /tmp
references to ~/tmp
in the bash script.)
This works. I'm not too familiar with all the ins and outs of permissions, but for whatever reason, it seems to be the permissions of the symlink (permissions of MacOS's /tmp
vs permissions of the ~/tmp
I created) that make the difference, since both symlinks point to the same private/tmp
folder.
Ok, I've got a weird one for you. Not super sure if this is a local error or something new. When I OCR something, I get an error in the notification rather than translated text. It looks like:
Seems to have started when I upgraded to from Alfred 4 to 5. I doubled checked that tesseract works on its own and that screencapture works on its own. Running
screencapture -i /tmp/ocr_snapshot.png
successfully creates an image successfully, but when I try the tesseract command it gives the same output. It appears tesseract can't see thetmp
file? I modified the script to create the file in~/Downloads
but I'm not sure why tesseract wouldn't have the permissions but screencapture would. Any ideas?The full debug log in Alfred is below for reference: