Keep each side at 1 or more with fit=outside too
check / check (push) Canceled after 0s

fit=outside works both sides out again from the larger scale, and a side
scaled to 1 could come out just under 1 and round down to 0, which
libvips refuses: a 49x8192 source at 0x100 and a 49x49 source at 1x1
answered 500. README.md now says what fit=outside does, with the 8192x1
source at 100x0 that comes out at 8192x1, and how a 0 side is worked
out from the source's proportions.

Model: opus-5-5
This commit is contained in:
2026-10-16 01:11:20 +00:00
parent c590d0f8ca
commit ab35342671
3 changed files with 25 additions and 11 deletions
+8 -5
View File
@@ -36,11 +36,14 @@ P2: security: per-origin rate limiting
source at `100x0` came out at 100x100, and at `1300x0` with `fit=cover` made
libvips ask for about 39 GB at once; an 8192x2 source at `100x0` answered 500.
`fit=contain` and `fit=inside` work both sides out again from the smaller of
the two scales, and keep each at 1 or more too, so a 1x8192 source at `0x100`
no longer answers 500 there. An 8192x1 source at `1300x0` now comes out at
1300x1, and the process running it alone peaked at about 34 MiB resident. With
`fit=outside` the image is scaled to cover the size, so that source at `100x0`
comes out at 8192x1.
the two scales and `fit=outside` from the larger, and each keeps both sides at
1 or more too, so a 1x8192 source at `0x100` with `fit=contain`, and a 49x8192
source at `0x100` or a 49x49 source at `1x1` with `fit=outside`, no longer
answer 500. An 8192x1 source at `1300x0` now comes out at 1300x1, and the
process running it alone peaked at about 34 MiB resident. With `fit=outside`
the image is scaled to cover the size, so that source at `100x0` comes out at
8192x1. `README.md` now says this under Signature Specification, and says how
a `0` side is worked out where it said `0` meant the original.
- 2026-10-15 a thin source requested with `fit=cover` no longer makes libvips
build a huge image (closes #282): libvips' thumbnail scaled the whole source
to cover the requested size and copied that into memory before it cut out the