Skip to content

Instantly share code, notes, and snippets.

View rsimon's full-sized avatar

Rainer Simon rsimon

View GitHub Profile
{
"@context": "http://iiif.io/api/presentation/3/context.json",
"id": "https://iiif.io/api/cookbook/recipe/0001-mvm-image/manifest.json",
"type": "Manifest",
"label": {
"en": [
"Example Level 0 Image"
]
},
"items": [
@rsimon
rsimon / angel.json
Last active January 25, 2025 10:11
angel.json
{"@context":"http://iiif.io/api/presentation/3/context.json","id":"http://2230b103-6bf8-427e-9899-80d382d5aee9","type":"Manifest","rights":"http://creativecommons.org/licenses/by/3.0/","label":{"none":["Chevron cats test"]},"requiredStatement":{"label":{"none":["Attribution"]},"value":{"none":["Alice McGrath"]}},"summary":{"en":["two cats on a quilt"]},"items":[{"id":"http://0cdf8068-5282-4183-bd98-3e23c53168f8","type":"Canvas","height":480,"width":640,"label":{"none":["Chevron cats"]},"annotations":[{"id":"http://0cdf8068-5282-4183-bd98-3e23c53168f8/page/p1","type":"AnnotationPage","items":[{"id":"https://cboucher01.github.io/pta-iiif-sandbox/annotations/chev-cats-annotations.json","type":"AnnotationPage","label":{"none":["Annotated by Alice, Cameron, and Hilde"]}},{"id":"http://0cdf8068-5282-4183-bd98-3e23c53168f8/d0370002-cadc-4e42-a272-f2f60cd34fe5","type":"Annotation","motivation":"commenting","body":[{"created":"2025-01-24T20:03:49.227Z","creator":"Alice Tweedy McGrath","purpose":"commenting","type":"Te
@rsimon
rsimon / brunnen.json
Created January 15, 2025 06:17
Brunnen example
{
"@context": "http://iiif.io/api/presentation/3/context.json",
"id": "https://iiif.io/api/cookbook/recipe/0261-non-rectangular-commenting/manifest.json",
"type": "Manifest",
"label": {
"en": [
"Picture of Göttingen taken during the 2019 IIIF Conference"
]
},
"items": [
@rsimon
rsimon / simple-image.json
Last active January 15, 2025 06:32
Test Manifest
{
"@context": "http://iiif.io/api/presentation/3/context.json",
"id": "https://iiif.io/api/cookbook/recipe/0001-mvm-image/manifest.json",
"type": "Manifest",
"label": {
"en": [
"Single Image Example"
]
},
"items": [
{"@context":"http://iiif.io/api/presentation/3/context.json","id":"https://www.goudatijdmachine.nl/omeka/iiif/2/13/manifest","type":"Manifest","viewingDirection":"left-to-right","rights":"http://rightsstatements.org/vocab/CNE/1.0/","metadata":[{"label":{"none":["Naam"]},"value":{"none":["Gemeente-Atlas van Nederland naar officieele bronnen bewerkt, Gouda (1865-1870)"]}},{"label":{"none":["Plaats vervaardigd"]},"value":{"none":["<a class=\"resource-link\" href=\"https://www.goudatijdmachine.nl/omeka/s/data/item/37823\"><span class=\"resource-name\">Gouda</span></a>"]}},{"label":{"none":["Uitgever"]},"value":{"none":["<a class=\"resource-link\" href=\"https://www.goudatijdmachine.nl/omeka/s/data/item/37866\"><span class=\"resource-name\">Nationaal Archief</span></a>"]}},{"label":{"none":["Collectie"]},"value":{"none":["<a class=\"uri-value-link\" target=\"_blank\" href=\"https&#x3A;&#x2F;&#x2F;www.nationaalarchief.nl&#x2F;onderzoeken&#x2F;zoeken&#x3F;activeTab&#x3D;map_legacy\">Kaarten Zuid-Holland</a>"]}},{"la
@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) {