ocrs icon indicating copy to clipboard operation
ocrs copied to clipboard

Add clipboard support to CLI

Open Exotik850 opened this issue 1 year ago • 2 comments

Integrates the clipboard-rs crate to enable direct clipboard image import functionality as an alternative input method alongside existing file path support. Implementation includes proper error handling, platform-specific clipboard access, and graceful feedback whenever both clipboard and file inputs are in the arguments. This enhancement significantly improves user experience by eliminating the need for manual file path input or image saving, streamlining the workflow for users who frequently process screenshots or web images.

Exotik850 avatar Oct 29 '24 18:10 Exotik850

Hello. Thanks for the contribution. This seems like a useful feature. Since it does add significant new dependencies which may not be needed or available on some systems I would like it to be behind a crate feature (clipboard). Also I would prefer to use arboard as the dependency to read the clipboard. I can't see anything wrong with clipboard-rs from skimming the code, but since there is a lot of platform-specific / unsafe code in there, I'd prefer to have something with as many eyeballs on it as possible.

robertknight avatar Oct 31 '24 12:10 robertknight

I like arboard much more as a dependency as well, I'd also like to implement outputting to the clipboard as well in the future but that may be outside the scope of this PR

Exotik850 avatar Oct 31 '24 17:10 Exotik850