Cases Where ImageMagick May Not Work Properly for Creating Pyramidal TIFFs?

Overview I investigated cases where ImageMagick does not work properly when creating pyramidal TIFFs for IIIF image delivery. References Conversion methods are explained on pages like the following. https://samvera.github.io/serverless-iiif/docs/source-images#creating-tiled-tiffs Using the VIPS command line # For a 3-channel source image vips tiffsave source_image.tif output_image.tif --tile --pyramid --compression jpeg --tile-width 256 --tile-height 256 # For a source image with an alpha channel vips extract_band source_image.tif temp_image.v 0 --n 3 \ && vips tiffsave temp_image.v output_image.tif --tile --pyramid --compression jpeg --tile-width 256 --tile-height 256 \ && rm temp_image.v Using ImageMagick convert source_image.tif -alpha off \ -define tiff:tile-geometry=256x256 \ -define tiff:generate-pyramids=true \ -compress jpeg \ 'ptif:output_image.tif' Target Data The following image was used. ...

March 11, 2025 · 4 min · Nakamura

Running ArchivesSpace with Docker

Overview I had an opportunity to run ArchivesSpace with Docker, so here are my notes. Method Instructions are described at the following link. https://docs.archivesspace.org/administration/docker/ Clone and start the containers as follows. git clone https://github.com/archivesspace/archivesspace cd archivesspace docker compose up --detach The documentation states the following, but I was able to access the Public User interface on port 3001, the Staff User Interface on port 3000, and the backend system on port 4567. ...

March 11, 2025 · 1 min · Nakamura

Storing Omeka S Files in mdx.jp Object Storage

Overview This is a memo on how to store Omeka S files in mdx.jp object storage. Base Module We use the following module as a base, which enables integration with Amazon S3. https://omeka.org/s/modules/AmazonS3/ This module provides an extension for storing media files such as images and videos handled by Omeka S in Amazon S3. However, since it did not support specifying an endpoint, it was not possible to target object storage services like mdx.jp. ...

March 7, 2025 · 2 min · Nakamura

Serving IIIF Images Using mdx.jp Object Storage and IIP Image (IIIF Image Server)

Overview This is a note on my experiment with serving IIIF images using mdx.jp object storage and IIP Image (IIIF Image Server). This is a continuation of the following article. Docker Version of IIP Image A Docker image for the IIPImage server is available at the following link, so I will use that. https://hub.docker.com/r/iipsrv/iipsrv Refer to the following article and others for installing Docker. https://qiita.com/Marron-chan/items/570c7c7baaae3b4d6b11 Execution Following the previous article, mount the mdx.jp object storage as follows. ...

March 7, 2025 · 2 min · Nakamura

How to Mount mdx.jp Object Storage as a File System Using s3fs

Overview I had the opportunity to mount mdx.jp object storage as a file system using s3fs, so this is a memo of the process. 1. Prerequisites This guide targets Ubuntu. Installing s3fs sudo apt update sudo apt install s3fs Setting up authentication credentials Save the access key and secret key for mdx.jp object storage to ~/.passwd-s3fs. echo “ACCESS_KEY:SECRET_KEY” > ~/.passwd-s3fs chmod 600 ~/.passwd-s3fs # Change permissions for security 2. Mount S3 Storage Locally Create a mount point ...

March 6, 2025 · 2 min · Nakamura

Investigating Partial Match Search with AND Conditions Across Fields in Algolia

This article was created by AI with some human edits. Introduction Among full-text search engines, Typesense, MeiliSearch, and Algolia are gaining attention as options for small-scale projects. However, whether partial match search with “field a contains x AND field b contains y” is possible is an important consideration for project requirements. This article examines the feasibility of partial match search in Algolia and compares it with Elasticsearch. Partial Match Search in Algolia Algolia offers full-text search (query), but there are limitations when performing partial match searches on specific fields. ...

March 3, 2025 · 2 min · Nakamura

How to Convert Word Files to TEI XML: A Guide to Using the TEIgarage API

This article was created by AI with some human modifications. Introduction In the world of digital humanities, it has become common to store documents in TEI (Text Encoding Initiative) format. TEI is a standard for structuring scholarly texts. This article explains how to convert documents created in Microsoft Word to TEI XML format using Python. What is TEIgarage? TEIgarage is an online service for converting documents in various formats to TEI XML. The service provides an API that can be called directly from programs. In this article, we will call this API from Python to convert Word files. ...

March 3, 2025 · 3 min · Nakamura

Using Drupal's Sortableviews Module to Reorder Content and Save the Result to a Field

