lucasvanmol / obsidian-latex-ocr

Generate LaTeX equations from images in your clipboard or vault
GNU General Public License v3.0
86 stars 4 forks source link

[Discussion] "Cound't find image in clipboard" in Linux #25

Closed MrTree302 closed 7 months ago

MrTree302 commented 7 months ago

OS:

Ubuntu 22.04

Discription:

after copying a image and use the configured shortcut keys in Obsidian, I only get the warning "Coudn't find image in clipboard".

Solution:

The basic problem is that on Linux, the clipboard only stores a reference to the underlying data instead of the real binary data. So after the code runs, the type of file (file = await navigator.clipboard.read();) is just plain text. To solve this problem, instead of using the default system screenshot tool, I ultilize the tool "flameshot" (maybe other tools are also available), which allows me to capture screenshots and store the real image data in the clipboard. I know this is nothing to do with the plugin itself, so I just want to offer a solution for our linux user who may meet this problem. Maybe there are better solutions, please please let me know!

lucasvanmol commented 7 months ago

Thanks for finding this solution!