📑

mdx.jpのオブジェクトストレージとIIP Image(IIIF Image Server)を使ってIIIF画像を配信する

2025/03/07に公開

概要

mdx.jpのオブジェクトストレージとIIP Image(IIIF Image Server)を使ってIIIF画像を配信する試行の備忘録です。

以下の記事の続きです。

https://zenn.dev/nakamura196/articles/3ea10491fbbf4d

Docker版IIP Image

以下で、IIPImage serverのDocker Imageが公開されていましたので、こちらを使います。

https://hub.docker.com/r/iipsrv/iipsrv

以下の記事などを参考に、Dockerをインストールします。

https://qiita.com/Marron-chan/items/570c7c7baaae3b4d6b11

実行

前回の記事に倣い、以下のようにmdx.jpのオブジェクトストレージをマウントします。

s3fs satoru196 ~/s3mount   -o passwd_file=~/.passwd-s3fs   -o url=https://s3ds.mdx.jp   -o use_path_request_style -o allow_other

注意点として、前回の記事から、-o allow_otherを追加しています。これを追加しないと、次のコンテナ起動時に以下のエラーが発生しました。

docker: Error response from daemon: error while creating mount source path '~/s3mount/iip/images': mkdir ~/s3mount: file exists

Run 'docker run --help' for more information

-o allow_otherオプションを追加した上で、以下を実行します。無事に起動しました。

docker run -it -p 9000:9000 -p 8080:80 -v ~/s3mount/iip/images/:/images --rm iipsrv/iipsrv

<----------------------------------->
Thu Mar  6 22:35:43 2025

IIPImage Server. Version 1.2
*** Ruven Pillay <ruven@users.sourceforge.net> ***

Verbosity level set to 5
Running in standalone mode on socket: 0.0.0.0:9000 with backlog: 2048

Setting maximum image cache size to 10MB
Setting filesystem prefix to '/images/'
Setting filesystem suffix to ''
Setting default JPEG quality to 75
Setting default PNG compression level to 1
Setting default WebP compression level to 50
Setting maximum CVT size to 5000
Setting HTTP Cache-Control header to 'max-age=86400'
Setting 3D file sequence name pattern to '_pyr_'
Setting default IIIF Image API version to 3
Setting Allow Upscaling to true
Setting ICC profile embedding to true
Setting up JPEG2000 support via OpenJPEG
Setting image processing engine to CPU processor
OpenMP enabled for parallelized image processing with 2 threads
Setting URI mapping to iiif=>IIIF. Supported protocol: IIIF
Memcached support enabled. Connected to servers: 'localhost' with timeout 86400


Initialisation Complete.
<----------------------------------->

そして、今回の設定では、オブジェクトストレージの/satoru196/iip/imagesにtiled multi-resolution pyramid TIFFファイルを格納し、以下のようなURLでアクセスできることを確認します。

http://<IPアドレス>:8080/iiif/image.tif/info.json

まとめ

IIPImage Serverとmdx.jpのオブジェクトストレージを組み合わせることまではできました。ただ、どの程度の応答速度が出るのか等は未検証です。引き続き、実験などをしてみたいと思います。

参考になりましたら幸いです。

Discussion