Overview This article introduces how to use Drupal’s Sortableviews module to reorder content and save the result to a field. https://www.drupal.org/project/sortableviews It is described as follows. This one is similar to Draggableview module except it can save the position value ( After drag and drop the question ) into custom content type field. Installation It could be installed using the standard method. Creating a Content Type Create the content type to be sorted. Here, we target a content type called team. ...

March 2, 2025 · 2 min · Nakamura

Developing a Viewer with Next.js + CETEIcean + React TEI Router

Overview This is a memo on developing a TEI/XML viewer combining Next.js, CETEIcean, and React TEI Router. Background CETEIcean is a JavaScript library that converts TEI/XML to HTML5. https://github.com/TEIC/CETEIcean React TEI Router is a library that enables structured display of TEI/XML using React components, based on CETEIcean. It is described as follows: https://github.com/pfefferniels/react-teirouter TEI for React using CETEIcean and routes By combining these, I created a viewer that can customize and display TEI/XML in Next.js. ...

March 2, 2025 · 3 min · Nakamura

Next.js for Drupal BASE_PATH Issue and Fix (Using patch-package)

Overview Next.js for Drupal v2.0.0 was released on 2025/2/11. https://next-drupal.org/ https://next-drupal.org/blog/next-drupal-2-0 When I tried it out, I found that the handling of BASE_PATH required attention, so this is a memo about it. Environment Variables The sample environment variables are as follows. # See https://next-drupal.org/docs/environment-variables # Required NEXT_PUBLIC_DRUPAL_BASE_URL=https://site.example.com NEXT_IMAGE_DOMAIN=site.example.com # Authentication DRUPAL_CLIENT_ID=Retrieve this from /admin/config/services/consumer DRUPAL_CLIENT_SECRET=Retrieve this from /admin/config/services/consumer # Required for On-demand Revalidation DRUPAL_REVALIDATE_SECRET=Retrieve this from /admin/config/services/next When specifying NEXT_PUBLIC_DRUPAL_BASE_URL with a base path included, such as https://site.example.com/xxx, API requests were sent to https://site.example.com/jsonapi/, failing to correctly retrieve resources. ...

March 2, 2025 · 3 min · Nakamura

Trying the Search API Algolia Module for Drupal

Overview I had the opportunity to try the Search API Algolia module for Drupal, so this is a memo of my experience. https://www.drupal.org/project/search_api_algolia Installation On Drupal 11, it could be installed with the following command. composer require 'drupal/search_api_algolia:^3.1' Configuration After installing the module, configure the server and index. Add server Create a server based on the configuration information available on the Algolia settings screen. Here, I used the Write API Key. ...

March 1, 2025 · 1 min · Nakamura

Registering Data with Drupal's JSON:API Using Username and Password

Overview In the past, I wrote articles about registering data using Drupal’s JSON:API with Python. The following uses Basic authentication. And the following uses an API Key. In addition to these methods, I was able to register data using regular login authentication, so this is a memo of that process. Code The code is as follows. It logs in, obtains a CSRF token, and then registers content. import requests import json import os from dotenv import load_dotenv class ApiClient: def __init__(self): load_dotenv(override=True) # DrupalサイトのURL(例) self.DRUPAL_BASE_URL = os.getenv("DRUPAL_BASE_URL") # エンドポイント(JSON:API) # self.JSONAPI_ENDPOINT = f"{self.DRUPAL_BASE_URL}/jsonapi/node/article" # 認証情報(Basic認証) self.USERNAME = os.getenv("USERNAME") self.PASSWORD = os.getenv("PASSWORD") def login(self): # ログインリクエスト login_url = f"{self.DRUPAL_BASE_URL}/user/login?_format=json" login_response = requests.post( login_url, json={"name": self.USERNAME, "pass": self.PASSWORD}, headers={"Content-Type": "application/json"} ) if login_response.status_code == 200: self.session_cookies = login_response.cookies def get_csrf_token(self): # CSRFトークンを取得 csrf_token_response = requests.get( f"{self.DRUPAL_BASE_URL}/session/token", cookies=self.session_cookies # ここでログインセッションを渡す ) if csrf_token_response.status_code == 200: # return csrf_token_response.text # self.csrf_token = csrf_token_response.text self.headers = { "Content-Type": "application/vnd.api+json", "Accept": "application/vnd.api+json", "X-CSRF-Token": csrf_token_response.text, } else: # raise Exception(f"CSRFトークン取得失敗: {csrf_token_response.status_code} {csrf_token_response.text}") self.csrf_token = None def create_content(self, data: dict): # 記事作成リクエスト url = f"{self.DRUPAL_BASE_URL}/jsonapi/{data['data']['type'].replace('--', '/')}" response = requests.post( # self.JSONAPI_ENDPOINT, url, headers=self.headers, cookies=self.session_cookies, json=data ) if response.status_code == 201: print("コンテンツが作成されました!") else: print("エラー:", response.status_code, response.text) With this, content can be registered as follows. ...

