You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7715987
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,6 +136,7 @@ Upgrading from 3.x? Upgrade to the latest 3.x release first, fix the deprecation
136
136
137
137
### Fixes
138
138
139
+
-`encodeJPEG()` of an image with transparency composites it onto the background row by row instead of copying the image first: the peak memory of a 6000x6000 image is 378 MB instead of 485 MB, the same as without transparency, and the file is the same (images with a gain map still take the copy).
139
140
-`encodeWebP({ optimize: false })` makes the same file as `webpEncoder()` for animations with frames WebP can't store as they are (stored as the canvas from the first such frame on, not all of them), and `Colors.gradient()` with 3 or more stops has its first and last stops' exact colors before and after them (a transparent end stop gave `0x00000000`) and takes 200,000 stops without overflowing the call stack.
140
141
-`resize({ fit: 'inside' })` throws for a box side below 1 pixel, like the other fits, instead of making a 1x1 image; `pixels()` goes over the pixels the image has when it's called, also when it's resized before the first value is taken.
141
142
-`Image.renderText()` checks `strokeColor` without a `strokeWidth` too (a wrong color passed until a stroke was set), and an animation encoder whose `finish()` found no frame can still be given frames.
Copy file name to clipboardExpand all lines: src/image.ts
+55Lines changed: 55 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2681,6 +2681,15 @@ export class Image {
2681
2681
// eslint-disable-next-line no-restricted-syntax -- a limit of the format, not a range of the option
2682
2682
if(exif&&exif.length>65527)thrownewRangeError(`JPEG: the metadata's description, author, copyright, software and creation time must be at most 65533 bytes together in Exif, not ${exif.length+6}`);
2683
2683
2684
+
// without a gain map: the transparent pixels are composited onto the background row by row as the encoder reads
2685
+
// them (no copy of the image: __flattened__'s copy of 4 bytes a pixel was the peak memory)
0 commit comments