mirror of
https://github.com/lovell/sharp.git
synced 2026-02-06 06:36:17 +01:00
Compare commits
10 Commits
v0.33.0-rc
...
v0.33.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
545e09fad2 | ||
|
|
133dc56ff4 | ||
|
|
9c877d93fa | ||
|
|
7ad86fed03 | ||
|
|
31cf07f0ba | ||
|
|
4ffb48711a | ||
|
|
3da96a86e6 | ||
|
|
45ed9ea9bf | ||
|
|
61057f25bc | ||
|
|
68ef72cb61 |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -185,7 +185,7 @@ jobs:
|
|||||||
emmake npm run package-from-local-build
|
emmake npm run package-from-local-build
|
||||||
npm pkg set "optionalDependencies.@img/sharp-wasm32=file:./npm/wasm32"
|
npm pkg set "optionalDependencies.@img/sharp-wasm32=file:./npm/wasm32"
|
||||||
npm run clean
|
npm run clean
|
||||||
rm -r node_modules/@img/sharp-linux-x64
|
rm -rf node_modules/@img/sharp-linux-x64
|
||||||
npm install --cpu=wasm32
|
npm install --cpu=wasm32
|
||||||
npm test
|
npm test
|
||||||
- name: Prebuild
|
- name: Prebuild
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ Non-critical problems encountered during processing are emitted as `warning` eve
|
|||||||
|
|
||||||
Implements the [stream.Duplex](http://nodejs.org/api/stream.html#stream_class_stream_duplex) class.
|
Implements the [stream.Duplex](http://nodejs.org/api/stream.html#stream_class_stream_duplex) class.
|
||||||
|
|
||||||
|
When loading more than one page/frame of an animated image,
|
||||||
|
these are combined as a vertically-stacked "toilet roll" image
|
||||||
|
where the overall height is the `pageHeight` multiplied by the number of `pages`.
|
||||||
|
|
||||||
**Throws**:
|
**Throws**:
|
||||||
|
|
||||||
- <code>Error</code> Invalid parameters
|
- <code>Error</code> Invalid parameters
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
Requires libvips v8.15.0
|
Requires libvips v8.15.0
|
||||||
|
|
||||||
### v0.33.0 - TBD
|
### v0.33.0 - 29th November 2023
|
||||||
|
|
||||||
* Drop support for Node.js 14 and 16, now requires Node.js >= 18.17.0
|
* Drop support for Node.js 14 and 16, now requires Node.js >= 18.17.0
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,36 @@ Ready-compiled sharp and libvips binaries are provided for use on the most commo
|
|||||||
This provides support for the
|
This provides support for the
|
||||||
JPEG, PNG, WebP, AVIF (limited to 8-bit depth), TIFF, GIF and SVG (input) image formats.
|
JPEG, PNG, WebP, AVIF (limited to 8-bit depth), TIFF, GIF and SVG (input) image formats.
|
||||||
|
|
||||||
|
## Cross-platform
|
||||||
|
|
||||||
|
At install time, package managers will automatically select prebuilt binaries for the current OS platform and CPU architecture, where available.
|
||||||
|
|
||||||
|
Some package managers support multiple platforms and architectures within the same installation tree.
|
||||||
|
|
||||||
|
### npm
|
||||||
|
|
||||||
|
Use the `--os`, `--cpu` and `--libc` flags:
|
||||||
|
|
||||||
|
Example to support both Intel and ARM CPUs on macOS:
|
||||||
|
```sh
|
||||||
|
npm install --cpu=x64 --os=darwin sharp
|
||||||
|
npm install --cpu=arm64 --os=darwin sharp
|
||||||
|
```
|
||||||
|
|
||||||
|
Example to support both glibc and musl-based Linux:
|
||||||
|
```sh
|
||||||
|
npm install --cpu=x64 --os=linux sharp
|
||||||
|
npm install --cpu=x64 --os=linux --libc=musl sharp
|
||||||
|
```
|
||||||
|
|
||||||
|
### yarn
|
||||||
|
|
||||||
|
Use the [supportedArchitectures](https://yarnpkg.com/configuration/yarnrc#supportedArchitectures) configuration.
|
||||||
|
|
||||||
|
### pnpm
|
||||||
|
|
||||||
|
Use the [supportedArchitectures](https://pnpm.io/package_json#pnpmsupportedarchitectures) configuration.
|
||||||
|
|
||||||
## Custom libvips
|
## Custom libvips
|
||||||
|
|
||||||
To use a custom, globally-installed version of libvips instead of the provided binaries,
|
To use a custom, globally-installed version of libvips instead of the provided binaries,
|
||||||
@@ -83,6 +113,10 @@ can be used to configure the target environment.
|
|||||||
Experimental support is provided for runtime environments that provide
|
Experimental support is provided for runtime environments that provide
|
||||||
multi-threaded Wasm via Workers.
|
multi-threaded Wasm via Workers.
|
||||||
|
|
||||||
|
Use in web browsers is unsupported.
|
||||||
|
|
||||||
|
Native text rendering is unsupported.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install --cpu=wasm32 sharp
|
npm install --cpu=wasm32 sharp
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -9,26 +9,26 @@ The I/O limits of the relevant (de)compression library will generally determine
|
|||||||
|
|
||||||
## Contenders
|
## Contenders
|
||||||
|
|
||||||
* [jimp](https://www.npmjs.com/package/jimp) v0.22.7 - Image processing in pure JavaScript.
|
* [jimp](https://www.npmjs.com/package/jimp) v0.22.10 - Image processing in pure JavaScript.
|
||||||
* [imagemagick](https://www.npmjs.com/package/imagemagick) v0.1.3 - Supports filesystem only and "*has been unmaintained for a long time*".
|
* [imagemagick](https://www.npmjs.com/package/imagemagick) v0.1.3 - Supports filesystem only and "*has been unmaintained for a long time*".
|
||||||
* [gm](https://www.npmjs.com/package/gm) v1.25.0 - Fully featured wrapper around GraphicsMagick's `gm` command line utility.
|
* [gm](https://www.npmjs.com/package/gm) v1.25.0 - Fully featured wrapper around GraphicsMagick's `gm` command line utility.
|
||||||
* [@squoosh/lib](https://www.npmjs.com/package/@squoosh/lib) v0.4.0 - Image libraries transpiled to WebAssembly, includes GPLv3 code, but "*Project no longer maintained*".
|
* [@squoosh/lib](https://www.npmjs.com/package/@squoosh/lib) v0.5.3 - Image libraries transpiled to WebAssembly, includes GPLv3 code, but "*Project no longer maintained*".
|
||||||
* [@squoosh/cli](https://www.npmjs.com/package/@squoosh/cli) v0.7.3 - Command line wrapper around `@squoosh/lib`, avoids GPLv3 by spawning process, but "*Project no longer maintained*".
|
* [@squoosh/cli](https://www.npmjs.com/package/@squoosh/cli) v0.7.3 - Command line wrapper around `@squoosh/lib`, avoids GPLv3 by spawning process, but "*Project no longer maintained*".
|
||||||
* sharp v0.32.0 / libvips v8.14.2 - Caching within libvips disabled to ensure a fair comparison.
|
* sharp v0.33.0 / libvips v8.15.0 - Caching within libvips disabled to ensure a fair comparison.
|
||||||
|
|
||||||
## Environment
|
## Environment
|
||||||
|
|
||||||
### AMD64
|
### AMD64
|
||||||
|
|
||||||
* AWS EC2 us-east-2 [c6a.xlarge](https://aws.amazon.com/ec2/instance-types/c6a/) (4x AMD EPYC 7R13)
|
* AWS EC2 us-east-2 [c7a.xlarge](https://aws.amazon.com/ec2/instance-types/c7a/) (4x AMD EPYC 9R14)
|
||||||
* Ubuntu 22.04 20230303 (ami-0122295b0eb922138)
|
* Ubuntu 23.10 [13f233a16be2](https://hub.docker.com/layers/library/ubuntu/23.10/images/sha256-13f233a16be210b57907b98b0d927ceff7571df390701e14fe1f3901b2c4a4d7)
|
||||||
* Node.js 16.19.1
|
* Node.js 20.10.0
|
||||||
|
|
||||||
### ARM64
|
### ARM64
|
||||||
|
|
||||||
* AWS EC2 us-east-2 [c7g.xlarge](https://aws.amazon.com/ec2/instance-types/c7g/) (4x ARM Graviton3)
|
* AWS EC2 us-east-2 [c7g.xlarge](https://aws.amazon.com/ec2/instance-types/c7g/) (4x ARM Graviton3)
|
||||||
* Ubuntu 22.04 20230303 (ami-0af198159897e7a29)
|
* Ubuntu 23.10 [7708743264cb](https://hub.docker.com/layers/library/ubuntu/23.10/images/sha256-7708743264cbb7f6cf7fc13e915faece45a6cdda455748bc55e58e8de3d27b63)
|
||||||
* Node.js 16.19.1
|
* Node.js 20.10.0
|
||||||
|
|
||||||
## Task: JPEG
|
## Task: JPEG
|
||||||
|
|
||||||
@@ -43,28 +43,28 @@ Note: jimp does not support Lanczos 3, bicubic resampling used instead.
|
|||||||
| Module | Input | Output | Ops/sec | Speed-up |
|
| Module | Input | Output | Ops/sec | Speed-up |
|
||||||
| :----------------- | :----- | :----- | ------: | -------: |
|
| :----------------- | :----- | :----- | ------: | -------: |
|
||||||
| jimp | buffer | buffer | 0.84 | 1.0 |
|
| jimp | buffer | buffer | 0.84 | 1.0 |
|
||||||
| squoosh-cli | file | file | 1.07 | 1.3 |
|
| squoosh-cli | file | file | 1.54 | 1.8 |
|
||||||
| squoosh-lib | buffer | buffer | 1.82 | 2.2 |
|
| squoosh-lib | buffer | buffer | 2.24 | 2.7 |
|
||||||
| gm | buffer | buffer | 8.41 | 10.0 |
|
| imagemagick | file | file | 11.75 | 14.0 |
|
||||||
| gm | file | file | 8.45 | 10.0 |
|
| gm | buffer | buffer | 12.66 | 15.1 |
|
||||||
| imagemagick | file | file | 8.77 | 10.4 |
|
| gm | file | file | 12.72 | 15.1 |
|
||||||
| sharp | stream | stream | 36.36 | 43.3 |
|
| sharp | stream | stream | 48.31 | 57.5 |
|
||||||
| sharp | file | file | 38.67 | 46.0 |
|
| sharp | file | file | 51.42 | 61.2 |
|
||||||
| sharp | buffer | buffer | 39.44 | 47.0 |
|
| sharp | buffer | buffer | 52.41 | 62.4 |
|
||||||
|
|
||||||
#### Results: JPEG (ARM64)
|
#### Results: JPEG (ARM64)
|
||||||
|
|
||||||
| Module | Input | Output | Ops/sec | Speed-up |
|
| Module | Input | Output | Ops/sec | Speed-up |
|
||||||
| :----------------- | :----- | :----- | ------: | -------: |
|
| :----------------- | :----- | :----- | ------: | -------: |
|
||||||
| jimp | buffer | buffer | 1.02 | 1.0 |
|
| jimp | buffer | buffer | 0.88 | 1.0 |
|
||||||
| squoosh-cli | file | file | 1.11 | 1.1 |
|
| squoosh-cli | file | file | 1.18 | 1.3 |
|
||||||
| squoosh-lib | buffer | buffer | 2.08 | 2.0 |
|
| squoosh-lib | buffer | buffer | 1.99 | 2.3 |
|
||||||
| gm | buffer | buffer | 8.80 | 8.6 |
|
| gm | buffer | buffer | 6.06 | 6.9 |
|
||||||
| gm | file | file | 10.05 | 9.9 |
|
| gm | file | file | 10.81 | 12.3 |
|
||||||
| imagemagick | file | file | 10.28 | 10.1 |
|
| imagemagick | file | file | 10.95 | 12.4 |
|
||||||
| sharp | stream | stream | 26.87 | 26.3 |
|
| sharp | stream | stream | 33.15 | 37.7 |
|
||||||
| sharp | file | file | 27.88 | 27.3 |
|
| sharp | file | file | 34.99 | 39.8 |
|
||||||
| sharp | buffer | buffer | 28.40 | 27.8 |
|
| sharp | buffer | buffer | 36.05 | 41.0 |
|
||||||
|
|
||||||
## Task: PNG
|
## Task: PNG
|
||||||
|
|
||||||
@@ -80,25 +80,25 @@ Note: jimp does not support premultiply/unpremultiply.
|
|||||||
|
|
||||||
| Module | Input | Output | Ops/sec | Speed-up |
|
| Module | Input | Output | Ops/sec | Speed-up |
|
||||||
| :----------------- | :----- | :----- | ------: | -------: |
|
| :----------------- | :----- | :----- | ------: | -------: |
|
||||||
| squoosh-cli | file | file | 0.40 | 1.0 |
|
| squoosh-cli | file | file | 0.34 | 1.0 |
|
||||||
| squoosh-lib | buffer | buffer | 0.47 | 1.2 |
|
| squoosh-lib | buffer | buffer | 0.51 | 1.5 |
|
||||||
| gm | file | file | 6.47 | 16.2 |
|
| jimp | buffer | buffer | 3.59 | 10.6 |
|
||||||
| jimp | buffer | buffer | 6.60 | 16.5 |
|
| gm | file | file | 8.54 | 25.1 |
|
||||||
| imagemagick | file | file | 7.08 | 17.7 |
|
| imagemagick | file | file | 9.23 | 27.1 |
|
||||||
| sharp | file | file | 17.80 | 44.5 |
|
| sharp | file | file | 25.43 | 74.8 |
|
||||||
| sharp | buffer | buffer | 18.02 | 45.0 |
|
| sharp | buffer | buffer | 25.70 | 75.6 |
|
||||||
|
|
||||||
### Results: PNG (ARM64)
|
### Results: PNG (ARM64)
|
||||||
|
|
||||||
| Module | Input | Output | Ops/sec | Speed-up |
|
| Module | Input | Output | Ops/sec | Speed-up |
|
||||||
| :----------------- | :----- | :----- | ------: | -------: |
|
| :----------------- | :----- | :----- | ------: | -------: |
|
||||||
| squoosh-cli | file | file | 0.40 | 1.0 |
|
| squoosh-cli | file | file | 0.33 | 1.0 |
|
||||||
| squoosh-lib | buffer | buffer | 0.48 | 1.2 |
|
| squoosh-lib | buffer | buffer | 0.46 | 1.4 |
|
||||||
| gm | file | file | 7.20 | 18.0 |
|
| jimp | buffer | buffer | 3.51 | 10.6 |
|
||||||
| jimp | buffer | buffer | 7.62 | 19.1 |
|
| gm | file | file | 7.47 | 22.6 |
|
||||||
| imagemagick | file | file | 7.96 | 19.9 |
|
| imagemagick | file | file | 8.06 | 24.4 |
|
||||||
| sharp | file | file | 12.97 | 32.4 |
|
| sharp | file | file | 17.31 | 52.5 |
|
||||||
| sharp | buffer | buffer | 13.12 | 32.8 |
|
| sharp | buffer | buffer | 17.66 | 53.5 |
|
||||||
|
|
||||||
## Running the benchmark test
|
## Running the benchmark test
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -22,6 +22,10 @@ const debuglog = util.debuglog('sharp');
|
|||||||
*
|
*
|
||||||
* Implements the [stream.Duplex](http://nodejs.org/api/stream.html#stream_class_stream_duplex) class.
|
* Implements the [stream.Duplex](http://nodejs.org/api/stream.html#stream_class_stream_duplex) class.
|
||||||
*
|
*
|
||||||
|
* When loading more than one page/frame of an animated image,
|
||||||
|
* these are combined as a vertically-stacked "toilet roll" image
|
||||||
|
* where the overall height is the `pageHeight` multiplied by the number of `pages`.
|
||||||
|
*
|
||||||
* @constructs Sharp
|
* @constructs Sharp
|
||||||
*
|
*
|
||||||
* @emits Sharp#info
|
* @emits Sharp#info
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-darwin-arm64",
|
"name": "@img/sharp-darwin-arm64",
|
||||||
"version": "0.33.0-rc.1",
|
"version": "0.33.0",
|
||||||
"description": "Prebuilt sharp for use with macOS 64-bit ARM",
|
"description": "Prebuilt sharp for use with macOS 64-bit ARM",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-darwin-x64",
|
"name": "@img/sharp-darwin-x64",
|
||||||
"version": "0.33.0-rc.1",
|
"version": "0.33.0",
|
||||||
"description": "Prebuilt sharp for use with macOS x64",
|
"description": "Prebuilt sharp for use with macOS x64",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linux-arm",
|
"name": "@img/sharp-linux-arm",
|
||||||
"version": "0.33.0-rc.1",
|
"version": "0.33.0",
|
||||||
"description": "Prebuilt sharp for use with Linux (glibc) ARM (32-bit)",
|
"description": "Prebuilt sharp for use with Linux (glibc) ARM (32-bit)",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linux-arm64",
|
"name": "@img/sharp-linux-arm64",
|
||||||
"version": "0.33.0-rc.1",
|
"version": "0.33.0",
|
||||||
"description": "Prebuilt sharp for use with Linux (glibc) 64-bit ARM",
|
"description": "Prebuilt sharp for use with Linux (glibc) 64-bit ARM",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linux-s390x",
|
"name": "@img/sharp-linux-s390x",
|
||||||
"version": "0.33.0-rc.1",
|
"version": "0.33.0",
|
||||||
"description": "Prebuilt sharp for use with Linux (glibc) s390x",
|
"description": "Prebuilt sharp for use with Linux (glibc) s390x",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linux-x64",
|
"name": "@img/sharp-linux-x64",
|
||||||
"version": "0.33.0-rc.1",
|
"version": "0.33.0",
|
||||||
"description": "Prebuilt sharp for use with Linux (glibc) x64",
|
"description": "Prebuilt sharp for use with Linux (glibc) x64",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linuxmusl-arm64",
|
"name": "@img/sharp-linuxmusl-arm64",
|
||||||
"version": "0.33.0-rc.1",
|
"version": "0.33.0",
|
||||||
"description": "Prebuilt sharp for use with Linux (musl) 64-bit ARM",
|
"description": "Prebuilt sharp for use with Linux (musl) 64-bit ARM",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linuxmusl-x64",
|
"name": "@img/sharp-linuxmusl-x64",
|
||||||
"version": "0.33.0-rc.1",
|
"version": "0.33.0",
|
||||||
"description": "Prebuilt sharp for use with Linux (musl) x64",
|
"description": "Prebuilt sharp for use with Linux (musl) x64",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp",
|
"name": "@img/sharp",
|
||||||
"version": "0.33.0-rc.1",
|
"version": "0.33.0",
|
||||||
"private": "true",
|
"private": "true",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"darwin-arm64",
|
"darwin-arm64",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-wasm32",
|
"name": "@img/sharp-wasm32",
|
||||||
"version": "0.33.0-rc.1",
|
"version": "0.33.0",
|
||||||
"description": "Prebuilt sharp for use with wasm32",
|
"description": "Prebuilt sharp for use with wasm32",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-win32-ia32",
|
"name": "@img/sharp-win32-ia32",
|
||||||
"version": "0.33.0-rc.1",
|
"version": "0.33.0",
|
||||||
"description": "Prebuilt sharp for use with Windows x86 (32-bit)",
|
"description": "Prebuilt sharp for use with Windows x86 (32-bit)",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-win32-x64",
|
"name": "@img/sharp-win32-x64",
|
||||||
"version": "0.33.0-rc.1",
|
"version": "0.33.0",
|
||||||
"description": "Prebuilt sharp for use with Windows x64",
|
"description": "Prebuilt sharp for use with Windows x64",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
24
package.json
24
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "sharp",
|
"name": "sharp",
|
||||||
"description": "High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",
|
"description": "High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",
|
||||||
"version": "0.33.0-rc.1",
|
"version": "0.33.0",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://github.com/lovell/sharp",
|
"homepage": "https://github.com/lovell/sharp",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
@@ -141,8 +141,8 @@
|
|||||||
"semver": "^7.5.4"
|
"semver": "^7.5.4"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-darwin-arm64": "0.33.0-rc.1",
|
"@img/sharp-darwin-arm64": "0.33.0",
|
||||||
"@img/sharp-darwin-x64": "0.33.0-rc.1",
|
"@img/sharp-darwin-x64": "0.33.0",
|
||||||
"@img/sharp-libvips-darwin-arm64": "1.0.0",
|
"@img/sharp-libvips-darwin-arm64": "1.0.0",
|
||||||
"@img/sharp-libvips-darwin-x64": "1.0.0",
|
"@img/sharp-libvips-darwin-x64": "1.0.0",
|
||||||
"@img/sharp-libvips-linux-arm": "1.0.0",
|
"@img/sharp-libvips-linux-arm": "1.0.0",
|
||||||
@@ -151,15 +151,15 @@
|
|||||||
"@img/sharp-libvips-linux-x64": "1.0.0",
|
"@img/sharp-libvips-linux-x64": "1.0.0",
|
||||||
"@img/sharp-libvips-linuxmusl-arm64": "1.0.0",
|
"@img/sharp-libvips-linuxmusl-arm64": "1.0.0",
|
||||||
"@img/sharp-libvips-linuxmusl-x64": "1.0.0",
|
"@img/sharp-libvips-linuxmusl-x64": "1.0.0",
|
||||||
"@img/sharp-linux-arm": "0.33.0-rc.1",
|
"@img/sharp-linux-arm": "0.33.0",
|
||||||
"@img/sharp-linux-arm64": "0.33.0-rc.1",
|
"@img/sharp-linux-arm64": "0.33.0",
|
||||||
"@img/sharp-linux-s390x": "0.33.0-rc.1",
|
"@img/sharp-linux-s390x": "0.33.0",
|
||||||
"@img/sharp-linux-x64": "0.33.0-rc.1",
|
"@img/sharp-linux-x64": "0.33.0",
|
||||||
"@img/sharp-linuxmusl-arm64": "0.33.0-rc.1",
|
"@img/sharp-linuxmusl-arm64": "0.33.0",
|
||||||
"@img/sharp-linuxmusl-x64": "0.33.0-rc.1",
|
"@img/sharp-linuxmusl-x64": "0.33.0",
|
||||||
"@img/sharp-wasm32": "0.33.0-rc.1",
|
"@img/sharp-wasm32": "0.33.0",
|
||||||
"@img/sharp-win32-ia32": "0.33.0-rc.1",
|
"@img/sharp-win32-ia32": "0.33.0",
|
||||||
"@img/sharp-win32-x64": "0.33.0-rc.1"
|
"@img/sharp-win32-x64": "0.33.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@emnapi/runtime": "^0.44.0",
|
"@emnapi/runtime": "^0.44.0",
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
FROM ubuntu:22.04
|
FROM ubuntu:23.10
|
||||||
ARG BRANCH=main
|
ARG BRANCH=main
|
||||||
|
|
||||||
# Install basic dependencies
|
# Install basic dependencies
|
||||||
RUN apt-get -y update && apt-get install -y build-essential curl git
|
RUN apt-get -y update && apt-get install -y build-essential curl git ca-certificates gnupg
|
||||||
|
|
||||||
# Install latest Node.js LTS
|
# Install latest Node.js LTS
|
||||||
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
RUN mkdir -p /etc/apt/keyrings
|
||||||
RUN apt-get install -y nodejs
|
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
||||||
|
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
|
||||||
|
RUN apt-get -y update && apt-get install -y nodejs
|
||||||
|
|
||||||
# Install benchmark dependencies
|
# Install benchmark dependencies
|
||||||
RUN apt-get install -y imagemagick libmagick++-dev graphicsmagick
|
RUN apt-get install -y imagemagick libmagick++-dev graphicsmagick
|
||||||
|
|||||||
@@ -10,14 +10,14 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@squoosh/cli": "0.7.3",
|
"@squoosh/cli": "0.7.3",
|
||||||
"@squoosh/lib": "0.5.3",
|
"@squoosh/lib": "0.5.3",
|
||||||
"async": "3.2.4",
|
"async": "3.2.5",
|
||||||
"benchmark": "2.1.4",
|
"benchmark": "2.1.4",
|
||||||
"gm": "1.25.0",
|
"gm": "1.25.0",
|
||||||
"imagemagick": "0.1.3",
|
"imagemagick": "0.1.3",
|
||||||
"jimp": "0.22.10"
|
"jimp": "0.22.10"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@tensorflow/tfjs-node": "4.11.0",
|
"@tensorflow/tfjs-node": "4.13.0",
|
||||||
"mapnik": "4.5.9"
|
"mapnik": "4.5.9"
|
||||||
},
|
},
|
||||||
"license": "Apache-2.0"
|
"license": "Apache-2.0"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
if ! type valgrind >/dev/null; then
|
if ! type valgrind >/dev/null; then
|
||||||
echo "Please install valgrind before running memory leak tests"
|
echo "Please install valgrind before running memory leak tests"
|
||||||
@@ -7,14 +8,15 @@ fi
|
|||||||
|
|
||||||
curl -s -o ./test/leak/libvips.supp https://raw.githubusercontent.com/libvips/libvips/master/suppressions/valgrind.supp
|
curl -s -o ./test/leak/libvips.supp https://raw.githubusercontent.com/libvips/libvips/master/suppressions/valgrind.supp
|
||||||
|
|
||||||
for test in ./test/unit/*.js; do
|
TESTS=$(ls test/unit --ignore=svg.js --ignore=text.js)
|
||||||
|
for test in $TESTS; do
|
||||||
G_SLICE=always-malloc G_DEBUG=gc-friendly VIPS_LEAK=1 VIPS_NOVECTOR=1 valgrind \
|
G_SLICE=always-malloc G_DEBUG=gc-friendly VIPS_LEAK=1 VIPS_NOVECTOR=1 valgrind \
|
||||||
--suppressions=test/leak/libvips.supp \
|
--suppressions=test/leak/libvips.supp \
|
||||||
--suppressions=test/leak/sharp.supp \
|
--suppressions=test/leak/sharp.supp \
|
||||||
--gen-suppressions=yes \
|
--gen-suppressions=yes \
|
||||||
--leak-check=full \
|
--leak-check=full \
|
||||||
--show-leak-kinds=definite,indirect,possible \
|
--show-leak-kinds=definite,indirect \
|
||||||
--num-callers=20 \
|
--num-callers=20 \
|
||||||
--trace-children=yes \
|
--trace-children=yes \
|
||||||
node --expose-gc node_modules/.bin/mocha --no-config --slow=60000 --timeout=120000 --require test/beforeEach.js "$test";
|
node --expose-gc --zero-fill-buffers node_modules/.bin/mocha --no-config --slow=60000 --timeout=120000 --require test/beforeEach.js "test/unit/$test";
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -173,41 +173,6 @@
|
|||||||
fun:TIFFWriteEncodedTile
|
fun:TIFFWriteEncodedTile
|
||||||
}
|
}
|
||||||
|
|
||||||
# gsf
|
|
||||||
{
|
|
||||||
param_gsf_output_write
|
|
||||||
Memcheck:Param
|
|
||||||
write(buf)
|
|
||||||
fun:write
|
|
||||||
...
|
|
||||||
fun:gsf_output_write
|
|
||||||
}
|
|
||||||
{
|
|
||||||
value_gsf_output_write_crc32_little
|
|
||||||
Memcheck:Value8
|
|
||||||
fun:crc32_little
|
|
||||||
...
|
|
||||||
fun:gsf_output_write
|
|
||||||
}
|
|
||||||
{
|
|
||||||
param_gsf_new_do_write
|
|
||||||
Memcheck:Param
|
|
||||||
write(buf)
|
|
||||||
...
|
|
||||||
fun:new_do_write
|
|
||||||
...
|
|
||||||
fun:gsf_output_close
|
|
||||||
}
|
|
||||||
{
|
|
||||||
param_gsf_output_write
|
|
||||||
Memcheck:Param
|
|
||||||
write(buf)
|
|
||||||
...
|
|
||||||
fun:new_do_write
|
|
||||||
...
|
|
||||||
fun:gsf_output_write
|
|
||||||
}
|
|
||||||
|
|
||||||
# fontconfig
|
# fontconfig
|
||||||
{
|
{
|
||||||
leak_fontconfig_FcConfigSubstituteWithPat
|
leak_fontconfig_FcConfigSubstituteWithPat
|
||||||
@@ -349,11 +314,39 @@
|
|||||||
fun:heif_context_read_from_reader
|
fun:heif_context_read_from_reader
|
||||||
}
|
}
|
||||||
|
|
||||||
# orc
|
# glib
|
||||||
{
|
{
|
||||||
addr_orcexec
|
leak_glib__tls_get_addr
|
||||||
Memcheck:Addr1
|
Memcheck:Leak
|
||||||
obj:*/orcexec.*
|
match-leak-kinds: possible
|
||||||
|
...
|
||||||
|
fun:malloc
|
||||||
|
fun:allocate_dtv_entry
|
||||||
|
fun:allocate_and_init
|
||||||
|
fun:tls_get_addr_tail
|
||||||
|
fun:__tls_get_addr
|
||||||
|
}
|
||||||
|
{
|
||||||
|
value_g_utf8_make_valid_strlen
|
||||||
|
Memcheck:Value8
|
||||||
|
fun:strlen
|
||||||
|
fun:g_utf8_make_valid
|
||||||
|
}
|
||||||
|
{
|
||||||
|
value_g_utf8_make_valid_strncpy
|
||||||
|
Memcheck:Value8
|
||||||
|
fun:strncpy
|
||||||
|
fun:g_strndup
|
||||||
|
...
|
||||||
|
fun:g_utf8_make_valid
|
||||||
|
}
|
||||||
|
{
|
||||||
|
cond_g_utf8_make_valid_strncpy
|
||||||
|
Memcheck:Cond
|
||||||
|
fun:strncpy
|
||||||
|
fun:g_strndup
|
||||||
|
...
|
||||||
|
fun:g_utf8_make_valid
|
||||||
}
|
}
|
||||||
|
|
||||||
# libvips
|
# libvips
|
||||||
@@ -943,6 +936,79 @@
|
|||||||
...
|
...
|
||||||
fun:_ZN2v88internal18ArrayBufferSweeper10ReleaseAllEv
|
fun:_ZN2v88internal18ArrayBufferSweeper10ReleaseAllEv
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
cond_node_Builtins_JSEntry
|
||||||
|
Memcheck:Cond
|
||||||
|
...
|
||||||
|
fun:Builtins_JSEntry
|
||||||
|
...
|
||||||
|
fun:uv__poll_io_uring
|
||||||
|
}
|
||||||
|
{
|
||||||
|
cond_node_Builtins_TestEqualStrictHandler
|
||||||
|
Memcheck:Cond
|
||||||
|
fun:Builtins_TestEqualStrictHandler
|
||||||
|
...
|
||||||
|
fun:uv__poll_io_uring
|
||||||
|
}
|
||||||
|
{
|
||||||
|
cond_node_Builtins_TestGreaterThanHandler
|
||||||
|
Memcheck:Cond
|
||||||
|
fun:Builtins_TestGreaterThanHandler
|
||||||
|
...
|
||||||
|
fun:uv__poll_io_uring
|
||||||
|
}
|
||||||
|
{
|
||||||
|
cond_node_AfterStat
|
||||||
|
Memcheck:Cond
|
||||||
|
...
|
||||||
|
fun:_ZN4node2fs9AfterStatEP7uv_fs_s
|
||||||
|
...
|
||||||
|
fun:uv__poll_io_uring
|
||||||
|
}
|
||||||
|
{
|
||||||
|
cond_node_AfterMkdirp
|
||||||
|
Memcheck:Cond
|
||||||
|
fun:_ZN4node2fs11AfterMkdirpEP7uv_fs_s
|
||||||
|
fun:_ZN4node24MakeLibuvRequestCallbackI7uv_fs_sPFvPS1_EE7WrapperES2_
|
||||||
|
fun:_ZZZN4node2fs11MKDirpAsyncEP9uv_loop_sP7uv_fs_sPKciPFvS4_EENKUlS4_E_clES4_ENUlS4_E_4_FUNES4_
|
||||||
|
fun:uv__poll_io_uring
|
||||||
|
}
|
||||||
|
{
|
||||||
|
cond_v8_ArrayBufferSweeper_Finalize
|
||||||
|
Memcheck:Cond
|
||||||
|
fun:_ZN2v88internal18ArrayBufferSweeper8FinalizeEv
|
||||||
|
}
|
||||||
|
{
|
||||||
|
cond_v8_AdjustAmountOfExternalAllocatedMemory
|
||||||
|
Memcheck:Cond
|
||||||
|
fun:_ZN2v87Isolate37AdjustAmountOfExternalAllocatedMemoryEl
|
||||||
|
}
|
||||||
|
{
|
||||||
|
cond_v8_IncrementalMarkingLimitReached
|
||||||
|
Memcheck:Cond
|
||||||
|
fun:_ZN2v88internal4Heap30IncrementalMarkingLimitReachedEv
|
||||||
|
}
|
||||||
|
{
|
||||||
|
cond_v8_ShouldExpandOldGenerationOnSlowAllocation
|
||||||
|
Memcheck:Cond
|
||||||
|
fun:_ZN2v88internal4Heap41ShouldExpandOldGenerationOnSlowAllocationEPNS0_9LocalHeapENS0_16AllocationOriginE
|
||||||
|
}
|
||||||
|
{
|
||||||
|
cond_v8_ArrayBufferSweeper_SweepingJob_SweepListFull
|
||||||
|
Memcheck:Cond
|
||||||
|
fun:_ZN2v88internal18ArrayBufferSweeper11SweepingJob13SweepListFullEPNS0_15ArrayBufferListE
|
||||||
|
}
|
||||||
|
{
|
||||||
|
cond_v8_ArrayBufferSweeper_SweepingJob_SweepYoung
|
||||||
|
Memcheck:Cond
|
||||||
|
fun:_ZN2v88internal18ArrayBufferSweeper11SweepingJob10SweepYoungEv
|
||||||
|
}
|
||||||
|
{
|
||||||
|
cond_v8_StartIncrementalMarkingIfAllocationLimitIsReachedBackground
|
||||||
|
Memcheck:Cond
|
||||||
|
fun:_ZN2v88internal4Heap59StartIncrementalMarkingIfAllocationLimitIsReachedBackgroundEv
|
||||||
|
}
|
||||||
{
|
{
|
||||||
addr_v8_ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0
|
addr_v8_ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0
|
||||||
Memcheck:Addr8
|
Memcheck:Addr8
|
||||||
|
|||||||
Reference in New Issue
Block a user