IMAGE TAGGING
The Image Tagging extension extracts the text from an image and outputs it into Roam! The name of the script is image-tagging
.
Installation
You could use the Copy Extension button below to individually install this extension. To install, just paste anywhere in your Roam graph and click "Yes, I Know What I'm Doing".
Manual Installation
If instead you prefer to manually install, first create a block with the text {{[[roam/js]]}}
on any page in your Roam DB. Then, copy and paste this code block as a child of the block.
var existing = document.getElementById("image-tagging");
if (!existing) {
var extension = document.createElement("script");
extension.src = "https://roamjs.com/image-tagging.js";
extension.id = "image-tagging";
extension.async = true;
extension.type = "text/javascript";
document.getElementsByTagName("head")[0].appendChild(extension);
}
Usage
The script supports the following configuration attributes, to be added in the [[roam/js/image-tagging]]
page:
Trigger
- (Optional) The action to do on an image to extract a text. Valid values includeDOUBLE CLICK
,SHIFT CLICK
, andICON CLICK
. By default, it usesDOUBLE CLICK
.
Double click on an image in your database. The extension will use an OCR library to extract all the text found in an image. In the meantime, it will insert a "Loading..." text as a child block. Once the extension finishes, it will replace the Loading text with all the new text it parsed from the image.
If the text begins with a bullet or dash on a line, the bullet will be stripped, leaving the rest of the text content.