Skip to content

Instantly share code, notes, and snippets.

View rsimon's full-sized avatar

Rainer Simon rsimon

View GitHub Profile
@rsimon
rsimon / pdf-test.json
Created November 13, 2026 11:18
pdf-test.json
{
"@context": "http://iiif.io/api/presentation/3/context.json",
"type": "Manifest",
"id": "http://localhost:5173/manifest/0001",
"label": {
"en": [
"Reconstructed Manuscript"
]
},
"summary": {
{
"@context": "http://iiif.io/api/presentation/3/context.json",
"type": "Manifest",
"id": "http://localhost:5173/manifest/0001",
"label": {
"en": [
"Reconstructed Manuscript"
]
},
"summary": {
@rsimon
rsimon / record-sample.json
Last active August 26, 2022 09:00
An example record list (with a single record)
[
{
"@id": "http://www.example.com/access-link",
"title": "Record title",
"type": {
"label": "Video"
},
"descriptions": [
{
"value": "This record's description",
@rsimon
rsimon / linked-places-sample.json
Last active August 26, 2022 08:48
A Peripleo-compatible "gazetteer" (with a single LP place record)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rsimon
rsimon / App.jsx
Last active April 25, 2021 11:30
Minimal example for using https://annotorious.com in React
import { useEffect, useRef, useState } from 'react';
import { Annotorious } from '@recogito/annotorious';
import '@recogito/annotorious/dist/annotorious.min.css';
function App() {
// Ref to the image DOM element
const imgEl = useRef();
@rsimon
rsimon / annotorious-opencv-find-contours.js
Last active March 1, 2024 08:00
Sample code for AnnotoriousOSD that automates polygon selection by tracing contours in the selected image section.
import OpenSeadragon from 'openseadragon';
import * as Annotorious from '@recogito/annotorious-openseadragon';
import '@recogito/annotorious-openseadragon/dist/annotorious.min.css';
/*************************************************************************
*
* Basic concept for this is from the official OpenCV docs:
* https://docs.opencv.org/3.4/dc/dcf/tutorial_js_contour_features.html
*
@rsimon
rsimon / annotorious-helloworld-plugin.js
Created September 11, 2020 09:45
Annotorious/Recogito 'Hello World' Example plugin
var HelloWorldPlugin = function(args) {
var currentColorBody = args.annotation ? args.annotation.bodies.find(function(b) {
return b.purpose == 'highlighting';
}) : null;
var currentColorValue = currentColorBody ? currentColorBody.value : null;
var addTag = function(evt) {
if (currentColorBody) {
@rsimon
rsimon / annotorious-firebase.html
Last active December 16, 2023 20:19
Using Firebase as Annotation Backend for Annotorious
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Annotorious | Firebase Demo</title>
<link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet">
<style>
html, body {
padding:20px;
margin:0px;
@rsimon
rsimon / webanno_example.md
Last active November 21, 2019 14:31
Recogito IIIF + WebAnno example
{
"annotation_id":"e8698b97-1722-49ee-9752-c8a4ae2863ba", # UUID for this annotation
"version_id":"6c89639b-87c7-4f75-8f37-96212e8eef36", # separate UUID for this specific version
"annotates":{
"document_id":"7tqppvg1uo4qdo", # ID & content type of document/filepart the annotation annotates
"filepart_id":"5db80aa5-8a27-4539-aeb3-bddf3abc0098",
"content_type":[
"TEXT",
"TEXT_PLAIN"
]