March 1, 2025 · 2 min · Nakamura

Building a Multilingual Static Site with Next.js

Introduction This article was generated by GPT-4o. It explains how to build a multilingual static site using Next.js. In particular, it focuses on a configuration where the main language has no URL prefix while other languages have prefixes. It also includes configuration for deploying to GitHub Pages. Project Setup First, create a Next.js project. Initialize the project using create-next-app. npx create-next-app@latest next-intl-ssg Installing Required Packages Install next-intl for multilingual support. ...

February 28, 2025 · 2 min · Nakamura

How to Get Coordinates of Sub-Images from a Larger Image

Overview I had an opportunity to obtain the coordinates within a larger image from multiple cropped sub-images. This article is a memo summarizing the method for doing this. I introduce a method using OpenCV’s SIFT (Scale-Invariant Feature Transform) to perform feature point matching between template images and the original image, estimate the affine transformation, and obtain the coordinates. Implementation Required Libraries pip install opencv-python numpy tqdm Python Code The following code matches template images (PNG images in templates_dir) against a specified large image (image_path) using SIFT, and obtains the coordinates within the original image. ...

February 23, 2025 · 3 min · Nakamura

Enabled Email-Based Registration in the Mirador 3 Firebase-Linked Annotations Plugin

Overview I have been developing a Firebase-linked annotations plugin for Mirador 3. Previously, only Google account login functionality was provided, but I have now added email-based login functionality. Feature Introduction Below is the screen after pressing the login button. With email-based login, new account creation is possible. After login, user information is now displayed. Clicking the icon displays a logout button. Summary I hope this serves as a helpful reference for creating and sharing annotations using IIIF. ...

February 21, 2025 · 1 min · Nakamura

Creating TEI/XML from VTT Files

Overview This is a memorandum on how to create TEI/XML files from VTT files. Additionally, I will make it possible to access VTT files and TEI/XML files from an IIIF manifest. As a result, as shown below, the TEI/XML file is associated via SeeAlso, and the contents of the VTT file can be accessed from the “Annotations” tab. https://clover-iiif-demo.vercel.app/?manifest=https://movie-tei-demo.vercel.app/data/sdcommons_npl-02FT0102974177/sdcommons_npl-02FT0102974177_vtt.json References I referenced the following efforts from “The Ethiopian Language Archive.” The TEI/XML structuring method was particularly helpful. ...

February 21, 2025 · 4 min · Nakamura

Using clover-iiif with Next.js

Overview I created a sample repository for using clover-iiif with Next.js, so here are my notes. https://clover-iiif-demo.vercel.app/ Background clover-iiif is described as follows. https://github.com/samvera-labs/clover-iiif Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source. We will use this with Next.js. Data “Koui Genji Monogatari (held by the National Diet Library)” is used as sample data. https://dl.ndl.go.jp/pid/3437686 Repository It is published at the following link. https://github.com/nakamura196/clover-iiif-demo I referenced the following. ...

February 17, 2025 · 1 min · Nakamura

Downloading Annotations Created with the mirador-annotations Plugin in Mirador 3

Overview This is a memo on the configuration for downloading annotations created with the mirador-annotations plugin in Mirador 3. https://mirador-annotations.vercel.app/ Background In the following article, I introduced how to register annotations with Google’s Firestore. To download the annotations registered there, the mirador-annotations plugin provides a download option, so I introduce that method here. Method The following is the source code of the demo page. By setting the exportLocalStorageAnnotations option to true, a download icon is displayed. ...

February 14, 2025 · 2 min · Nakamura

Developed a Firestore Adapter for the Mirador 3 mirador-annotations Plugin

Overview I developed a Firestore adapter for the Mirador 3 mirador-annotations plugin, so this is a personal note. You can try it at the following link. https://mirador-annotations.vercel.app/ Background The Mirador 3 mirador-annotations plugin stores annotations in local storage by default. However, as introduced in the following article, you can save annotations to a different location by changing the adapter. So this time, I developed an adapter to save annotations to Google’s Firestore. ...

February 14, 2025 · 1 min · Nakamura

Changing the Pagination Limit in Algolia

Overview In Algolia, a pagination limit (paginationLimitedTo) is set for search results, and by default, only up to 1,000 results can be accessed. By changing this setting, you can adjust the maximum number of items available through pagination. Configuration Method To change the pagination limit (paginationLimitedTo), the following methods are available. Configuring from the Algolia Dashboard Log in to Algolia Select the target index Open Configuration → Pagination Change the paginationLimitedTo value ...

February 10, 2025 · 1 min · Nakamura