Skip to content

Instantly share code, notes, and snippets.

@edsilv
Last active March 7, 2018 16:30
Show Gist options
  • Save edsilv/97759a93cb7c5f0fedb8178fee5e1dd3 to your computer and use it in GitHub Desktop.
Save edsilv/97759a93cb7c5f0fedb8178fee5e1dd3 to your computer and use it in GitHub Desktop.

This is a quick guide to using IPFS as a file store for your IIIF "level 0" image service tiles.

Clone https://github.com/zimeon/iiif

Follow the install instructions

Regenerate the tetons tiles and info.json: https://github.com/zimeon/iiif/tree/master/demo-static#regerating-tiles

ipfs add -r tetons

copy hash1 of tetons

replace tetons/info.json @id with https://ipfs.io/ipfs/<hash1>

The info json must reference its parent directory in order for OSD to be able to load the tiles. This means we have to hash it again in order to have the correct info.json to refer to in our manifest. Does this just mean that we have an extra hash "out there" for the directory containing the old info.json, with the tiles subtree remaining the same?

ipfs add -r tetons

copy hash2 of tetons

point your tetons.json manifest's level 0 image service to hash2

"service": {
  "@context": "http://iiif.io/api/image/2/context.json",
  "@id": "https://ipfs.io/ipfs/<hash2>",
  "profile": "http://iiif.io/api/image/2/level0.json"
}

ipfs add tetons.json

copy hash 3 of tetons.json

open https://ipfs.io/ipfs/<hash3> in the UV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment