Skip to content

use imagor to make thumbnails - #422

Open
butonic wants to merge 2 commits into
mainfrom
feat/imagor-thumbnails
Open

butonic wants to merge 2 commits into
mainfrom
feat/imagor-thumbnails

Conversation

@butonic

@butonic butonic commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

We now run imagor (ghcr.io/cshum/imagor-magick:1.9.11) next to OpenCloud and let it make the thumbnails. The built-in thumbnails service is not started anymore. All COMPOSE_FILE examples in .env.example include the new thumbnails/imagor.yml.

The built-in service is going to drop libvips (opencloud-eu/opencloud#3925) and keep only a minimal set of formats as a fallback. Without this PR compose deployments would silently lose webp/heic previews and smart crops with the next image.

Why the bump to 9.0.0: pointing webdav at an external generator needs WEBDAV_THUMBNAILS_GENERATOR_URL, which came with the push based thumbnailer in 9.0.0 (opencloud-eu/opencloud#3397). 8.1.0 still resolves the thumbnails service through the registry and cannot talk to imagor. None of the 9.0.0 upgrade steps (https://docs.opencloud.eu/docs/next/admin/maintenance/upgrade/upgrade-9.x.x) apply to the compose defaults: the thumbnail cache moves to thumbnails/cache by itself, guest links stay disabled until enabled, and compose sets neither GRAPH_SPACES_DEFAULT_QUOTA nor thumbnails yaml keys. Deployments with their own opencloud.yaml still have to follow the guide.

Additional preview types, each checked against a running stack (webdav PUT + ?preview=1):

heic 200  avif 200  jp2 200  psd 200  tga 200  pcx 200  svg 200  ico 200 (png)
pdf  404  # imagor reads it, but webdav 9.0.0 only passes image types to the generator
jxl  404  # reva maps .jxl to application/octet-stream

There is ongoing work on thumbnails for pdf and other document formats in opencloud-eu/opencloud#3332.

imagor only gets unsigned /unsafe/ URLs from webdav, so it has IMAGOR_UNSAFE=true and must stay on opencloud-net without a published port. It only accepts uploads (HTTP_LOADER_DISABLE=true) and uses the limits of the built-in service. IMAGOR_MAX_INPUT_FILE_SIZE feeds both OC_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE and imagor's UPLOAD_LOADER_MAX_ALLOWED_SIZE, so both refuse the same files.

One wart: OC_EXCLUDE_RUN_SERVICES is now set by imagor.yml and the idm files, and compose keeps only the value of the last file. Each of them prepends the new EXCLUDE_ADDITIONAL_SERVICES, so keycloak or external-idp plus imagor needs

EXCLUDE_ADDITIONAL_SERVICES=idm,idp,thumbnails

in .env. Without it, the result depends on the order: either the idle built-in thumbnails service keeps running (imagor before idm, as in the examples) or idm/idp are started again (imagor after idm). Documented in .env.example, README and both files.

Also added thumbnails/imagor.yml to the renovate regex manager.

related: opencloud-eu/opencloud#3912

Written with Claude Code (claude-opus-5-5): compose changes, format checks and this description.

9.0.0 moves the thumbnails to a push based architecture: webdav posts
the image to a generator URL, which can be the built-in thumbnails
service or a real imagor. We need that to let imagor make the
thumbnails, the built-in service will drop libvips.

None of the 9.0.0 upgrade steps apply to the compose defaults: the
thumbnail cache moves to thumbnails/cache by itself, guest links stay
disabled until enabled, and we set neither GRAPH_SPACES_DEFAULT_QUOTA
nor any thumbnails yaml keys.

related: opencloud-eu/opencloud#3912

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
thumbnails/imagor.yml runs ghcr.io/cshum/imagor-magick and points
WEBDAV_THUMBNAILS_GENERATOR_URL at it. The built-in thumbnails service
is no longer started, it is going to lose libvips and with it most
formats. All COMPOSE_FILE examples include the new file.

imagor only gets unsigned /unsafe/ URLs from webdav, so it must only be
reachable on opencloud-net. It is configured with the same limits as
the built-in service and only accepts uploads, it never fetches URLs.

On top of the built-in list we announce previews for heic, heif, avif,
jp2, psd, tga, pcx, svg and ico. I checked each against a running
stack. pdf is read by imagor, but webdav 9.0.0 only passes image types
to the generator. jxl ends up as application/octet-stream in reva, so
it would need a mime mapping first.

OC_EXCLUDE_RUN_SERVICES is now set by imagor.yml and the idm files, and
compose keeps only the value of the last file. Each file prepends the
new EXCLUDE_ADDITIONAL_SERVICES, so combining them works when it lists
all of them: EXCLUDE_ADDITIONAL_SERVICES=idm,idp,thumbnails

related: opencloud-eu/opencloud#3912

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
@dschmidt

Copy link
Copy Markdown
Contributor

@butonic can you rebase? We already have imagor in main, but you have a few neat additions (like turning off the built in thumbnails service)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants