Socket
Socket
Sign inDemoInstall

canvas

Package Overview
Dependencies
Maintainers
6
Versions
148
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas - npm Package Compare versions

Comparing version 2.5.0 to 2.6.0

16

CHANGELOG.md

@@ -14,2 +14,18 @@ # Changelog

2.6.0
==================
### Changed
* Allow larger buffers to be returned from `toBuffer('raw')`.
### Added
* Support for various BMP headers and color depths (#1435)
### Fixed
* Fix crash when changing canvas width/height while `fillStyle` or `strokeStyle`
was set to a `CanvasPattern` or `CanvasGradient` (#1357).
* Fix crash when changing width/height of SVG canvases (#1380).
* Fix crash when using `toBuffer('raw')` with large canvases (#1158).
* Clarified meaning of byte ordering for `toBuffer('raw')` in readme. (#1416)
* Fix package.json Typings field to point to Declaration file (#1432)
* Properly check return value from `Set` and `Call`. (#1415)
* Use `Get` version from `Nan` instead of `v8`. (#1415)
2.5.0

@@ -16,0 +32,0 @@ ==================

6

package.json
{
"name": "canvas",
"description": "Canvas graphics API backed by Cairo",
"version": "2.5.0",
"version": "2.6.0",
"author": "TJ Holowaychuk <tj@learnboost.com>",

@@ -49,5 +49,5 @@ "main": "index.js",

],
"types": "types",
"types": "types/index.d.ts",
"dependencies": {
"nan": "^2.13.2",
"nan": "^2.14.0",
"node-pre-gyp": "^0.11.0",

@@ -54,0 +54,0 @@ "simple-get": "^3.0.3"

@@ -243,3 +243,3 @@ # node-canvas

* **callback** If provided, the buffer will be provided in the callback instead of being returned by the function. Invoked with an error as the first argument if encoding failed, or the resulting buffer as the second argument if it succeeded. Not supported for mimeType `raw` or for PDF or SVG canvases.
* **mimeType** A string indicating the image format. Valid options are `image/png`, `image/jpeg` (if node-canvas was built with JPEG support), `raw` (unencoded ARGB32 data in native-endian byte order, top-to-bottom), `application/pdf` (for PDF canvases) and `image/svg+xml` (for SVG canvases). Defaults to `image/png` for image canvases, or the corresponding type for PDF or SVG canvas.
* **mimeType** A string indicating the image format. Valid options are `image/png`, `image/jpeg` (if node-canvas was built with JPEG support), `raw` (unencoded data in BGRA order on little-endian (most) systems, ARGB on big-endian systems; top-to-bottom), `application/pdf` (for PDF canvases) and `image/svg+xml` (for SVG canvases). Defaults to `image/png` for image canvases, or the corresponding type for PDF or SVG canvas.
* **config**

@@ -285,8 +285,9 @@ * For `image/jpeg`, an object specifying the quality (0 to 1), if progressive compression should be used and/or if chroma subsampling should be used: `{quality: 0.75, progressive: false, chromaSubsampling: true}`. All properties are optional.

// ARGB32 pixel values, native-endian
// BGRA pixel values, native-endian
const buf4 = canvas.toBuffer('raw')
const { stride, width } = canvas
// In memory, this is `canvas.height * canvas.stride` bytes long.
// The top row of pixels, in ARGB order, left-to-right, is:
const topPixelsARGBLeftToRight = buf4.slice(0, width * 4)
// The top row of pixels, in BGRA order on little-endian hardware,
// left-to-right, is:
const topPixelsBGRALeftToRight = buf4.slice(0, width * 4)
// And the third row is:

@@ -293,0 +294,0 @@ const row3 = buf4.slice(2 * stride, 2 * stride + width * 4)

@@ -105,4 +105,5 @@ // TypeScript Version: 3.0

/**
* Returns the raw ARGB data without encoding in native-endian byte order,
* top-to-bottom.
* Returns the unencoded pixel data, top-to-bottom. On little-endian (most)
* systems, the array will be ordered BGRA; on big-endian systems, it will
* be ARGB.
*/

@@ -109,0 +110,0 @@ toBuffer(mimeType: 'raw'): Buffer

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc