Skip to content
This repository was archived by the owner on Aug 16, 2026. It is now read-only.

Releases: un-es/canvas-npmmirror

v3.2.3

Choose a tag to compare

@JounQin JounQin released this 28 May 06:49
a161358

3.2.3

Fixed

3.2.2

Fixed

  • Fix dangling env pointer in image MIME data cleanup (Automattic#2550)
  • Fix ctx.direction not affected by ctx.save and ctx.restore
  • Preserve rest of PDF pages when changing width and height (Automattic#2538)
  • Several security fixes for untrusted inputs to getImageData and putImageData. Thanks to Ethan Kim for the report.

3.2.1

  • Fix error message HTTP response status code in image src setter
  • roundRect() shape incorrect when radii were large relative to rectangle size (Automattic#2400)
  • Reject loadImage when src is null or invalid (Automattic#2304)
  • Fix compilation on GCC 15 by including (Automattic#2545)

3.2.0

Added

  • Added ctx.lang to set the ISO language code for text

3.1.2

Fixed

3.1.1

Fixed

  • Fix a crash when SVGs without width or height are loaded (Automattic#2486)
  • Fix fetching prebuilds during installation on certain newer versions of Node (Automattic#2497)
  • Fixed issue with fillText that was breaking subsequent fillText calls (Automattic#2171)
  • Fix svg rendering when the image is resized (Automattic#2498)
  • Fix measureText with direction rtl textAlign start/end
  • Fix a crash in Node 24, due to external memory API change (Automattic#2514)

3.1.0

Changed

  • Replaced simple-get with Node.js builtin fetch (Automattic#2309)
  • ctx.font has a new C++ parser and is 2x-400x faster. Please file an issue if you experience different results, as caching has been removed.
  • The restriction of registering fonts before a canvas is created has been removed. You can now register a font as late as right before the fillText call (#1921)

Added

  • Support for accessibility and links in PDFs
  • ctx.direction is implemented: 'rtl' or 'ltr' set the base direction of text
  • ctx.textAlign 'start' and 'end' are now 'right' and 'left' when ctx.direction === 'rtl'

Fixed

  • Fix a crash in getImageData when the rectangle is entirely outside the canvas. (#2024)
  • Fix getImageData cropping the resulting ImageData when the given rectangle is partly outside the canvas. (#1849)

3.0.1

Fixed

  • Fixed accidental depenency on ambient DOM types

v3.0.0

Choose a tag to compare

@github-actions github-actions released this 06 Dec 13:57
8970e6b

This release notably changes to using N-API. 🎉

Breaking

  • Dropped support for Node.js 16.x and below.

Changed

  • Migrated to N-API (by way of node-addon-api) and removed libuv and v8 dependencies
  • Defer the initialization of the op variable to the default switch case to avoid a compiler warning. (Automattic#2229)
  • Use a default switch case with a null statement if some enum values aren't suppsed to be handled, this avoids a compiler warning. (Automattic#2229)
  • Migrate from librsvg's deprecated rsvg_handle_get_dimensions() and rsvg_handle_render_cairo() functions to the new rsvg_handle_get_intrinsic_size_in_pixels() and rsvg_handle_render_document() respectively. (Automattic#2229)
  • Avoid calling virtual methods in constructors/destructors to avoid bypassing virtual dispatch. (Automattic#2229)
  • Remove unused private field backend in the Backend class. (Automattic#2229)
  • Add Node.js v20 to CI. (Automattic#2237)
  • Replaced dtslint with tsd (Automattic#2313)

Added

  • Added string tags to support class detection

Fixed

v2.11.2

Choose a tag to compare

@github-actions github-actions released this 10 Jul 08:02
fff6585

Fixed

  • Building on Windows in CI (and maybe other Windows configurations?) (Automattic#2216)

v2.11.0

Choose a tag to compare

@github-actions github-actions released this 10 Mar 08:19

Fixed

  • Replace triple-slash directive in types with own types to avoid polluting TS modules with globals (#1656)

v2.10.2

Choose a tag to compare

@github-actions github-actions released this 31 Oct 01:58

Fixed

  • Fix Assertion failed: (object->InternalFieldCount() > 0), function Unwrap, file nan_object_wrap.h, line 32. (#2025)
  • textBaseline and textAlign were not saved/restored by save()/restore(). (#1936)
  • Update nan to v2.17.0 to ensure Node.js v18+ support.

Changed

  • Improve performance and memory usage of save()/restore().
  • save()/restore() no longer have a maximum depth (previously 64 states).

v2.10.1

Choose a tag to compare

@github-actions github-actions released this 11 Sep 12:17
151cfd2

Fixed

  • Fix actualBoundingBoxLeft and actualBoundingBoxRight when textAlign='center' or 'right' (#1909)
  • Fix rgba(r,g,b,0) with alpha to 0 should parse as transparent, not opaque. (#2110)

v2.10.0

Choose a tag to compare

@JounQin JounQin released this 05 Sep 12:03

Added

Fixed

  • rgba(r,g,b) with no alpha should parse as opaque, not transparent. (#2029)
  • Typo in PngConfig.filters types. (#2072)
  • createPattern() always used "repeat" mode; now supports "repeat-x" and "repeat-y". (#2066)
  • Crashes and hangs when using non-finite values in context.arc(). (#2055)
  • Incorrect context.arc() geometry logic for full ellipses. (#1808, (#1736))
  • Added missing deregisterAllFonts to the Typescript declaration file (#2096)
  • Add User-Agent header when requesting remote images (#2099)