Merge pull request #3377 from opencloud-eu/fix/vips-thumbnail-height

fix(thumbnails): respect the requested height in libvips builds
This commit is contained in:
Jannik Stehle authored and GitHub committed 2026-08-21 09:38:16 +02:00
commit e1aff97fe2
2 files changed
+9 -7

No files matched your search

@@ -59,7 +59,7 @@ func (g SimpleGenerator) Generate(size image.Rectangle, img interface{}) (interf
return nil, errors.ErrInvalidType
}
if err := m.ThumbnailWithSize(size.Dx(), 0, g.crop, g.size); err != nil {
if err := m.ThumbnailWithSize(size.Dx(), size.Dy(), g.crop, g.size); err != nil {
return nil, err
}
@@ -17,20 +17,22 @@ Feature: sizing of previews of files downloaded through the webdav API
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
# the source preview of a text file is always 640x480,
# so a request bigger than that is capped to the source size
Examples:
| request-width | request-height | return-width | return-height | dav-path-version |
| 1 | 1 | 16 | 16 | old |
| 32 | 32 | 32 | 32 | old |
| 1024 | 1024 | 640 | 640 | old |
| 1024 | 1024 | 640 | 480 | old |
| 1 | 1024 | 16 | 16 | old |
| 1024 | 1 | 640 | 640 | old |
| 1024 | 1 | 640 | 480 | old |
| 1 | 1 | 16 | 16 | new |
| 32 | 32 | 32 | 32 | new |
| 1024 | 1024 | 640 | 640 | new |
| 1024 | 1024 | 640 | 480 | new |
| 1 | 1024 | 16 | 16 | new |
| 1024 | 1 | 640 | 640 | new |
| 1024 | 1 | 640 | 480 | new |
| 1 | 1 | 16 | 16 | spaces |
| 32 | 32 | 32 | 32 | spaces |
| 1024 | 1024 | 640 | 640 | spaces |
| 1024 | 1024 | 640 | 480 | spaces |
| 1 | 1024 | 16 | 16 | spaces |
| 1024 | 1 | 640 | 640 | spaces |
| 1024 | 1 | 640 | 480 | spaces |