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 a43e20f
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,7 +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
-
-`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`.
139
+
-`renderSVG()` bounds the points paths are made of: an arc between far-apart ends is drawn with at most 64 curves a turn (a 139-byte path, `M 1e25 100 A 40 30 20 1 1 160 100`, stroked, ran the process out of memory), and the curves of arcs and the points of all paths, also of each copy drawn through `<use>`, count against 2^25 points plus 4 per pixel of the output in one render and 2^21 in one path. More throw a `LimitError`. A path drawn through `<use>` is read once a render instead of once a copy.
140
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
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.
142
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).
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@
16
16
**ImageScript** decodes, edits and encodes images in pure TypeScript: no WebAssembly, no native binaries, and no
17
17
runtime dependencies. It runs in Node.js 22.13+, Deno, Bun, browsers and edge runtimes (Cloudflare Workers, Vercel's
18
18
Edge Runtime, Deno Deploy), works with `import` and, on supported Node.js versions, `require()`, and ships with type
19
-
definitions (TypeScript 5.7 or newer; CommonJS projects with`module: nodenext`need 5.8 or newer to `import` it. With older versions and `skipLibCheck`, the encoders' return types become `any`). Large AVIF and JPEG XL operations, and lossless WebP encoding, can use multiple CPU cores when the runtime
19
+
definitions (TypeScript 5.7 or newer; CommonJS projects need`module: nodenext`and 5.8 or newer to `import` it (`module: node16` can't). With older versions and `skipLibCheck`, the encoders' return types become `any`). Large AVIF and JPEG XL operations, and lossless WebP encoding, can use multiple CPU cores when the runtime
if(typeofstops!=='object'||stops===null)thrownewTypeError(`gradient() takes an array of colors or an object of positions and colors, not ${shown(stops)}`);
203
+
if(typeofstops!=='object'||stops===null)thrownewTypeError(`Colors.gradient() takes an array of colors or an object of positions and colors, not ${shown(stops)}`);
204
204
letcolors: Record<number,Color>;
205
205
if(Array.isArray(stops)){
206
-
if(!stops.length)thrownewRangeError('gradient() takes at least one color, not 0');
206
+
if(!stops.length)thrownewRangeError('Colors.gradient() takes at least one color, not 0');
0 commit comments