Workshop: Hands-on IIIF how to install, configure and prepare - - PowerPoint PPT Presentation

workshop hands on iiif how to install configure and
SMART_READER_LITE
LIVE PREVIEW

Workshop: Hands-on IIIF how to install, configure and prepare - - PowerPoint PPT Presentation

Workshop: Hands-on IIIF how to install, configure and prepare simple IIIF services SWIB19 (http://swib.org/swib19/), 2019-11-25, Hamburg Leander Seige Isolated Image Presentations Library A Museum B Archive C Gallery D Presentation


slide-1
SLIDE 1

Workshop: Hands-on IIIF – how to install, configure and prepare simple IIIF services

SWIB19 (http://swib.org/swib19/), 2019-11-25, Hamburg Leander Seige

slide-2
SLIDE 2

Isolated Image Presentations

Images Metadata Presentation Webfrontend Library A Images Metadata Presentation Webfrontend Museum B Images Metadata Presentation Webfrontend Archive C Images Metadata Presentation Webfrontend Gallery D

slide-3
SLIDE 3

International Image Interoperability Framework

http://iiif.io

slide-4
SLIDE 4

The idea of IIIF: interoperable APIs for images

Images Metadata Presentation Website Gallery A Images Metadata Presentation Website Library B Images Metadata Presentation Website Archive C Images Metadata Presentation Website Museum D APIs

slide-5
SLIDE 5

IIIF Community

Consortium formed 2015 in Oxford

  • Stanford University Libraries
  • The British Library
  • Bodleian Libraries at Oxford
  • Bayerische Staatsbibliothek
  • Bibliothèque nationale de France
  • Vatican Libraries
  • 40+ members

Community

  • National Libraries
  • University Libraries
  • Museums, Archives
  • Internet Archive
  • u.v.m.

http://iiif.io/community

slide-6
SLIDE 6

Demo: Codex Sinaiticus

  • Manuscript of the Christian Bible
  • Written in the middle of the 4th century
  • Earliest complete copy of the New Testament
slide-7
SLIDE 7

Codex Vaticanus Graecus 1209

Screenshot Wikipedia Screenshot Vatikanische Bibliotheken

slide-8
SLIDE 8

Demo Codex Vaticanus und Codex Sinaiticus

Mirador: https://digital.ub.uni-leipzig.de Codex Sinaiticus (testing, Leipzig leaves only!) https://iiif.ub.uni-leipzig.de/0000000002/manifest.json https://digital.ub.uni-leipzig.de/object/viewid/0000000002 Codex Vaticanus https://digi.vatlib.it/iiif/MSS_Vat.gr.1209/manifest.json https://digi.vatlib.it/view/MSS_Vat.gr.1209/0001

slide-9
SLIDE 9

Demo: Papyrus Ebers

  • Papyrus scroll from Egypt
  • Age: > 3,500 years (from 16th century BC)
  • Description of 879 medical treatments
slide-10
SLIDE 10

Papyrus Ebers

Special requirements:

  • Unusual format (scroll): 18,63 m (20,37 yards) x 0,30 m (11,81 inches)
  • Integrate Mirador with Wordpress for static content
  • Translations for the whole text and in different languages
  • Search in annotations (linking not implemented yet)
  • Individual modifications of the layout

Demo: http://papyrusebers.de

slide-11
SLIDE 11

Demo: ANTLITZ.NINJA

  • combines IIIF images

from different sources

  • face regions are

annotations

slide-12
SLIDE 12
  • IIIF Image API 2.1 (“Core API”)
  • IIIF Presentation API 2.1 (“Core API”)
  • IIIF Search API 1.0
  • IIIF Authentication API 1.0

CC-BY, http://iiif.io/technical-details/

IIIF APIs (Version 2.x, Version 3 still beta but coming soon)

slide-13
SLIDE 13

Presentation API

slide-14
SLIDE 14

Presentation API (Version 2)

  • Structure

○ Collection, Item, Sequence, Parts

  • Properties

○ Labels, description, license, attribution, links

Bild: Tom Cramer, Stanford University Libraries

!

slide-15
SLIDE 15

Shared Canvas Data Model

  • Linked Data based approach (JSON-LD)
  • globally unique identifiers: HTTPS URIs

Bild: Dokumentation Shared Canvas Data Model http://iiif.io/model/shared-canvas/1.0/

slide-16
SLIDE 16

Top Level Collection

16

slide-17
SLIDE 17

Collection

17

slide-18
SLIDE 18

Manifest – Head

18

slide-19
SLIDE 19

Manifest – Sequence

19

link to Image API endpoint

slide-20
SLIDE 20

Manifest – Structures

20

slide-21
SLIDE 21

How to produce IIIF files?

  • several tools available:

https://github.com/IIIF/awesome-iiif#presentation-api-libraries https://github.com/IIIF/awesome-iiif#presentation-manifest-tools

  • ften individual solutions for institutional files, formats, services
  • some DAMS support IIIF

https://github.com/IIIF/awesome-iiif#digital-asset-management-dams-that-support-iiif

  • we’re going to use a tiny Python tool I created especially for this workshop
slide-22
SLIDE 22

Image API

slide-23
SLIDE 23

Image API (Pixel Delivery)

http://iiif.io/api/image/2.1/

Bild: Dokumentation IIIF Image API

slide-24
SLIDE 24

Image API – info.json

24

slide-25
SLIDE 25

Image API – example

25

slide-26
SLIDE 26

Image API implementations

Many different servers available http://iiif.io/apps-demos/#image-servers popular:

  • Cantaloupe (Java)
  • Loris (Python)
  • IIPImage Server ← we’re going to use this one

(as a FastCGI-Modul for Apache, GPLv3)

slide-27
SLIDE 27

Prepare Image Data

  • Tiled Multi-Resolution (or Tiled Pyramidal)
  • TIFF or JPEG2000
  • available conversion tools

○ TIFF/jpeg: ImageMagick (Open Source) ○ TIFF/jpeg: VIPS (Open Source) ○ JPEG 2000: Kakadu (commercial) ○ JPEG 2000: OpenJPEG (Open Source)

Bild: Dokumentation IIPImage Server

slide-28
SLIDE 28

use IIIF in your applications

Libraries (Image API):

  • Openseadragon
  • OpenLayers
  • diva.js

Libraries (Presentation API):

  • Manifesto (Javascript)

Viewers (Image API + Presentation API):

  • Mirador
  • Universal Viewer
  • TIFY
  • Kitodo.Presentation
slide-29
SLIDE 29
  • verview
slide-30
SLIDE 30

what we want to build today: your own IIIF server

your virtual machine

nginx /var/swib19/imageapi apache2 iipsrv.fcgi /var/swib19/presentationapi :1080 :443

slide-31
SLIDE 31

limitations

  • I show you one way to implement IIIF services – the one I have experience
  • with. There are many other ways and probably better ways to do it.
  • It is not planned to create collections (which I would strongly recommend for

production implementations). We concentrate on manifest files because most viewers work with them.

  • We use API versions 2.x (while 3.x is already on beta state)
  • We will not use existing structured metadata because we can’t deal with too

many different formats in this workshop that may come with your samples.

slide-32
SLIDE 32

steps

1. the virtual machine 2. prepare data 3. install nginx and configure ssl 4. test Presentation API 5. install apache and iipimage servers 6. test Image API 7. share data with other participants (optional: install Mirador 3 or manually create a collection file)

slide-33
SLIDE 33

raise your hand!

whenever

  • you have a question, a comment, a suggestion
  • I make a mistake
  • you feel that I say something wrong
  • you need help with an issue
slide-34
SLIDE 34

preparation

slide-35
SLIDE 35

conventions in this presentation

commands to enter expected output of commands text files to view or edit

”x.x.x.x” refers to your IP or reversed IP

slide-36
SLIDE 36

log in

ssh root@x.x.x.x follow instructions to set a new password … and remember your new password!

slide-37
SLIDE 37

know your DNS entry

# nslookup x.x.x.x x.x.x.x.in-addr.arpa name = static.x.x.x.x.clients.your-server.de

copy & paste your DNS entry to your locale machine, you will need it later!

slide-38
SLIDE 38

install your favorite editor

apt-get install vim

  • r

apt-get install nano

  • r

apt-get install mc

  • r…

(or attach your preferred remote editor via ssh/sftp/scp)

slide-39
SLIDE 39

get the workshop tools

cd /var git clone 'https://github.com/ubleipzig/swib19'

slide-40
SLIDE 40

prepare your data

slide-41
SLIDE 41

Image API

slide-42
SLIDE 42

upload your images

scp -rp myimages root@x.x.x.x:/var/swib19/imageapi/

slide-43
SLIDE 43

reorganize your images if necessary

cd /var/swib19/imageapi find . ./My_Example_Sequence ./My_Example_Sequence/001.jpg ./My_Example_Sequence/002.jpg ./My_Example_Sequence/003.jpg ...

manifest canvas

slide-44
SLIDE 44

just in case...

https://commons.wikimedia.org/wiki/Category:High-resolution

slide-45
SLIDE 45

convert images

images: wikimedia commons and iipimage documentation

JPEG TIFF Pyramide

slide-46
SLIDE 46

we use VIPS for image conversion

apt install libvips-tools imagemagick

(also possible with openjpeg, kakadu and other tools)

https://libvips.github.io/libvips/

slide-47
SLIDE 47

convert your images

cd /var/swib19/ ./convert_images.sh

slide-48
SLIDE 48

[optional] check your images

identify imageapi/folder/image.jpg.ptif

imageapi/folder/image.jpg.ptif[0] TIFF 2160x2880 2160x2880+0+0 8-bit sRGB 20.67MB... imageapi/folder/image.jpg.ptif[1] TIFF 1080x1440 1080x1440+0+0 8-bit sRGB 20.67MB... imageapi/folder/image.jpg.ptif[2] TIFF 540x720 540x720+0+0 8-bit sRGB 20.67MB... imageapi/folder/image.jpg.ptif[3] TIFF 270x360 270x360+0+0 8-bit sRGB 20.67MB... imageapi/folder/image.jpg.ptif[4] TIFF 135x180 135x180+0+0 8-bit sRGB 20.67MB... imageapi/folder/image.jpg.ptif[5] TIFF 67x90 67x90+0+0 8-bit sRGB 20.67MB... imageapi/folder/image.jpg.ptif[6] TIFF 33x45 33x45+0+0 8-bit sRGB 20.67MB...

slide-49
SLIDE 49

Presentation API

slide-50
SLIDE 50

metadata

  • in this workshop we will not convert from any kind of

structured metadata files

  • instead we just use the names of files and folders to

generate minimal metadata

  • for real use cases you want to generate IIIF manifests and

collection files from your structured metadata

slide-51
SLIDE 51

install Python (and opencv for reading image files )

apt-get install python python-opencv python-pil

slide-52
SLIDE 52

set configuration for IIIF

vi config.json

slide-53
SLIDE 53

make_iiif.py explain

slide-54
SLIDE 54

manifest template

slide-55
SLIDE 55

canvas template

slide-56
SLIDE 56

create IIIF presentation API data

./make_iiif.py

writing: presentationapi/manifests/7d1e1d50136005e34571d46c317e435f.json writing: presentationapi/manifests/1640fcf387ddb8292ff5fbfe8cd4a49e.json writing: presentationapi/manifests/64cd8dd84baed44ba372d5a6cd4d097e.json

slide-57
SLIDE 57

proxy server nginx

slide-58
SLIDE 58

we use nginx as our front door – why?

  • high performance web/proxy server and easy to configure
  • handle SSL and CORS for all components
  • easy URL manipulation / beautification
  • extensible infrastructure to load balance multiple servers
slide-59
SLIDE 59

install nginx

apt-get install nginx

slide-60
SLIDE 60

basic configuration

cd /etc/nginx/sites-enabled rm default vi iiif.conf

server { server_name static.x.x.x.x.clients.your-server.de; listen 80; root /var/www/html/; }

slide-61
SLIDE 61

set minimal content

echo "Hello IIIF!" > /var/www/html/index.html service nginx restart

slide-62
SLIDE 62

test your webserver

  • pen http://static.x.x.x.x.clients.your-server.de

in your web browser

slide-63
SLIDE 63

SSL

We want SSL for all our resources so they can be used in other SSL based application!

slide-64
SLIDE 64

install certbot

apt-get install certbot python-certbot-nginx https://letsencrypt.org

slide-65
SLIDE 65

certbot --nginx --register-unsafely-without-email answer: ➔ (A)gree ➔ (1) select the only option ➔ (2) yes, redirect all traffic from port 80 to port 443 service nginx restart

let certbot work for us

slide-66
SLIDE 66

test your secure webserver

  • pen https://static.x.x.x.x.clients.your-server.de

in your web browser

slide-67
SLIDE 67

serve our manifests – with CORS

in /etc/nginx/sites-enabled/iiif.conf in the port 443 section:

service nginx restart

slide-68
SLIDE 68

@id → Browser URI

less /var/swib19/presentationapi/manifests/03s...2a0.json { "@context": "http://iiif.io/api/presentation/2/context.json", "@id":"https://static.x.x.x.x.clients.your-server.de/ manifests/03s..2a0.json",

slide-69
SLIDE 69
slide-70
SLIDE 70
slide-71
SLIDE 71

https://iiif.io/api/presentation/validator/service/

slide-72
SLIDE 72

apache webserver and iipimage

slide-73
SLIDE 73

install apache2 and iipimage

apt-get install apache2 iipimage-server (ignore errors, nginx is already using the ports 80 and 443, we will fix this later) cd /etc/apache2

slide-74
SLIDE 74

move apache2 to other ports

because nginx is already using 80 and 443

vi ports.conf

slide-75
SLIDE 75

move apache2 to other ports

because nginx is already using 80 and 443

vi sites-enabled/000-default.conf

slide-76
SLIDE 76

turn on fcgid and iipsrv mods

a2enmod iipsrv a2enmod fcgid (probably already enabled)

slide-77
SLIDE 77

configure iipsrv

vi /etc/apache2/mods-enabled/iipsrv.conf service apache2 restart

slide-78
SLIDE 78

connect nginx and apache2

vi /etc/nginx/sites-enabled/iiif.conf service nginx restart

slide-79
SLIDE 79
  • pen the manifest again in your browser

find the a service:{ } block and open the URI in @id

slide-80
SLIDE 80

append info.json to the URI

slide-81
SLIDE 81

play with the Image API

slide-82
SLIDE 82

append: ...38.jpg.ptif/full/full/0/default.jpg

slide-83
SLIDE 83

append: ...38.jpg.ptif/full/200,/0/default.jpg

slide-84
SLIDE 84

append: ...38.jpg.ptif/full/600,/0/default.jpg

slide-85
SLIDE 85

...38.jpg.ptif/400,400,800,800/600,/0/default.jpg

slide-86
SLIDE 86

...38.jpg.ptif/400,400,800,800/600,/270/default.jpg

slide-87
SLIDE 87

load our manifest in a IIIF viewer

slide-88
SLIDE 88

https://mirador-dev.netlify.com

1 - press the big PLUS button 2 - press ADD RESOURCE 3 - paste your manifest URI and ADD it

slide-89
SLIDE 89

share data with others

paste links to your manifests here:

https://pad.okfn.de/p/swib19iiif

slide-90
SLIDE 90
  • ptional: install Mirador 3
slide-91
SLIDE 91

get everything and build Mirador 3

apt-get install git npm cd /var/www/html git clone 'https://github.com/ProjectMirador/mirador' cd mirador npm install npm run build

slide-92
SLIDE 92
  • pen your Mirador 3 instance

https://static.x.x.x.x.clients.your-server.de/mirador/__tests__/integration/mirador/

slide-93
SLIDE 93

Checklist

  • send CORS headers on all resources
  • use HTTPS everywhere
  • ffer links to IIIF manifests in your catalog / discovery system
  • ffer IIIF collection files
  • make clear license statements
  • Psst: cool URIs don’t change!
slide-94
SLIDE 94

Attend IIIF events! https://iiif.io/event/

slide-95
SLIDE 95

Thank You!

Leander Seige E-Mail: seige@ub.uni-leipzig.de Twitter: @mjkls Web: www.ub.uni-leipzig.de

further reading: http://iiif.io https://github.com/IIIF/awesome-iiif get involved: https://iiif.io/community

  • IIIF Community Google Drive
  • IIIF Community Calendar