nicooprat / alfred-ocr

Take a snapshot and recognize text
MIT License
65 stars 7 forks source link

Warning: Invalid resolution 0 dpi. Using 70 instead. #7

Closed GJRobert closed 3 years ago

GJRobert commented 4 years ago

Hi, I have encountered this message in front of the result text:

Warning: Invalid resolution 0 dpi. Using 70 instead.
Estimating resolution as 209
nicooprat commented 4 years ago

I guess you took the screenshot from a secondary monitor with a different DPI. I’ve no clue how to solve this. The simplest is to move your app window on the main monitor and take the screenshot from here ;)

-- Nico Prat nicooprat@gmail.com @nicooprat Le 11 déc. 2019 à 16:00 +0100, GHSRobert Ciang notifications@github.com, a écrit :

Hi, I have encountered this message in front of the result text: Warning: Invalid resolution 0 dpi. Using 70 instead. Estimating resolution as 209 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

GJRobert commented 4 years ago

Hi, I was using OCR workflow on my laptop, which has only one monitor though...

Should I consult with other related projects on this issue?

nicooprat commented 4 years ago

That’s weird, I never encountered this issue on my main monitor. Yes please post the solution here for others if you find it.

-- Nico Prat nicooprat@gmail.com @nicooprat Le 13 déc. 2019 à 23:36 +0100, GHSRobert Ciang notifications@github.com, a écrit :

Hi, I was using OCR workflow on my laptop, which has only one monitor though... Should I consult with other related projects on this issue? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

bergmul commented 3 years ago

I provided a pull request to solve the problem and #4.

nicooprat commented 3 years ago

Feel free to close the issue if the PR fixed your issue 👍

GJRobert commented 3 years ago

I have tried to import the latest OCR.workflow but Alfred reports incompatible. My Alfred version is 3.7.1.

nicooprat commented 3 years ago

Damn, I'm using Alfred 4 indeed. Could you download the previous one, and change the bash script?

image

image

export PATH=/usr/local/bin/:$PATH

screencapture -i /tmp/ocr_snapshot.png

if [{query} = ""]; then
tesseract --dpi 300 /tmp/ocr_snapshot.png  stdout 2>&1
else
tesseract --dpi 300 /tmp/ocr_snapshot.png stdout  -l {query} 2>&1
fi 
GJRobert commented 3 years ago

Damn, I'm using Alfred 4 indeed. Could you download the previous one, and change the bash script?

Alright then, changing the script directly in Alfred Preferences does the work. Working like a charm. Thanks a million!