Closed luckman212 closed 1 year ago
Yeah, I had this in longterm to-do list for awhile now, let me work on that.
@luckman212 give it a try please https://github.com/amebalabs/TRex/releases/tag/v1.6.0-BETA-1
@melonamin Hmm. It's not working for me. It does not appear to do anything... no error message, nothing is printed or copied to the clipboard. ?
example image
/Applications/TRex.app/Contents/MacOS/cli/trex --image-path /path/to/that.png
Yeah, I see. Looks like #25 works but the CLI doesn't, looking into it
Thanks, I tried a different image with normal text in it, also didn't seem to do anything. Will stay tuned for any update!
@luckman212 This one should work, plz try TRex.app.zip
@melonamin Hmm. Sorry but no, that's not working for me either... tried a regular PNG image containing text as well as a QR code. Output is nothing, nothing on console, nothing on clipboard.
Just so you don't think I'm crazy
https://user-images.githubusercontent.com/222100/193422485-e4d417bf-8c93-45d7-9808-1f1869b5e9a6.mp4
Ok, I tested it on another machine and it doesn't work. As usual it is the case of "works fine on my machine!". Digging.
Hey @luckman212
So, macOS Sandboxing is a pain in the ... I've changed the cli to accept files from stdin, you can run it like this:
cat /path/to/image | /Applications/TRex.app/Contents/MacOS/cli/trex -i
Let me know if this works for you. TRex.app.zip
Hi @melonamin Yes, this test build works 🎉 passing the image file directly via stdin. But I want to point to a simple repo I found that does work fine taking file args directly. I didn't encounter any sandbox issues. Maybe you've already seen it: tinyocr (if not, could be useful to see how they're doing it)
could be useful to see how they're doing it
They are not doing anything and they don't need to, since they don't ditribute a binary and ask you to build it yourself. In this case you don't have any restrictions.
In case of TRex I'm ditributing in two channels:
First one requires hardening, signing and notarization, otherwise macOS will yell at you when you try launching the app. The App Store one requires Sanboxing - which limits files access severely. You can do a whole dance with "Require Full Disk Access" permissions but I don't think it worth it.
Anyway, it is more about how it packaged and distributed.
I understand, forgot you are distributing on MAS as well. In that case, yes this works perfectly & thank you again for working this out!
Trex is amazing! 🦖 🚀
My one gripe is not being able to use the command-line app to perform OCR on an image that's already on my disk.
e.g.
My kludgy workaround for this is copying the image to the clipboard with impbcopy and then using the
--clipboard
option. But that's pretty ugly.