zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
4.08k stars 221 forks source link

BUG: OCR with taskbone - recognized handwritten letters do not get added to frontmatter #1123

Open KKassem opened 1 year ago

KKassem commented 1 year ago

Your environment SYSTEM INFO: Obsidian version: v1.2.7 Installer version: v0.14.15 Operating system: Windows 10 Pro 10.0.19044 Login status: not logged in Insider build toggle: off Live preview: on Legacy editor: off Base theme: dark Community theme: none Snippets enabled: 0 Restricted mode: off Plugins installed: 1 Plugins enabled: 1 1: Excalidraw v1.8.26

Describe the bug Running taskbone OCR on a drawing with handwritten letters, successfully copied to clipboard, but not to frontmatter.

To Reproduce Steps to reproduce the behavior:

  1. Open a new excalidraw drawing
  2. Use the default drawing pen to draw a number of Latin letters
  3. Run taskbone OCR on the drawing
  4. Check the frontmatter of the markdown version of the drawing

Expected behavior The frontmatter contains the recognized handwritten characters/letters from the drawing

Screenshots Screenshot, exported .png, and raw markdown file attached

Additional context Tried this on a blank vault with only excalidraw installed, to check if other plugins caused the issue.

Drawing 2023-05-09 12 21 49 excalidraw Drawing 2023-05-09 12.21.49.excalidraw.md taskbone_run missing_frontmatter

zsviczian commented 1 year ago

I'm just double checking: Did you run this action from the command palette and/or from the Tools Panel? I am asking because there is also an old OCR script in the script library that also works but does not copy the result to the front matter.

I tested it just now and it worked as expected for me.

image

image

KKassem commented 1 year ago

Yes, I tried both methods (command palette and tools panel). The output is the same every time. Unless I am doing something completely wrong, then I think it does not work for me. I am also attaching a recreation of the steps as a .gif. steps

chadarmstrong-cbsi commented 1 year ago

@KKassem @zsviczian I also have this issue, and stumbled upon this issue report via google. Diving in, I found that if I added a 'true' as the second parameter here: https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/de5b8b64a6c208a057da5c893a88a1f1caa9304f/src/ocr/Taskbone.ts#L98 .. it started working for me, and the frontmatter text is now present. Seems like a 'force' parameter to the view.save method? Not sure of any greater issue here of course, but I could find and add to the minified plugin js. :)

miscelly commented 3 months ago

Update: I discovered that selecting the "save" button in the toolbar (where the OCR button is) will save the info so that it is searchable. Apologies if this was posted elsewhere and I missed it. I wanted to post it here in case anyone else has the same problem.


I'm having the same issue using Obsidian in Linux (Fedora) and on an iPad. I could not find that Taskbone file.ts in my system, but I also don't know if Obsidian files in Linux should have the same setup, or if that file is even part of the plugin any more. Has anyone found an alternate way to resolve this? This was the only place I could find where others mentioned having the same issue.