Skip to content

Commit 4e5fb20

Browse files
committed
cover all changes in the migration guide
1 parent 6291ef1 commit 4e5fb20

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎guides/Migrating to 4.0.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ old count when it throws), and to the encoders `Animation.gifEncoder()`, `webpEn
107107

108108
The formats store a finite count in fixed-size fields: a GIF up to `65535`, a WebP up to `65534` and an APNG up to
109109
`2147483646` (2^31 - 2). A larger count throws a `RangeError` before anything is encoded, from `encodeGIF()`,
110-
`encodeWebP()`, `encodeAPNG()` and the streaming encoders. (Before, a GIF with `65536` loops wrapped to `0`, which is
111-
forever.) `Infinity` is always fine.
110+
`encodeWebP()`, `encodeAPNG()` and the streaming encoders. This limit is already enforced in the latest 3.x release,
111+
3.20.2; earlier releases silently wrapped a GIF count of `65536` to `0`, which means forever. `Infinity` is always
112+
fine.
112113

113114
Search your code for: `loopCount: -1`, `loopCount = -1`, `loopCount === -1` and `loopCount < 0`.
114115

@@ -411,7 +412,9 @@ false })` grows the image again), so search for them too.
411412

412413
`transform()` on images, frames and animations takes an `AffineTransform` with exactly six values. Gain-map channel
413414
parameters take a scalar or a three-value `[red, green, blue]` tuple (`GainMapChannelValues`); use a scalar for the
414-
shared-channel form instead of a one-element array.
415+
shared-channel form instead of a one-element array. The gain-map parameter properties (`min`, `max`, `gamma`,
416+
`offsetSDR` and `offsetHDR`) return readonly copies: changing `map.min[0]` does not change the map (and TypeScript
417+
rejects it). Assign a scalar or a full tuple instead, such as `map.min = [0, 1, 2]`.
415418

416419
### Frames hold an image
417420

0 commit comments

Comments
 (0)