Skip to content

[FEATURE] Show error message when a page image cannot be loaded - #2153

Merged
sebastian-meyer merged 3 commits into
kitodo:mainfrom
stweil:feat/image-load-error-message
Sep 18, 2026
Merged

sebastian-meyer merged 3 commits into
kitodo:mainfrom
stweil:feat/image-load-error-message

Conversation

@stweil

@stweil stweil commented Sep 18, 2026

Copy link
Copy Markdown
Member

When the image server is unavailable (e.g. returns HTTP 503) the page grid previously showed only broken image icons and the PageView full page image silently failed to load: the OpenLayers image source never settled, the map was never created and the viewer hung with no feedback.

The page grid thumbnails now fall back to the placeholder image and reveal a localized message via an handler. The PageView fixes the unhandled rejection in fetchImageData()/initLayer() so the image load failure settles the deferred, and renders a localized message (including the image source URL) inside the map container.

Adds translatable strings pageGrid.thumbnailError and pageview.imageError (EN/DE).

Add functional tests for the image load error rendering.

When the image server is unavailable (e.g. returns HTTP 503) the
page grid previously showed only broken image icons and the PageView
full page image silently failed to load: the OpenLayers image source
never settled, the map was never created and the viewer hung with no
feedback.

The page grid thumbnails now fall back to the placeholder image and
reveal a localized message via an <img onerror> handler. The PageView
fixes the unhandled rejection in fetchImageData()/initLayer() so the
image load failure settles the deferred, and renders a localized
message (including the image source URL) inside the map container.

Adds translatable strings pageGrid.thumbnailError and
pageview.imageError (EN/DE).

Assisted-by: OpenCode / qwen3.8-27b-thinking (Alibaba Cloud)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Render the real PageGrid and PageView templates (instead of the reduced
inline templates used elsewhere) to assert the new error-handling markup:
the page grid emits a hidden fallback placeholder image plus a per-thumbnail
<img onerror> handler and a localized error message, and the page view map
container carries the localized image-load error message.

This requires the controller test harness to render templates with view
helpers that need a request context (f:translate, f:link.page, f:image), so
AbstractControllerTestCase gains a template-capable request and a helper to
point a StandaloneView at a real template file with the dlf partials.

Assisted-by: OpenCode / qwen3.8-27b-thinking (Alibaba Cloud)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
@stweil

stweil commented Sep 18, 2026

Copy link
Copy Markdown
Member Author

This PR was motivates by the current downtime of digital.slub-dresden.de. A thumbnail image for a failing server now looks like this:

Bildschirmfoto 2026-09-18 um 13 39 09

The failing page image shows the same error message plus the failing URL.

@sebastian-meyer sebastian-meyer added the ↷ feature A new feature or enhancement. label Sep 18, 2026
@sebastian-meyer
sebastian-meyer merged commit 3083d91 into kitodo:main Sep 18, 2026
10 checks passed
@stweil
stweil deleted the feat/image-load-error-message branch September 18, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

↷ feature A new feature or enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants