Files
opencloud/tests/acceptance/features/coreApiWebdavPreviews/previewsAutoAdustedSizing.feature
T
Dominik Schmidt 8a80d75363 refactor(webdav): keep ignoring the legacy a flag
OpenCloud never honored it, so clients were tested against an ignored a and honoring it now would change what they get.
2026-10-21 14:22:54 +02:00

76 lines
5.3 KiB
Gherkin

@skipOnReva
Feature: sizing of previews of files downloaded through the webdav API
As a user
I want the aspect-ratio of previews to be preserved even when I ask for an unusual preview size
So that the previews always have a similar look-and-feel to the original file
This is optional behavior of an implementation. OpenCloud happens like this,
but oC10 does not do this auto-fix of the aspect ratio.
Background:
Given user "Alice" has been created with default attributes
Scenario Outline: download different sizes of previews of file (default = fill)
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
When user "Alice" downloads the preview of "/parent.txt" with width <request-width> and height <request-height> using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded image should be <return-width> pixels wide and <return-height> pixels high
# No processor is given, so the default behavior applies: fill. The source
# preview of a text file is always 640x480 (landscape). Each axis of the
# requested size is rounded up to the next configured edge length on its own,
# so an asymmetric request stays asymmetric, and the image is center-cropped
# to fill that exact box. fill may upscale, so when the box is larger than the
# source the 640x480 source is enlarged to cover it; only boxes smaller than
# the source are downscaled.
Examples:
| request-width | request-height | return-width | return-height | dav-path-version |
| 1 | 1 | 16 | 16 | old |
| 32 | 32 | 32 | 32 | old |
| 1024 | 1024 | 1024 | 1024 | old |
| 1 | 1024 | 16 | 1024 | old |
| 1024 | 1 | 1024 | 16 | old |
| 1 | 1 | 16 | 16 | new |
| 32 | 32 | 32 | 32 | new |
| 1024 | 1024 | 1024 | 1024 | new |
| 1 | 1024 | 16 | 1024 | new |
| 1024 | 1 | 1024 | 16 | new |
| 1 | 1 | 16 | 16 | spaces |
| 32 | 32 | 32 | 32 | spaces |
| 1024 | 1024 | 1024 | 1024 | spaces |
| 1 | 1024 | 16 | 1024 | spaces |
| 1024 | 1 | 1024 | 16 | spaces |
Scenario Outline: download a preview with an explicit processor
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
When user "Alice" downloads the preview of "/parent.txt" with width <request-width> and height <request-height> and processor "<processor>" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded image should be <return-width> pixels wide and <return-height> pixels high
# An explicit processor overrides the default. The source preview of a text
# file is always 640x480 (landscape); each axis of the requested size is
# rounded up to the next configured edge length and the operation is applied
# within the resulting box:
# fit -> aspect-fit within the box, never upscaled (keeps source ratio)
# fill -> center-crop to the exact box (may upscale/downscale to cover)
# resize -> stretch to the exact box (distorts aspect ratio)
#
# The OpenCloud web client always sends a processor: list view requests
# processor=thumbnail at 64x64, tiles view requests processor=fit at a dynamic
# square between 320 and 768.
Examples:
| request-width | request-height | processor | return-width | return-height | dav-path-version |
| 1 | 1 | fit | 16 | 12 | spaces |
| 32 | 32 | fit | 32 | 24 | spaces |
| 1024 | 1024 | fit | 640 | 480 | spaces |
| 1 | 1024 | fit | 16 | 12 | spaces |
| 1024 | 1 | fit | 21 | 16 | spaces |
| 1 | 1 | fill | 16 | 16 | spaces |
| 32 | 32 | fill | 32 | 32 | spaces |
| 1024 | 1024 | fill | 1024 | 1024 | spaces |
| 1 | 1 | resize | 16 | 16 | spaces |
| 32 | 32 | resize | 32 | 32 | spaces |
| 1024 | 1024 | resize | 1024 | 1024 | spaces |