Commit Graph
19 Commits
Author SHA1 Message Date
Dominik Schmidt 253b2d4d52 fix(webdav): key the source cache by extractor, keep no empty entry per size 2026-11-27 16:40:24 +01:00
Dominik Schmidt 3716c65704 fix(webdav): cache a file the built-in extractors find no image in, as for Tika 2026-11-27 16:39:56 +01:00
Dominik Schmidt 82735a337d fix(webdav): give every thumbnail type exactly one taker
A named Tika type goes to Tika, then the built-in converters, then images
to the generator, then the rest to Tika under "*" or to the generator.
"*" never sends an image, which only moved the file to come back empty,
and an announced type without a converter reaches the generator again, as
it does on main since the generator pass-through.
2026-11-27 16:39:43 +01:00
Dominik Schmidt ff964dcc22 refactor(webdav): ask who can serve a type, not what the type is called
ForType decided by the name of the type: anything starting with image/ was
handed to the generator, and no converter meant handing it over as well. A
camera raw is an image by that rule, so it travelled to a generator that cannot
read it, and an announced pdf travelled there too. It now asks in one order who
claims the file: a type the Tika list names, an image the generator reads, a
converter here, a catch-all, and otherwise nobody, which answers 404 before the
file is read at all.

The Tika list carries the formats a release serves a thumbnail for, the camera
raws among them, and the default config hands it in, so an empty list still
means nothing goes to Tika and a shared server stays the search service's.
OC_TIKA_ADDITIONAL_THUMBNAIL_MIME_TYPES adds to it.
2026-11-27 16:39:10 +01:00
Dominik Schmidt f24659fdf4 refactor(webdav): keep the Tika type default in the default config
The catch-all was hidden in NewTika, so neither the yaml nor the env documentation showed it. It is a plain default now, like the CORS origins, and an empty list means what it says: nothing goes to Tika, and the server behind OC_TIKA_URL stays the search service's.
2026-11-27 16:38:44 +01:00
Dominik Schmidt 31b6cf6bd9 docs(webdav): say how a Tika before 4.2.0 activates the preset
Both answer with the same image for the same file, only the package differs, and a 4.1.x server has no preview for erf, orf and rw2. The 404 now names both ways to activate the preset.
2026-11-27 16:38:29 +01:00
Dominik Schmidt 6b2c30219c refactor(webdav): let the preprocessor say what a type needs
The cache key is derived from configuration again: a thumbnail is written in
the type the file's own type maps to, so the answer no longer depends on what
Tika hands back and needs no placeholder in the key.

Which types Tika gets is decided in one place now. An image type goes to Tika
only when a deployment names it, because the generator behind the URL may read
it itself, which also lets a raw photo reach Tika at all.
2026-11-27 16:38:09 +01:00
Dominik Schmidt 9dbe0b7956 feat(webdav): use Tika's merged thumbnail preset
Tika merged the thumbnail catalog preset and ThumbnailUnpackSelector
(TIKA-4856): PUT /unpack/preset/thumbnail returns exactly the one raster
image a client would show for the document, a stored thumbnail, the
rendering of a metafile thumbnail, or the rendered first page. The
client-side selection over /unpack/all (embedded-resource-type marks,
metafile renderings, id-path matching) moves to the server; the preset
zip carries one image without metadata sidecars, so the entry's
extension names the type and the bytes break the tie. The preset has to
be active, so this needs a Tika 4.2.0 or newer started with
TIKA_PRESETS=thumbnail, and a 404 says so.
2026-11-27 16:37:50 +01:00
Dominik Schmidt 69e13657e4 feat(webdav): take the thumbnail tika marks, and the rendering of a metafile 2026-11-27 16:37:41 +01:00
Dominik Schmidt 1c7b19f009 feat(webdav): thumbnails through a Tika server
Every file the built-in converters cannot render goes to /unpack/thumbnail
(Tika 4.1) and comes back with the image Tika marks as its thumbnail.
2026-11-27 16:36:39 +01:00
Dominik Schmidt e462b8ce27 fix(webdav): stream announced types without a converter to the generator 2026-11-03 11:34:16 +01:00
Dominik Schmidt 89e2f42d7c refactor(webdav): ask ForType for options, not for an any map 2026-10-19 15:16:06 +02:00
Dominik Schmidt c980083938 docs: say less in the comments, and name what matchOperation returns 2026-10-19 14:57:36 +02:00
Dominik Schmidt 999ad6fb7c fix: answer the review from @orgaralf
Both builds and imagor now crop the same region, a gif is bounded by its
declared frames, the posted body by THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE and an
image extracted from a container by the configured input size. The s3 cache
reads a miss where minio reports it.

The push endpoint's HTTP behaviour is asserted in the parity suite now, where
imagor answers the same request, so 41 duplicated service specs are gone and
the 32 that remain are what a non-default config or a helper decides.
2026-10-19 14:57:36 +02:00
Dominik Schmidt 3572410fc4 fix: answer the review, and read imagor's path the way imagor does
The push endpoint takes an empty filters segment, ignores an image key behind the box and computes a side given as 0 from the other one, all measured against both imagors and pinned in the parity suite. Plus the review leftovers: no em dashes, the request test on ginkgo, comments that contradicted the code, one stat for Head and generate, one thumbnail handler, the gif fit-in rounding of vips, and the new env names last so they win.
2026-10-19 14:57:35 +02:00
Dominik Schmidt 9879927f4f refactor(webdav): a converter returns the image bytes and their type
A converter that found nothing returns nil, so the workflow decides what to
do with it instead of reading an error.
2026-10-19 14:57:35 +02:00
Dominik Schmidt 07d6829bd6 fix(webdav): hand an embedded image to the generator as it was found
Nothing is decoded in webdav any more, which also ends the libvips build
split in the preview path.
2026-10-19 14:57:35 +02:00
Dominik Schmidt de467d7dd8 feat(webdav): write a thumbnail in the type the source maps to
A source type maps onto the type its thumbnail is returned in, and that
type is asked for by the name the generator knows it under. The answer
carries that type whether it was just generated or came from the cache,
which is also what the cache key says.
2026-10-19 14:57:35 +02:00
Jörn Friedrich Dreyer 81d0a86c35 refactor(webdav): drive the thumbnail workflow via the push-based generator
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-10-19 14:57:35 +02:00