Bug 463177 - Feature rq: automatic image to text copying
Summary: Feature rq: automatic image to text copying
Status: RESOLVED DUPLICATE of bug 460320
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-18 01:29 UTC by ostap-tymur-tymchenko
Modified: 2023-04-30 19:50 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ostap-tymur-tymchenko 2022-12-18 01:29:01 UTC
### Why?
powertoys recently added this feature, and I understand why, every time I need to use this having to `take a ss> find an image to text website> paste/ upload image> wait for processing> download> and use` it makes me want to scream, and i think spectacle is a great tool for this, especially because it's the default kde tool.

### How?
Deciding on how to implement this is tricky, I think the best way to do it is in these two ways:
1 - have a keybinding modifier that takes a ss like normall but instead of copying the image to clipboard it copies the text, so if `ctl+shift+a` selects a windows and copies it than `ctl+shift+alt+a` copies the text instead.
2 - have a menu button to copy text
Comment 1 Nate Graham 2023-01-05 18:47:03 UTC

*** This bug has been marked as a duplicate of bug 460320 ***
Comment 2 akid.anis799 2023-04-25 04:20:47 UTC
as a workaround one could try to use this command for OCR with spectacle:

you could bind this command to a keybind in settings

For X11:
`spectacle --nonotify --region --background -o /proc/selt/fd/1 |  tesseract stdin stdout | xclip -in -selection clipboard`

For Wayland:
`spectacle --nonotify --region --background -o /proc/selt/fd/1 | tesseract stdin stdout | wl-copy`
Comment 3 ostap-tymur-tymchenko 2023-04-30 19:50:55 UTC
I attempted to run `spectacle --nonotify --region --background -o /proc/selt/fd/1 |  tesseract stdin stdout | xclip -in -selection clipboard` on an x11 system, and after fixing an error with not having tesseract installed, it not just says "Error during processing". I have tried a couple of different scenarios and in all cases that is what it says, with nothing being copied to clipboard.

(In reply to akid.anis799 from comment #2)
> as a workaround one could try to use this command for OCR with spectacle:
> 
> you could bind this command to a keybind in settings
> 
> For X11:
> `spectacle --nonotify --region --background -o /proc/selt/fd/1 |  tesseract
> stdin stdout | xclip -in -selection clipboard`
> 
> For Wayland:
> `spectacle --nonotify --region --background -o /proc/selt/fd/1 | tesseract
> stdin stdout | wl-copy`