Keep a side computed for a size with one side 0 at 1 or more (closes #283)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
A size with one side 0 has that side worked out from the source's proportions by integer division, and nothing kept it at 1 or more. When it rounded down to 0, libvips was asked for a square: an 8192x1 source at 100x0 came out 100x100, at 1300x0 it asked for one block of about 39 GB, and some shapes answered 500. Each computed side, and each side contain, inside and outside work out again from the scale, is now at least 1. README.md now says what fit=outside does and what a 0 side means; with fit=outside an 8192x1 source at 100x0 comes out 8192x1, as covering the size requires. Model: opus-5-5
This commit was merged in pull request #291.
This commit is contained in:
@@ -30,6 +30,20 @@ P2: security: per-origin rate limiting
|
||||
|
||||
# Completed Steps
|
||||
|
||||
- 2026-10-16 a size with one side `0` keeps the side computed from the source's
|
||||
proportions at 1 or more (closes #283): it was rounded down, so for a thin
|
||||
source it came out at 0, and libvips then made the size square. An 8192x1
|
||||
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 `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-16 the generator page lower-cases the source host and writes an empty
|
||||
source path as `/` before it makes the encrypted URL, as `/v1/image/` does
|
||||
(closes #293). A host written in upper and in lower case, or a source URL with
|
||||
|
||||
Reference in New Issue
Block a user