Run the following script to generate assets
./scripts/setup.sh
See https://womanonrails.com/adding-yarn-package-from-github on how to add a specific revision.
Mirador 3 is not really feature complete, even though it's tagged as a Release Candidate (read a good definition on Wikipedia - I would like to add that the definition of "code complete" is not completely up to the developers to decide when implementing a specification, see RFC 2119).
The following changes need to be applied to make Mirador usable for this use case.
- Thumbnails won't be displayed if they're static #3330
- Check if using a method from a polyfill is the right approach #3311
- Mirador can't display non-paged viewing hints #3029
These patches are combined in one file in patches
.
Currently yarn will will pull Mirador directly from GitHub, not NPM. It applies the patches and rebuilds the viewer with these patches applied.
Mirador dependends on Manifesto.js to use a object model on top of the manifest's JSON. But here is at least one method missing to get the viewing hints. The patch manifesto.js+4.2.0.patch
adds this missing method. It's required to get #3029 to work.
See #77.
Interestingly WebP yields better results for digitized material, when using a lossless compression, then JPEG2000. Just set the following options:
convert 0001.tif -define webp:method=6 -define webp:lossless=true -quality 100 0001-im.webp
(It's very, very slow)
WebP Options for ImageMagick, WebP Options for cwebp
find . -name '*.tif' -depth 1 -print -exec tiff2rgba {} {}-uc.tif \;
find . -name '*-uc.tif' -depth 1 -print -exec convert {} -quality 95 {}.jpg \;
find . -name '*-uc.tif' -print -exec rm "{}" \;
find . -name '*.tif.jpg' -print -exec bash -c 'mv "{}" $(dirname "{}")/$(basename -s .tif-uc.tif.jpg "{}").jpg' \;
Use depth
to exclude original images.
vips copy in.tif out.jxl
We start to use [LibVIPS]https://github.com/libvips/libvips(), since it's very fast:
On Mac OS X just run:
brew install vips
vips dzsave front.jpg front -t 512 --layout iiif --id '.'
URL_PREFIX=http://localhost:1313/ ./scripts/iiif.sh
find content/post/ -name info.json -exec dirname {} \; | xargs rm -r
find . -path '*/orig/*.tif' -print -exec convert "{}" -define webp:lossless=true "{}.webp" \;
/usr/local/bin/hugo server -D --debug --disableFastRender --renderToDisk
This might be needed if there are to many sub directories (with IIIF structures) generated, since watching might not work in this setup. This stopped to work reliably between Hugo 0.79.0 and 0.81.0
hugo serve -F --debug --disableFastRender --disableLiveReload --watch=false --renderToDisk
docker run --name hugo -v `pwd`/docs:/usr/share/nginx/html -p 1313:80 nginx