zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
3.68k stars 202 forks source link

BUG: Successive OCR of multiple different images on a single Excalidraw page not working #1790

Closed DavidFarago closed 1 month ago

DavidFarago commented 1 month ago

Your environment SYSTEM INFO: Obsidian version: v1.5.12 Installer version: v1.5.12 Operating system: #35-Ubuntu SMP PREEMPT_DYNAMIC Fri Apr 26 11:23:57 UTC 2024 6.5.0-35-generic Login status: not logged in Insider build toggle: off Live preview: on Base theme: adapt to system Community theme: none Snippets enabled: 0 Restricted mode: off Plugins installed: 2 Plugins enabled: 2 1: Git v2.24.1 2: Excalidraw v2.1.8

Describe the bug Successive OCR of multiple different images on a single Excalidraw page not working.

In the Excalidraw plugin, I want to use the following workflow: 1) Create an Excalidraw page 2) Add an image to the page 3) OCR that image 4) goto 2

Is there a way to perform the above workflow, i.e. select a single image on the page that will be OCRed?

Even though I can mark an image when clicking the OCR button, but Excalidraw then always behaves erranously:

Is this a feature request or a bug? Your video and https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1757 gave me the impression the Obsidian Excalidraw plugin can do this.

To Reproduce Steps to reproduce the behavior:

  1. Paste first image to the excalidraw page, e.g. IssueBugReport
  2. Mark the image and OCR it via tools panel
  3. Paste second image to the excalidraw page, e.g. WhenSomethingIsClearlyBroken
  4. See error message and check contents of taskbone-ocr metadata field (it only contains "Issue: Bug report".

Screenshot from 2024-05-22 09-55-39

Screenshot from 2024-05-22 09-54-46

Expected behavior The OCR result from the second image gets appended to the taskbone-ocr metadata field.

Screenshots see above

Additional context As workaround, I deleted the taskbone-ocr metadata field. Then when I mark both images and OCR them via tools panel, OCR is performed and the result put in the clipboard, but a taskbone-ocr metadata field with the OCR result is not written. Furthermore, I sometimes successively extend the excalidraw page and fix OCR results, so this workaround would be awful since I would need to fix the same wrong OCR result multiple times.

zsviczian commented 1 month ago

Which command palette action are you using?

The first one will simply capture text from selected elements and copy it to the clipboard. From your description it sounds as if you are using the second. The third option should cover something similar as described in your workaround.

image

DavidFarago commented 1 month ago

Thanks for the fast reply. "Excalidraw: OCR selected elements..." works great. I need to access that through Ctrl-P as it is not available in the tool popup, right? Screenshot from 2024-05-22 12-35-28

zsviczian commented 1 month ago

or you can assign an hotkey for that in Obsidian settings.