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 3afdd73
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,6 +136,9 @@ Upgrading from 3.x? Upgrade to the latest 3.x release first, fix the deprecation
136
136
137
137
### Fixes
138
138
139
+
-`renderSVG()` bounds the curves an arc between far-apart ends is drawn with and the points paths flatten to: a 139-byte path (`M 1e25 100 A 40 30 20 1 1 160 100`, stroked) ran the process out of memory. Too many points throw a `LimitError`.
140
+
-`encodeJPEG()` and `encodeWebP()` check the image's size before going over its pixels; `metadata.creationTime` of another type than a `Date`, a number or a string throws a `TypeError` (`true` was 1970).
141
+
-`Colors.gradient()` has the later stop's color at every hard edge (two stops at one position), like CSS, also inside the gradient and with 2 stops.
139
142
-`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).
140
143
-`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.
141
144
-`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.
if(typeoftext!=='string'||!isOptions(options))thrownewTypeError('renderText() takes the text and an options object, like renderText(\'Hello\', { font, size: 32 })');
3175
-
if(options.font===undefined)thrownewTypeError('renderText(text, options) needs the font in the options');
3174
+
if(typeoftext!=='string')thrownewTypeError(`Image.renderText() takes the text as a string, like Image.renderText('Hello', { font, size: 32 }), not ${shown(text)}`);
3175
+
if(!isOptions(options))thrownewTypeError(`Image.renderText() takes an options object, like Image.renderText('Hello', { font, size: 32 }), not ${options===undefined ? 'undefined' : shown(options)}`);
3176
+
if(options.font===undefined)thrownewTypeError('Image.renderText(text, options) needs the font in the options');
3176
3177
const{ font, color =0xffffffff, strokeWidth =0, strokeColor =0x000000ff, hinting =true, features ={}, variations ={}, maxPixels =MAX_PIXELS}=options;
// eslint-disable-next-line no-restricted-syntax -- the one date in the options
91
+
thrownewTypeError(`creationTime must be a Date, a number or a string, not ${typeofcreationTime==='object' ? shown(creationTime) : typeofcreationTime}`);
92
+
}
88
93
consttime=newDate(creationTime);
89
94
// eslint-disable-next-line no-restricted-syntax -- the one date in the options
90
95
if(isNaN(time.getTime()))thrownewRangeError(`creationTime must be a date, a timestamp or a date string, not ${shown(creationTime)}`);
0 commit comments