mirror of
https://github.com/lovell/sharp.git
synced 2026-02-10 16:46:14 +01:00
Compare commits
10 Commits
v0.34.5-rc
...
283c7d3f0c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
283c7d3f0c | ||
|
|
34c39fa194 | ||
|
|
7b4c476243 | ||
|
|
084a30f8bf | ||
|
|
3609c61a22 | ||
|
|
dc6820b49f | ||
|
|
f2a49d19c9 | ||
|
|
e062456868 | ||
|
|
6450c704a6 | ||
|
|
f7c95d1bf0 |
@@ -1,5 +1,5 @@
|
|||||||
freebsd_instance:
|
freebsd_instance:
|
||||||
image_family: freebsd-15-0
|
image_family: freebsd-16-0-snap
|
||||||
|
|
||||||
task:
|
task:
|
||||||
name: FreeBSD
|
name: FreeBSD
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/installation.md
vendored
2
.github/ISSUE_TEMPLATE/installation.md
vendored
@@ -31,7 +31,7 @@ please open an issue against that package instead.
|
|||||||
|
|
||||||
<!-- Please place an [x] in the relevant box to confirm. -->
|
<!-- Please place an [x] in the relevant box to confirm. -->
|
||||||
|
|
||||||
- [ ] I am using Node.js with a version that satisfies `^18.17.0 || ^20.3.0 || >=21.0.0`
|
- [ ] I am using Node.js with a version that satisfies `>=20.9.0`
|
||||||
- [ ] I am using Deno
|
- [ ] I am using Deno
|
||||||
- [ ] I am using Bun
|
- [ ] I am using Bun
|
||||||
|
|
||||||
|
|||||||
148
.github/workflows/ci.yml
vendored
148
.github/workflows/ci.yml
vendored
@@ -9,8 +9,8 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v5
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: "24"
|
node-version: "24"
|
||||||
- run: npm install --ignore-scripts
|
- run: npm install --ignore-scripts
|
||||||
@@ -31,123 +31,129 @@ jobs:
|
|||||||
- os: ubuntu-24.04
|
- os: ubuntu-24.04
|
||||||
container: rockylinux:8
|
container: rockylinux:8
|
||||||
nodejs_arch: x64
|
nodejs_arch: x64
|
||||||
nodejs_version: "^18.17.0"
|
nodejs_version: "^20.9.0"
|
||||||
nodejs_version_major: 18
|
nodejs_version_major: 20
|
||||||
platform: linux-x64
|
platform: linux-x64
|
||||||
package: true
|
package: true
|
||||||
- os: ubuntu-24.04
|
- os: ubuntu-24.04
|
||||||
container: rockylinux:8
|
container: rockylinux:8
|
||||||
nodejs_arch: x64
|
nodejs_arch: x64
|
||||||
nodejs_version: "^20.3.0"
|
nodejs_version: "^22"
|
||||||
nodejs_version_major: 20
|
|
||||||
platform: linux-x64
|
|
||||||
- os: ubuntu-24.04
|
|
||||||
container: rockylinux:8
|
|
||||||
nodejs_arch: x64
|
|
||||||
nodejs_version: "^22.9.0"
|
|
||||||
nodejs_version_major: 22
|
nodejs_version_major: 22
|
||||||
platform: linux-x64
|
platform: linux-x64
|
||||||
- os: ubuntu-24.04
|
- os: ubuntu-24.04
|
||||||
container: node:18-alpine3.17
|
container: rockylinux:8
|
||||||
nodejs_version_major: 18
|
nodejs_arch: x64
|
||||||
platform: linuxmusl-x64
|
nodejs_version: "^24"
|
||||||
package: true
|
nodejs_version_major: 24
|
||||||
|
platform: linux-x64
|
||||||
- os: ubuntu-24.04
|
- os: ubuntu-24.04
|
||||||
container: node:20-alpine3.18
|
container: node:20-alpine3.18
|
||||||
nodejs_version_major: 20
|
nodejs_version_major: 20
|
||||||
platform: linuxmusl-x64
|
platform: linuxmusl-x64
|
||||||
|
package: true
|
||||||
- os: ubuntu-24.04
|
- os: ubuntu-24.04
|
||||||
container: node:22-alpine3.20
|
container: node:22-alpine3.20
|
||||||
nodejs_version_major: 22
|
nodejs_version_major: 22
|
||||||
platform: linuxmusl-x64
|
platform: linuxmusl-x64
|
||||||
|
- os: ubuntu-24.04
|
||||||
|
container: node:24-alpine3.22
|
||||||
|
nodejs_version_major: 24
|
||||||
|
platform: linuxmusl-x64
|
||||||
- os: ubuntu-24.04-arm
|
- os: ubuntu-24.04-arm
|
||||||
container: arm64v8/rockylinux:8
|
container: arm64v8/rockylinux:8
|
||||||
nodejs_arch: arm64
|
nodejs_arch: arm64
|
||||||
nodejs_version: "^18.17.0"
|
nodejs_version: "^20.9.0"
|
||||||
nodejs_version_major: 18
|
nodejs_version_major: 20
|
||||||
platform: linux-arm64
|
platform: linux-arm64
|
||||||
package: true
|
package: true
|
||||||
- os: ubuntu-24.04-arm
|
- os: ubuntu-24.04-arm
|
||||||
container: arm64v8/rockylinux:8
|
container: arm64v8/rockylinux:8
|
||||||
nodejs_arch: arm64
|
nodejs_arch: arm64
|
||||||
nodejs_version: "^20.3.0"
|
nodejs_version: "^22"
|
||||||
nodejs_version_major: 20
|
nodejs_version_major: 22
|
||||||
|
platform: linux-arm64
|
||||||
|
- os: ubuntu-24.04-arm
|
||||||
|
container: arm64v8/rockylinux:8
|
||||||
|
nodejs_arch: arm64
|
||||||
|
nodejs_version: "^24"
|
||||||
|
nodejs_version_major: 24
|
||||||
platform: linux-arm64
|
platform: linux-arm64
|
||||||
- os: macos-15-intel
|
- os: macos-15-intel
|
||||||
nodejs_arch: x64
|
nodejs_arch: x64
|
||||||
nodejs_version: "^18.17.0"
|
nodejs_version: "^20.9.0"
|
||||||
nodejs_version_major: 18
|
nodejs_version_major: 20
|
||||||
platform: darwin-x64
|
platform: darwin-x64
|
||||||
package: true
|
package: true
|
||||||
- os: macos-15-intel
|
- os: macos-15-intel
|
||||||
nodejs_arch: x64
|
nodejs_arch: x64
|
||||||
nodejs_version: "^20.3.0"
|
nodejs_version: "^22"
|
||||||
nodejs_version_major: 20
|
nodejs_version_major: 22
|
||||||
platform: darwin-x64
|
platform: darwin-x64
|
||||||
- os: macos-15-intel
|
- os: macos-15-intel
|
||||||
nodejs_arch: x64
|
nodejs_arch: x64
|
||||||
nodejs_version: "^22.9.0"
|
nodejs_version: "^24"
|
||||||
nodejs_version_major: 22
|
nodejs_version_major: 24
|
||||||
platform: darwin-x64
|
platform: darwin-x64
|
||||||
- os: macos-15
|
- os: macos-15
|
||||||
nodejs_arch: arm64
|
nodejs_arch: arm64
|
||||||
nodejs_version: "^18.17.0"
|
nodejs_version: "^20.9.0"
|
||||||
nodejs_version_major: 18
|
nodejs_version_major: 20
|
||||||
platform: darwin-arm64
|
platform: darwin-arm64
|
||||||
package: true
|
package: true
|
||||||
- os: macos-15
|
- os: macos-15
|
||||||
nodejs_arch: arm64
|
nodejs_arch: arm64
|
||||||
nodejs_version: "^20.3.0"
|
nodejs_version: "^22"
|
||||||
nodejs_version_major: 20
|
nodejs_version_major: 22
|
||||||
platform: darwin-arm64
|
platform: darwin-arm64
|
||||||
- os: macos-15
|
- os: macos-15
|
||||||
nodejs_arch: arm64
|
nodejs_arch: arm64
|
||||||
nodejs_version: "^22.9.0"
|
nodejs_version: "^24"
|
||||||
nodejs_version_major: 22
|
nodejs_version_major: 24
|
||||||
platform: darwin-arm64
|
platform: darwin-arm64
|
||||||
- os: windows-2022
|
- os: windows-2022
|
||||||
nodejs_arch: x86
|
nodejs_arch: x86
|
||||||
nodejs_version: "18.18.2" # pinned to avoid 18.19.0 and npm 10
|
nodejs_version: "^20.9.0"
|
||||||
nodejs_version_major: 18
|
nodejs_version_major: 20
|
||||||
platform: win32-ia32
|
platform: win32-ia32
|
||||||
package: true
|
package: true
|
||||||
- os: windows-2022
|
- os: windows-2022
|
||||||
nodejs_arch: x86
|
nodejs_arch: x86
|
||||||
nodejs_version: "^20.3.0"
|
nodejs_version: "^22"
|
||||||
nodejs_version_major: 20
|
|
||||||
platform: win32-ia32
|
|
||||||
- os: windows-2022
|
|
||||||
nodejs_arch: x86
|
|
||||||
nodejs_version: "^22.9.0"
|
|
||||||
nodejs_version_major: 22
|
nodejs_version_major: 22
|
||||||
platform: win32-ia32
|
platform: win32-ia32
|
||||||
- os: windows-2022
|
- os: windows-2022
|
||||||
nodejs_arch: x64
|
nodejs_arch: x64
|
||||||
nodejs_version: "^18.17.0"
|
nodejs_version: "^20.9.0"
|
||||||
nodejs_version_major: 18
|
nodejs_version_major: 20
|
||||||
platform: win32-x64
|
platform: win32-x64
|
||||||
package: true
|
package: true
|
||||||
- os: windows-2022
|
- os: windows-2022
|
||||||
nodejs_arch: x64
|
nodejs_arch: x64
|
||||||
nodejs_version: "^20.3.0"
|
nodejs_version: "^22"
|
||||||
nodejs_version_major: 20
|
nodejs_version_major: 22
|
||||||
platform: win32-x64
|
platform: win32-x64
|
||||||
- os: windows-2022
|
- os: windows-2022
|
||||||
nodejs_arch: x64
|
nodejs_arch: x64
|
||||||
nodejs_version: "^22.9.0"
|
nodejs_version: "^24"
|
||||||
nodejs_version_major: 22
|
nodejs_version_major: 24
|
||||||
platform: win32-x64
|
platform: win32-x64
|
||||||
- os: windows-11-arm
|
- os: windows-11-arm
|
||||||
nodejs_arch: arm64
|
nodejs_arch: arm64
|
||||||
nodejs_version: "^20.3.0"
|
nodejs_version: "^20.9.0"
|
||||||
nodejs_version_major: 20
|
nodejs_version_major: 20
|
||||||
platform: win32-arm64
|
platform: win32-arm64
|
||||||
package: true
|
package: true
|
||||||
- os: windows-11-arm
|
- os: windows-11-arm
|
||||||
nodejs_arch: arm64
|
nodejs_arch: arm64
|
||||||
nodejs_version: "^22.9.0"
|
nodejs_version: "^22"
|
||||||
nodejs_version_major: 22
|
nodejs_version_major: 22
|
||||||
platform: win32-arm64
|
platform: win32-arm64
|
||||||
|
- os: windows-11-arm
|
||||||
|
nodejs_arch: arm64
|
||||||
|
nodejs_version: "^24"
|
||||||
|
nodejs_version_major: 24
|
||||||
|
platform: win32-arm64
|
||||||
steps:
|
steps:
|
||||||
- name: Dependencies (Rocky Linux glibc)
|
- name: Dependencies (Rocky Linux glibc)
|
||||||
if: contains(matrix.container, 'rockylinux')
|
if: contains(matrix.container, 'rockylinux')
|
||||||
@@ -159,22 +165,22 @@ jobs:
|
|||||||
run: apk add build-base git python3 font-noto --update-cache
|
run: apk add build-base git python3 font-noto --update-cache
|
||||||
- name: Dependencies (Python 3.11 - macOS, Windows)
|
- name: Dependencies (Python 3.11 - macOS, Windows)
|
||||||
if: contains(matrix.os, 'macos') || contains(matrix.os, 'windows')
|
if: contains(matrix.os, 'macos') || contains(matrix.os, 'windows')
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
- name: Dependencies (Node.js)
|
- name: Dependencies (Node.js)
|
||||||
if: "!contains(matrix.platform, 'linuxmusl')"
|
if: "!contains(matrix.platform, 'linuxmusl')"
|
||||||
uses: actions/setup-node@v5
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.nodejs_version }}
|
node-version: ${{ matrix.nodejs_version }}
|
||||||
architecture: ${{ matrix.nodejs_arch }}
|
architecture: ${{ matrix.nodejs_arch }}
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: npm run test-unit
|
- run: npm run test-unit
|
||||||
- if: matrix.package
|
- if: matrix.package
|
||||||
run: npm run package-from-local-build
|
run: npm run package-from-local-build
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v6
|
||||||
if: matrix.package
|
if: matrix.package
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.platform }}
|
name: ${{ matrix.platform }}
|
||||||
@@ -191,16 +197,18 @@ jobs:
|
|||||||
image: ${{ matrix.container }}
|
image: ${{ matrix.container }}
|
||||||
volumes:
|
volumes:
|
||||||
- /opt:/opt:rw,rshared
|
- /opt:/opt:rw,rshared
|
||||||
- /opt:/__e/node20:ro,rshared
|
- /opt:/__e/node24:ro,rshared
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- container: node:18-alpine3.17
|
- container: node:20-alpine3.20
|
||||||
nodejs_version_major: 18
|
|
||||||
package: true
|
|
||||||
- container: node:20-alpine3.18
|
|
||||||
nodejs_version_major: 20
|
nodejs_version_major: 20
|
||||||
|
package: true
|
||||||
|
- container: node:22-alpine3.20
|
||||||
|
nodejs_version_major: 22
|
||||||
|
- container: node:24-alpine3.22
|
||||||
|
nodejs_version_major: 24
|
||||||
steps:
|
steps:
|
||||||
- name: Allow Linux musl containers on ARM64 runners # https://github.com/actions/runner/issues/801#issuecomment-2394425757
|
- name: Allow Linux musl containers on ARM64 runners # https://github.com/actions/runner/issues/801#issuecomment-2394425757
|
||||||
shell: sh
|
shell: sh
|
||||||
@@ -211,13 +219,13 @@ jobs:
|
|||||||
ln -s /usr/bin/node /opt/bin/node
|
ln -s /usr/bin/node /opt/bin/node
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
run: apk add build-base git python3 font-noto --update-cache
|
run: apk add build-base git python3 font-noto --update-cache
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: npm run test-unit
|
- run: npm run test-unit
|
||||||
- if: matrix.package
|
- if: matrix.package
|
||||||
run: npm run package-from-local-build
|
run: npm run package-from-local-build
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v6
|
||||||
if: matrix.package
|
if: matrix.package
|
||||||
with:
|
with:
|
||||||
name: linuxmusl-arm64
|
name: linuxmusl-arm64
|
||||||
@@ -238,20 +246,20 @@ jobs:
|
|||||||
base_image: "balenalib/rpi-raspbian:bullseye"
|
base_image: "balenalib/rpi-raspbian:bullseye"
|
||||||
nodejs_arch: armv6l
|
nodejs_arch: armv6l
|
||||||
nodejs_hostname: unofficial-builds.nodejs.org
|
nodejs_hostname: unofficial-builds.nodejs.org
|
||||||
nodejs_version: "18.17.0"
|
nodejs_version: "20.9.0"
|
||||||
nodejs_version_major: 18
|
nodejs_version_major: 20
|
||||||
- platform: linux-s390x
|
- platform: linux-s390x
|
||||||
base_image: "--platform=linux/s390x s390x/debian:bookworm"
|
base_image: "--platform=linux/s390x s390x/debian:bookworm"
|
||||||
nodejs_arch: s390x
|
nodejs_arch: s390x
|
||||||
nodejs_hostname: nodejs.org
|
nodejs_hostname: nodejs.org
|
||||||
nodejs_version: "18.17.0"
|
nodejs_version: "20.9.0"
|
||||||
nodejs_version_major: 18
|
nodejs_version_major: 20
|
||||||
- platform: linux-ppc64
|
- platform: linux-ppc64
|
||||||
base_image: "--platform=linux/ppc64le ppc64le/debian:bookworm"
|
base_image: "--platform=linux/ppc64le ppc64le/debian:bookworm"
|
||||||
nodejs_arch: ppc64le
|
nodejs_arch: ppc64le
|
||||||
nodejs_hostname: nodejs.org
|
nodejs_hostname: nodejs.org
|
||||||
nodejs_version: "18.17.0"
|
nodejs_version: "20.9.0"
|
||||||
nodejs_version_major: 18
|
nodejs_version_major: 20
|
||||||
- platform: linux-riscv64
|
- platform: linux-riscv64
|
||||||
base_image: "--platform=linux/riscv64 riscv64/debian:trixie"
|
base_image: "--platform=linux/riscv64 riscv64/debian:trixie"
|
||||||
compiler_flags: "-march=rv64gc"
|
compiler_flags: "-march=rv64gc"
|
||||||
@@ -260,7 +268,7 @@ jobs:
|
|||||||
nodejs_version: "20.19.5"
|
nodejs_version: "20.19.5"
|
||||||
nodejs_version_major: 20
|
nodejs_version_major: 20
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: uraimo/run-on-arch-action@v3
|
- uses: uraimo/run-on-arch-action@v3
|
||||||
with:
|
with:
|
||||||
arch: none
|
arch: none
|
||||||
@@ -279,7 +287,7 @@ jobs:
|
|||||||
npm run build
|
npm run build
|
||||||
node --test test/unit/io.js
|
node --test test/unit/io.js
|
||||||
npm run package-from-local-build
|
npm run package-from-local-build
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v6
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.platform }}
|
name: ${{ matrix.platform }}
|
||||||
path: npm/${{ matrix.platform }}
|
path: npm/${{ matrix.platform }}
|
||||||
@@ -291,7 +299,7 @@ jobs:
|
|||||||
needs: lint
|
needs: lint
|
||||||
name: "build-wasm32 [package]"
|
name: "build-wasm32 [package]"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
container: "emscripten/emsdk:4.0.18"
|
container: "emscripten/emsdk:4.0.21"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -311,7 +319,7 @@ jobs:
|
|||||||
test "$EMSCRIPTEN_VERSION_LIBVIPS" = "$EMSCRIPTEN_VERSION_SHARP"
|
test "$EMSCRIPTEN_VERSION_LIBVIPS" = "$EMSCRIPTEN_VERSION_SHARP"
|
||||||
- run: emmake npm run test-unit
|
- run: emmake npm run test-unit
|
||||||
- run: emmake npm run package-from-local-build
|
- run: emmake npm run package-from-local-build
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v6
|
||||||
with:
|
with:
|
||||||
name: wasm32
|
name: wasm32
|
||||||
path: npm/wasm32
|
path: npm/wasm32
|
||||||
@@ -329,12 +337,12 @@ jobs:
|
|||||||
- build-emscripten
|
- build-emscripten
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v7
|
||||||
with:
|
with:
|
||||||
path: npm
|
path: npm
|
||||||
- name: Create npm workspace tarball
|
- name: Create npm workspace tarball
|
||||||
run: tar -vcaf npm-workspace.tar.xz --directory npm --exclude=from-local-build.js .
|
run: tar -vcaf npm-workspace.tar.xz --directory npm --exclude=from-local-build.js .
|
||||||
- uses: actions/setup-node@v5
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '24'
|
node-version: '24'
|
||||||
- name: Create release notes
|
- name: Create release notes
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ smaller, web-friendly JPEG, PNG, WebP, GIF and AVIF images of varying dimensions
|
|||||||
|
|
||||||
It can be used with all JavaScript runtimes
|
It can be used with all JavaScript runtimes
|
||||||
that provide support for Node-API v9, including
|
that provide support for Node-API v9, including
|
||||||
Node.js (^18.17.0 or >= 20.3.0), Deno and Bun.
|
Node.js (>= 20.9.0), Deno and Bun.
|
||||||
|
|
||||||
Resizing an image is typically 4x-5x faster than using the
|
Resizing an image is typically 4x-5x faster than using the
|
||||||
quickest ImageMagick and GraphicsMagick settings
|
quickest ImageMagick and GraphicsMagick settings
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://biomejs.dev/schemas/2.3.4/schema.json",
|
"$schema": "https://biomejs.dev/schemas/2.3.9/schema.json",
|
||||||
"vcs": {
|
"vcs": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"clientKind": "git",
|
"clientKind": "git",
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ Dimensions in the response will respect the `page` and `pages` properties of the
|
|||||||
|
|
||||||
A `Promise` is returned when `callback` is not provided.
|
A `Promise` is returned when `callback` is not provided.
|
||||||
|
|
||||||
- `format`: Name of decoder used to decompress image data e.g. `jpeg`, `png`, `webp`, `gif`, `svg`
|
- `format`: Name of decoder used to parse image e.g. `jpeg`, `png`, `webp`, `gif`, `svg`, `heif`, `tiff`
|
||||||
- `size`: Total size of image in bytes, for Stream and Buffer input only
|
- `size`: Total size of image in bytes, for Stream and Buffer input only
|
||||||
- `width`: Number of pixels wide (EXIF orientation is not taken into consideration, see example below)
|
- `width`: Number of pixels wide (EXIF orientation is not taken into consideration, see example below)
|
||||||
- `height`: Number of pixels high (EXIF orientation is not taken into consideration, see example below)
|
- `height`: Number of pixels high (EXIF orientation is not taken into consideration, see example below)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: v0.34.5 - TBD
|
title: v0.34.5 - 6th November 2025
|
||||||
slug: changelog/v0.34.5
|
slug: changelog/v0.34.5
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
8
docs/src/content/docs/changelog/v0.35.0.md
Normal file
8
docs/src/content/docs/changelog/v0.35.0.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
title: v0.35.0 - TBC
|
||||||
|
slug: changelog/v0.35.0
|
||||||
|
---
|
||||||
|
|
||||||
|
* Upgrade to libvips v8.18.0 for upstream bug fixes.
|
||||||
|
|
||||||
|
* Drop support for Node.js 18, now requires Node.js >= 20.9.0.
|
||||||
@@ -10,7 +10,7 @@ smaller, web-friendly JPEG, PNG, WebP, GIF and AVIF images of varying dimensions
|
|||||||
|
|
||||||
It can be used with all JavaScript runtimes
|
It can be used with all JavaScript runtimes
|
||||||
that provide support for Node-API v9, including
|
that provide support for Node-API v9, including
|
||||||
Node.js >= 18.17.0, Deno and Bun.
|
Node.js >= 20.9.0, Deno and Bun.
|
||||||
|
|
||||||
Resizing an image is typically 4x-5x faster than using the
|
Resizing an image is typically 4x-5x faster than using the
|
||||||
quickest ImageMagick and GraphicsMagick settings
|
quickest ImageMagick and GraphicsMagick settings
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ deno run --allow-env --allow-ffi --allow-read --allow-sys ...
|
|||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
* Node-API v9 compatible runtime e.g. Node.js ^18.17.0 or >=20.3.0.
|
* Node-API v9 compatible runtime e.g. Node.js >= 20.9.0.
|
||||||
|
|
||||||
## Prebuilt binaries
|
## Prebuilt binaries
|
||||||
|
|
||||||
|
|||||||
21
lib/index.d.ts
vendored
21
lib/index.d.ts
vendored
@@ -860,6 +860,7 @@ declare namespace sharp {
|
|||||||
| JxlOptions
|
| JxlOptions
|
||||||
| GifOptions
|
| GifOptions
|
||||||
| Jp2Options
|
| Jp2Options
|
||||||
|
| RawOptions
|
||||||
| TiffOptions,
|
| TiffOptions,
|
||||||
): Sharp;
|
): Sharp;
|
||||||
|
|
||||||
@@ -1027,11 +1028,11 @@ declare namespace sharp {
|
|||||||
openSlide?: OpenSlideInputOptions | undefined;
|
openSlide?: OpenSlideInputOptions | undefined;
|
||||||
/** JPEG 2000 specific input options */
|
/** JPEG 2000 specific input options */
|
||||||
jp2?: Jp2InputOptions | undefined;
|
jp2?: Jp2InputOptions | undefined;
|
||||||
/** Deprecated: use tiff.subifd instead */
|
/** @deprecated Use {@link SharpOptions.tiff} instead */
|
||||||
subifd?: number | undefined;
|
subifd?: number | undefined;
|
||||||
/** Deprecated: use pdf.background instead */
|
/** @deprecated Use {@link SharpOptions.pdf} instead */
|
||||||
pdfBackground?: Colour | Color | undefined;
|
pdfBackground?: Colour | Color | undefined;
|
||||||
/** Deprecated: use openSlide.level instead */
|
/** @deprecated Use {@link SharpOptions.openSlide} instead */
|
||||||
level?: number | undefined;
|
level?: number | undefined;
|
||||||
/** Set to `true` to read all frames/pages of an animated image (equivalent of setting `pages` to `-1`). (optional, default false) */
|
/** Set to `true` to read all frames/pages of an animated image (equivalent of setting `pages` to `-1`). (optional, default false) */
|
||||||
animated?: boolean | undefined;
|
animated?: boolean | undefined;
|
||||||
@@ -1181,6 +1182,10 @@ declare namespace sharp {
|
|||||||
'IFD3'?: ExifDir;
|
'IFD3'?: ExifDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type HeifCompression = 'av1' | 'hevc';
|
||||||
|
|
||||||
|
type Unit = 'inch' | 'cm';
|
||||||
|
|
||||||
interface WriteableMetadata {
|
interface WriteableMetadata {
|
||||||
/** Number of pixels per inch (DPI) */
|
/** Number of pixels per inch (DPI) */
|
||||||
density?: number | undefined;
|
density?: number | undefined;
|
||||||
@@ -1259,7 +1264,7 @@ declare namespace sharp {
|
|||||||
/** Buffer containing raw TIFFTAG_PHOTOSHOP data, if present */
|
/** Buffer containing raw TIFFTAG_PHOTOSHOP data, if present */
|
||||||
tifftagPhotoshop?: Buffer | undefined;
|
tifftagPhotoshop?: Buffer | undefined;
|
||||||
/** The encoder used to compress an HEIF file, `av1` (AVIF) or `hevc` (HEIC) */
|
/** The encoder used to compress an HEIF file, `av1` (AVIF) or `hevc` (HEIC) */
|
||||||
compression?: 'av1' | 'hevc';
|
compression?: HeifCompression | undefined;
|
||||||
/** Default background colour, if present, for PNG (bKGD) and GIF images */
|
/** Default background colour, if present, for PNG (bKGD) and GIF images */
|
||||||
background?: { r: number; g: number; b: number } | { gray: number };
|
background?: { r: number; g: number; b: number } | { gray: number };
|
||||||
/** Details of each level in a multi-level image provided as an array of objects, requires libvips compiled with support for OpenSlide */
|
/** Details of each level in a multi-level image provided as an array of objects, requires libvips compiled with support for OpenSlide */
|
||||||
@@ -1267,7 +1272,7 @@ declare namespace sharp {
|
|||||||
/** Number of Sub Image File Directories in an OME-TIFF image */
|
/** Number of Sub Image File Directories in an OME-TIFF image */
|
||||||
subifds?: number | undefined;
|
subifds?: number | undefined;
|
||||||
/** The unit of resolution (density) */
|
/** The unit of resolution (density) */
|
||||||
resolutionUnit?: 'inch' | 'cm' | undefined;
|
resolutionUnit?: Unit | undefined;
|
||||||
/** String containing format for images loaded via *magick */
|
/** String containing format for images loaded via *magick */
|
||||||
formatMagick?: string | undefined;
|
formatMagick?: string | undefined;
|
||||||
/** Array of keyword/text pairs representing PNG text blocks, if present. */
|
/** Array of keyword/text pairs representing PNG text blocks, if present. */
|
||||||
@@ -1423,7 +1428,7 @@ declare namespace sharp {
|
|||||||
/** quality, integer 1-100 (optional, default 50) */
|
/** quality, integer 1-100 (optional, default 50) */
|
||||||
quality?: number | undefined;
|
quality?: number | undefined;
|
||||||
/** compression format: av1, hevc (optional, default 'av1') */
|
/** compression format: av1, hevc (optional, default 'av1') */
|
||||||
compression?: 'av1' | 'hevc' | undefined;
|
compression?: HeifCompression | undefined;
|
||||||
/** use lossless compression (optional, default false) */
|
/** use lossless compression (optional, default false) */
|
||||||
lossless?: boolean | undefined;
|
lossless?: boolean | undefined;
|
||||||
/** Level of CPU effort to reduce file size, between 0 (fastest) and 9 (slowest) (optional, default 4) */
|
/** Level of CPU effort to reduce file size, between 0 (fastest) and 9 (slowest) (optional, default 4) */
|
||||||
@@ -1481,7 +1486,7 @@ declare namespace sharp {
|
|||||||
/** Write 1-bit images as miniswhite (optional, default false) */
|
/** Write 1-bit images as miniswhite (optional, default false) */
|
||||||
miniswhite?: boolean | undefined;
|
miniswhite?: boolean | undefined;
|
||||||
/** Resolution unit options: inch, cm (optional, default 'inch') */
|
/** Resolution unit options: inch, cm (optional, default 'inch') */
|
||||||
resolutionUnit?: 'inch' | 'cm' | undefined;
|
resolutionUnit?: Unit | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PngOptions extends OutputOptions {
|
interface PngOptions extends OutputOptions {
|
||||||
@@ -1606,7 +1611,7 @@ declare namespace sharp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface RawOptions {
|
interface RawOptions {
|
||||||
depth?: 'char' | 'uchar' | 'short' | 'ushort' | 'int' | 'uint' | 'float' | 'complex' | 'double' | 'dpcomplex';
|
depth?: keyof DepthEnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 1 for grayscale, 2 for grayscale + alpha, 3 for sRGB, 4 for CMYK or RGBA */
|
/** 1 for grayscale, 2 for grayscale + alpha, 3 for sRGB, 4 for CMYK or RGBA */
|
||||||
|
|||||||
@@ -574,7 +574,7 @@ function _isStreamInput () {
|
|||||||
*
|
*
|
||||||
* A `Promise` is returned when `callback` is not provided.
|
* A `Promise` is returned when `callback` is not provided.
|
||||||
*
|
*
|
||||||
* - `format`: Name of decoder used to decompress image data e.g. `jpeg`, `png`, `webp`, `gif`, `svg`
|
* - `format`: Name of decoder used to parse image e.g. `jpeg`, `png`, `webp`, `gif`, `svg`, `heif`, `tiff`
|
||||||
* - `size`: Total size of image in bytes, for Stream and Buffer input only
|
* - `size`: Total size of image in bytes, for Stream and Buffer input only
|
||||||
* - `width`: Number of pixels wide (EXIF orientation is not taken into consideration, see example below)
|
* - `width`: Number of pixels wide (EXIF orientation is not taken into consideration, see example below)
|
||||||
* - `height`: Number of pixels high (EXIF orientation is not taken into consideration, see example below)
|
* - `height`: Number of pixels high (EXIF orientation is not taken into consideration, see example below)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-darwin-arm64",
|
"name": "@img/sharp-darwin-arm64",
|
||||||
"version": "0.34.5-rc.0",
|
"version": "0.34.5",
|
||||||
"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",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-darwin-arm64": "1.2.4"
|
"@img/sharp-libvips-darwin-arm64": "1.3.0-rc.1"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
"./package": "./package.json"
|
"./package": "./package.json"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"os": [
|
"os": [
|
||||||
"darwin"
|
"darwin"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-darwin-x64",
|
"name": "@img/sharp-darwin-x64",
|
||||||
"version": "0.34.5-rc.0",
|
"version": "0.34.5",
|
||||||
"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",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-darwin-x64": "1.2.4"
|
"@img/sharp-libvips-darwin-x64": "1.3.0-rc.1"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
"./package": "./package.json"
|
"./package": "./package.json"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"os": [
|
"os": [
|
||||||
"darwin"
|
"darwin"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linux-arm",
|
"name": "@img/sharp-linux-arm",
|
||||||
"version": "0.34.5-rc.0",
|
"version": "0.34.5",
|
||||||
"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",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-linux-arm": "1.2.4"
|
"@img/sharp-libvips-linux-arm": "1.3.0-rc.1"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
"./package": "./package.json"
|
"./package": "./package.json"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"glibc": ">=2.31"
|
"glibc": ">=2.31"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linux-arm64",
|
"name": "@img/sharp-linux-arm64",
|
||||||
"version": "0.34.5-rc.0",
|
"version": "0.34.5",
|
||||||
"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",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-linux-arm64": "1.2.4"
|
"@img/sharp-libvips-linux-arm64": "1.3.0-rc.1"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
"./package": "./package.json"
|
"./package": "./package.json"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"glibc": ">=2.26"
|
"glibc": ">=2.26"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linux-ppc64",
|
"name": "@img/sharp-linux-ppc64",
|
||||||
"version": "0.34.5-rc.0",
|
"version": "0.34.5",
|
||||||
"description": "Prebuilt sharp for use with Linux (glibc) ppc64",
|
"description": "Prebuilt sharp for use with Linux (glibc) ppc64",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-linux-ppc64": "1.2.4"
|
"@img/sharp-libvips-linux-ppc64": "1.3.0-rc.1"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
"./package": "./package.json"
|
"./package": "./package.json"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"glibc": ">=2.36"
|
"glibc": ">=2.36"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linux-riscv64",
|
"name": "@img/sharp-linux-riscv64",
|
||||||
"version": "0.34.5-rc.0",
|
"version": "0.34.5",
|
||||||
"description": "Prebuilt sharp for use with Linux (glibc) RISC-V 64-bit",
|
"description": "Prebuilt sharp for use with Linux (glibc) RISC-V 64-bit",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-linux-riscv64": "1.2.4"
|
"@img/sharp-libvips-linux-riscv64": "1.3.0-rc.1"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
"./package": "./package.json"
|
"./package": "./package.json"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"glibc": ">=2.41"
|
"glibc": ">=2.41"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linux-s390x",
|
"name": "@img/sharp-linux-s390x",
|
||||||
"version": "0.34.5-rc.0",
|
"version": "0.34.5",
|
||||||
"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",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-linux-s390x": "1.2.4"
|
"@img/sharp-libvips-linux-s390x": "1.3.0-rc.1"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
"./package": "./package.json"
|
"./package": "./package.json"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"glibc": ">=2.36"
|
"glibc": ">=2.36"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linux-x64",
|
"name": "@img/sharp-linux-x64",
|
||||||
"version": "0.34.5-rc.0",
|
"version": "0.34.5",
|
||||||
"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",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-linux-x64": "1.2.4"
|
"@img/sharp-libvips-linux-x64": "1.3.0-rc.1"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
"./package": "./package.json"
|
"./package": "./package.json"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"glibc": ">=2.26"
|
"glibc": ">=2.26"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linuxmusl-arm64",
|
"name": "@img/sharp-linuxmusl-arm64",
|
||||||
"version": "0.34.5-rc.0",
|
"version": "0.34.5",
|
||||||
"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",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-linuxmusl-arm64": "1.2.4"
|
"@img/sharp-libvips-linuxmusl-arm64": "1.3.0-rc.1"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
"./package": "./package.json"
|
"./package": "./package.json"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"musl": ">=1.2.2"
|
"musl": ">=1.2.2"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linuxmusl-x64",
|
"name": "@img/sharp-linuxmusl-x64",
|
||||||
"version": "0.34.5-rc.0",
|
"version": "0.34.5",
|
||||||
"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",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-linuxmusl-x64": "1.2.4"
|
"@img/sharp-libvips-linuxmusl-x64": "1.3.0-rc.1"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
"./package": "./package.json"
|
"./package": "./package.json"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"musl": ">=1.2.2"
|
"musl": ">=1.2.2"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp",
|
"name": "@img/sharp",
|
||||||
"version": "0.34.5-rc.0",
|
"version": "0.34.5",
|
||||||
"private": "true",
|
"private": "true",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"darwin-arm64",
|
"darwin-arm64",
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
"linux-arm",
|
"linux-arm",
|
||||||
"linux-arm64",
|
"linux-arm64",
|
||||||
"linux-ppc64",
|
"linux-ppc64",
|
||||||
|
"linux-riscv64",
|
||||||
"linux-s390x",
|
"linux-s390x",
|
||||||
"linux-x64",
|
"linux-x64",
|
||||||
"linuxmusl-arm64",
|
"linuxmusl-arm64",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-wasm32",
|
"name": "@img/sharp-wasm32",
|
||||||
"version": "0.34.5-rc.0",
|
"version": "0.34.5",
|
||||||
"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",
|
||||||
@@ -28,10 +28,10 @@
|
|||||||
"./versions": "./versions.json"
|
"./versions": "./versions.json"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emnapi/runtime": "^1.7.0"
|
"@emnapi/runtime": "^1.7.1"
|
||||||
},
|
},
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"wasm32"
|
"wasm32"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-win32-arm64",
|
"name": "@img/sharp-win32-arm64",
|
||||||
"version": "0.34.5-rc.0",
|
"version": "0.34.5",
|
||||||
"description": "Prebuilt sharp for use with Windows 64-bit ARM",
|
"description": "Prebuilt sharp for use with Windows 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",
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
"./versions": "./versions.json"
|
"./versions": "./versions.json"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"os": [
|
"os": [
|
||||||
"win32"
|
"win32"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-win32-ia32",
|
"name": "@img/sharp-win32-ia32",
|
||||||
"version": "0.34.5-rc.0",
|
"version": "0.34.5",
|
||||||
"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",
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
"./versions": "./versions.json"
|
"./versions": "./versions.json"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"os": [
|
"os": [
|
||||||
"win32"
|
"win32"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-win32-x64",
|
"name": "@img/sharp-win32-x64",
|
||||||
"version": "0.34.5-rc.0",
|
"version": "0.34.5",
|
||||||
"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",
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
"./versions": "./versions.json"
|
"./versions": "./versions.json"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"os": [
|
"os": [
|
||||||
"win32"
|
"win32"
|
||||||
|
|||||||
78
package.json
78
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.34.5-rc.0",
|
"version": "0.34.5",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
@@ -144,43 +144,43 @@
|
|||||||
"semver": "^7.7.3"
|
"semver": "^7.7.3"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-darwin-arm64": "0.34.5-rc.0",
|
"@img/sharp-darwin-arm64": "0.34.5",
|
||||||
"@img/sharp-darwin-x64": "0.34.5-rc.0",
|
"@img/sharp-darwin-x64": "0.34.5",
|
||||||
"@img/sharp-libvips-darwin-arm64": "1.2.4",
|
"@img/sharp-libvips-darwin-arm64": "1.3.0-rc.1",
|
||||||
"@img/sharp-libvips-darwin-x64": "1.2.4",
|
"@img/sharp-libvips-darwin-x64": "1.3.0-rc.1",
|
||||||
"@img/sharp-libvips-linux-arm": "1.2.4",
|
"@img/sharp-libvips-linux-arm": "1.3.0-rc.1",
|
||||||
"@img/sharp-libvips-linux-arm64": "1.2.4",
|
"@img/sharp-libvips-linux-arm64": "1.3.0-rc.1",
|
||||||
"@img/sharp-libvips-linux-ppc64": "1.2.4",
|
"@img/sharp-libvips-linux-ppc64": "1.3.0-rc.1",
|
||||||
"@img/sharp-libvips-linux-riscv64": "1.2.4",
|
"@img/sharp-libvips-linux-riscv64": "1.3.0-rc.1",
|
||||||
"@img/sharp-libvips-linux-s390x": "1.2.4",
|
"@img/sharp-libvips-linux-s390x": "1.3.0-rc.1",
|
||||||
"@img/sharp-libvips-linux-x64": "1.2.4",
|
"@img/sharp-libvips-linux-x64": "1.3.0-rc.1",
|
||||||
"@img/sharp-libvips-linuxmusl-arm64": "1.2.4",
|
"@img/sharp-libvips-linuxmusl-arm64": "1.3.0-rc.1",
|
||||||
"@img/sharp-libvips-linuxmusl-x64": "1.2.4",
|
"@img/sharp-libvips-linuxmusl-x64": "1.3.0-rc.1",
|
||||||
"@img/sharp-linux-arm": "0.34.5-rc.0",
|
"@img/sharp-linux-arm": "0.34.5",
|
||||||
"@img/sharp-linux-arm64": "0.34.5-rc.0",
|
"@img/sharp-linux-arm64": "0.34.5",
|
||||||
"@img/sharp-linux-ppc64": "0.34.5-rc.0",
|
"@img/sharp-linux-ppc64": "0.34.5",
|
||||||
"@img/sharp-linux-riscv64": "0.34.5-rc.0",
|
"@img/sharp-linux-riscv64": "0.34.5",
|
||||||
"@img/sharp-linux-s390x": "0.34.5-rc.0",
|
"@img/sharp-linux-s390x": "0.34.5",
|
||||||
"@img/sharp-linux-x64": "0.34.5-rc.0",
|
"@img/sharp-linux-x64": "0.34.5",
|
||||||
"@img/sharp-linuxmusl-arm64": "0.34.5-rc.0",
|
"@img/sharp-linuxmusl-arm64": "0.34.5",
|
||||||
"@img/sharp-linuxmusl-x64": "0.34.5-rc.0",
|
"@img/sharp-linuxmusl-x64": "0.34.5",
|
||||||
"@img/sharp-wasm32": "0.34.5-rc.0",
|
"@img/sharp-wasm32": "0.34.5",
|
||||||
"@img/sharp-win32-arm64": "0.34.5-rc.0",
|
"@img/sharp-win32-arm64": "0.34.5",
|
||||||
"@img/sharp-win32-ia32": "0.34.5-rc.0",
|
"@img/sharp-win32-ia32": "0.34.5",
|
||||||
"@img/sharp-win32-x64": "0.34.5-rc.0"
|
"@img/sharp-win32-x64": "0.34.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "^2.3.4",
|
"@biomejs/biome": "^2.3.9",
|
||||||
"@cpplint/cli": "^0.1.0",
|
"@cpplint/cli": "^0.1.0",
|
||||||
"@emnapi/runtime": "^1.7.0",
|
"@emnapi/runtime": "^1.7.1",
|
||||||
"@img/sharp-libvips-dev": "1.2.4",
|
"@img/sharp-libvips-dev": "1.3.0-rc.1",
|
||||||
"@img/sharp-libvips-dev-wasm32": "1.2.4",
|
"@img/sharp-libvips-dev-wasm32": "1.3.0-rc.1",
|
||||||
"@img/sharp-libvips-win32-arm64": "1.2.4",
|
"@img/sharp-libvips-win32-arm64": "1.3.0-rc.1",
|
||||||
"@img/sharp-libvips-win32-ia32": "1.2.4",
|
"@img/sharp-libvips-win32-ia32": "1.3.0-rc.1",
|
||||||
"@img/sharp-libvips-win32-x64": "1.2.4",
|
"@img/sharp-libvips-win32-x64": "1.3.0-rc.1",
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"emnapi": "^1.7.0",
|
"emnapi": "^1.7.1",
|
||||||
"exif-reader": "^2.0.2",
|
"exif-reader": "^2.0.3",
|
||||||
"extract-zip": "^2.0.1",
|
"extract-zip": "^2.0.1",
|
||||||
"icc": "^3.0.0",
|
"icc": "^3.0.0",
|
||||||
"jsdoc-to-markdown": "^9.1.3",
|
"jsdoc-to-markdown": "^9.1.3",
|
||||||
@@ -191,18 +191,12 @@
|
|||||||
},
|
},
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"libvips": ">=8.17.3"
|
"libvips": ">=8.18.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
|
||||||
"cc": {
|
|
||||||
"linelength": "120",
|
|
||||||
"filter": [
|
|
||||||
"build/include"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,7 +120,7 @@
|
|||||||
'conditions': [
|
'conditions': [
|
||||||
['use_global_libvips == "true"', {
|
['use_global_libvips == "true"', {
|
||||||
# Use pkg-config for include and lib
|
# Use pkg-config for include and lib
|
||||||
'include_dirs': ['<!@(PKG_CONFIG_PATH="<(pkg_config_path)" pkg-config --cflags-only-I vips-cpp vips glib-2.0 | sed s\/-I//g)'],
|
'include_dirs': ['<!@(PKG_CONFIG_PATH="<(pkg_config_path)" pkg-config --cflags-only-I vips-cpp vips glib-2.0 | sed s/-I//g)'],
|
||||||
'libraries': ['<!@(PKG_CONFIG_PATH="<(pkg_config_path)" pkg-config --libs vips-cpp)'],
|
'libraries': ['<!@(PKG_CONFIG_PATH="<(pkg_config_path)" pkg-config --libs vips-cpp)'],
|
||||||
'defines': [
|
'defines': [
|
||||||
'SHARP_USE_GLOBAL_LIBVIPS'
|
'SHARP_USE_GLOBAL_LIBVIPS'
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
// Verify platform and compiler compatibility
|
// Verify platform and compiler compatibility
|
||||||
|
|
||||||
#if (VIPS_MAJOR_VERSION < 8) || \
|
#if (VIPS_MAJOR_VERSION < 8) || \
|
||||||
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 17) || \
|
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 18) || \
|
||||||
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 17 && VIPS_MICRO_VERSION < 3)
|
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 18 && VIPS_MICRO_VERSION < 0)
|
||||||
#error "libvips version 8.17.3+ is required - please see https://sharp.pixelplumbing.com/install"
|
#error "libvips version 8.18.0+ is required - please see https://sharp.pixelplumbing.com/install"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__has_include)
|
#if defined(__has_include)
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ sharp('input.gif')
|
|||||||
// From https://sharp.pixelplumbing.com/api-output#examples-9
|
// From https://sharp.pixelplumbing.com/api-output#examples-9
|
||||||
// Extract raw RGB pixel data from JPEG input
|
// Extract raw RGB pixel data from JPEG input
|
||||||
sharp('input.jpg')
|
sharp('input.jpg')
|
||||||
.raw()
|
.raw({ depth: 'ushort' })
|
||||||
.toBuffer({ resolveWithObject: true })
|
.toBuffer({ resolveWithObject: true })
|
||||||
.then(({ data, info }) => {
|
.then(({ data, info }) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
|||||||
@@ -45,11 +45,11 @@ describe('JP2 output', () => {
|
|||||||
assert.strictEqual('png', info.format);
|
assert.strictEqual('png', info.format);
|
||||||
assert.strictEqual(8, info.width);
|
assert.strictEqual(8, info.width);
|
||||||
assert.strictEqual(15, info.height);
|
assert.strictEqual(15, info.height);
|
||||||
assert.strictEqual(4, info.channels);
|
assert.strictEqual(3, info.channels);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('JP2 quality', (done) => {
|
it('JP2 quality', (_t, done) => {
|
||||||
sharp(fixtures.inputJp2)
|
sharp(fixtures.inputJp2)
|
||||||
.resize(320, 240)
|
.resize(320, 240)
|
||||||
.jp2({ quality: 70 })
|
.jp2({ quality: 70 })
|
||||||
@@ -65,7 +65,7 @@ describe('JP2 output', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Without chroma subsampling generates larger file', (done) => {
|
it('Without chroma subsampling generates larger file', (_t, done) => {
|
||||||
// First generate with chroma subsampling (default)
|
// First generate with chroma subsampling (default)
|
||||||
sharp(fixtures.inputJp2)
|
sharp(fixtures.inputJp2)
|
||||||
.resize(320, 240)
|
.resize(320, 240)
|
||||||
@@ -111,7 +111,7 @@ describe('JP2 output', () => {
|
|||||||
it('Invalid JP2 chromaSubsampling value throws error', () => {
|
it('Invalid JP2 chromaSubsampling value throws error', () => {
|
||||||
assert.throws(
|
assert.throws(
|
||||||
() => sharp().jp2({ chromaSubsampling: '4:2:2' }),
|
() => sharp().jp2({ chromaSubsampling: '4:2:2' }),
|
||||||
/Expected one of 4:2:0, 4:4:4 but received 4:2:2 of type string/
|
/Expected one of: 4:2:0, 4:4:4 for chromaSubsampling but received 4:2:2 of type string/
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ describe('libvips binaries', () => {
|
|||||||
process.env.npm_config_arch = 's390x';
|
process.env.npm_config_arch = 's390x';
|
||||||
process.env.npm_config_libc = '';
|
process.env.npm_config_libc = '';
|
||||||
const locatorHash = libvips.yarnLocator();
|
const locatorHash = libvips.yarnLocator();
|
||||||
assert.strictEqual(locatorHash, '4ab19140fd');
|
assert.strictEqual(locatorHash, '8cdba194cb');
|
||||||
delete process.env.npm_config_platform;
|
delete process.env.npm_config_platform;
|
||||||
delete process.env.npm_config_arch;
|
delete process.env.npm_config_arch;
|
||||||
delete process.env.npm_config_libc;
|
delete process.env.npm_config_libc;
|
||||||
|
|||||||
@@ -226,12 +226,11 @@ describe('PNG', () => {
|
|||||||
.png({ colours: 2, palette: false })
|
.png({ colours: 2, palette: false })
|
||||||
.toBuffer();
|
.toBuffer();
|
||||||
|
|
||||||
const { channels, isPalette, bitsPerSample, paletteBitDepth, size, space } = await sharp(data).metadata();
|
const { channels, isPalette, bitsPerSample, paletteBitDepth, space } = await sharp(data).metadata();
|
||||||
assert.strictEqual(channels, 1);
|
assert.strictEqual(channels, 1);
|
||||||
assert.strictEqual(isPalette, false);
|
assert.strictEqual(isPalette, false);
|
||||||
assert.strictEqual(bitsPerSample, 1);
|
assert.strictEqual(bitsPerSample, 1);
|
||||||
assert.strictEqual(paletteBitDepth, undefined);
|
assert.strictEqual(paletteBitDepth, undefined);
|
||||||
assert.strictEqual(size, 89);
|
|
||||||
assert.strictEqual(space, 'b-w');
|
assert.strictEqual(space, 'b-w');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user