Compare commits

...

29 Commits

Author SHA1 Message Date
Lovell Fuller
ee437832e2 Release v0.34.4 2025-09-17 13:57:10 +01:00
Lovell Fuller
529901177b CI/Docs: Deno v2 support 2025-09-17 13:56:49 +01:00
Lovell Fuller
4710092b2a Prerelease v0.34.4-rc.4 2025-09-17 12:53:47 +01:00
Lovell Fuller
ed1ac43e55 CI: Upgrade packaging test dependencies 2025-09-17 12:11:06 +01:00
Lovell Fuller
dfcbceee4b Upgrade sharp-libvips to v1.2.3 2025-09-17 12:10:36 +01:00
Lovell Fuller
35d3f56c67 Ensure TIFF subifd and OpenSlide level are respected
Fixes regression introduced in 852c7f8
2025-09-16 08:44:08 +01:00
Lovell Fuller
9f4bace03b Prerelease v0.34.4-rc.3 2025-09-15 11:18:53 +01:00
Lovell Fuller
b507831a11 CI: Remove dry-run flag
This was temporary whilst setting up auto-publish
2025-09-15 11:18:00 +01:00
Lovell Fuller
905f69837e Prerelease v0.34.4-rc.2 2025-09-15 10:13:47 +01:00
Lovell Fuller
b0154ed83c Upgrade sharp-libvips to v1.2.2 2025-09-15 10:01:04 +01:00
Lovell Fuller
93b814f849 Upgrade to libvips v8.17.2 2025-09-14 12:23:16 +01:00
Lovell Fuller
6d4d44e2fa Docs: improve FreeBSD build-from-source install help 2025-09-13 13:37:35 +01:00
Lovell Fuller
d8686e7c64 Ensure Electron support for images with XMP metadata #4451 2025-09-12 12:33:59 +01:00
Lovell Fuller
23a0e81d98 Docs: changelog and credit for #4452 2025-09-12 11:50:16 +01:00
Maël Nison
43b579c903 Add sharp-libvips rpath for yarn v5 support (#4452)
This should future proof sharp against upcoming
changes in yarn's plug-n-play filesystem layout.
2025-09-12 11:15:04 +01:00
Lovell Fuller
45f8717900 Upgrade color to latest version via CommonJS wrapper package
Allows continued support of non-ESM runtimes - see #4450
2025-09-10 09:21:14 +01:00
Lovell Fuller
c270455007 Bump deps 2025-09-10 08:43:47 +01:00
Lovell Fuller
1835288ab8 Docs: remove frame clutter from code samples 2025-09-08 11:10:51 +01:00
Lovell Fuller
c1e33de33c CI: Automate npm publish-with-provenance
Temporarily flagged with dry-run for now
2025-09-01 12:37:16 +01:00
Lovell Fuller
0e4b648593 Ensure unlimited flag is passed to tiffload #4446 2025-08-29 23:29:24 +01:00
Kleis Auke Wolthuizen
40be212bba Use modern -s command line lists
See: emscripten-core/emscripten@bb615a9
2025-08-29 09:37:59 +01:00
Kleis Auke Wolthuizen
8ceeda9ae9 Remove -sNODEJS_CATCH_EXIT=0 linker flag
Disabled by default since Emscripten 3.1.65, see commit:
emscripten-core/emscripten@cd831e7
2025-08-29 09:37:59 +01:00
Kleis Auke Wolthuizen
16e248f93e Remove -sWASM_BIGINT linker flag
Enabled by default since Emscripten 4.0.0, see commit:
emscripten-core/emscripten@93d2f8d
2025-08-29 09:37:59 +01:00
Kleis Auke Wolthuizen
b77c97067a Remove -sTEXTDECODER=0 linker flag
See: emscripten-core/emscripten@b490c44
2025-08-29 09:37:59 +01:00
Lovell Fuller
660bbdb1c0 Docs: changelog for #4441 2025-08-22 20:01:46 +01:00
Lovell Fuller
4164705113 Bump devDeps 2025-08-22 20:01:18 +01:00
Bayan Bennett
c01e272db5 TypeScript: Ensure KernelEnum includes linear (#4441) 2025-08-21 09:35:41 +01:00
Lovell Fuller
8607ff2f4a Tests: remove extraneous use of toColourspace 2025-08-18 10:33:32 +01:00
Lovell Fuller
cd337e4de3 Docs: extractChannel output colourspace is b-w or grey16 2025-08-18 10:24:55 +01:00
35 changed files with 145 additions and 112 deletions

View File

@@ -269,7 +269,7 @@ jobs:
contents: read contents: read
name: "build-wasm32 [package]" name: "build-wasm32 [package]"
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
container: "emscripten/emsdk:4.0.11" container: "emscripten/emsdk:4.0.14"
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Dependencies - name: Dependencies
@@ -300,6 +300,7 @@ jobs:
release: release:
permissions: permissions:
contents: write contents: write
id-token: write
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
needs: needs:
- build-native - build-native
@@ -314,11 +315,9 @@ jobs:
- 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@v4 - uses: actions/setup-node@v4
if: startsWith(github.ref, 'refs/tags/v')
with: with:
node-version: "24" node-version: '24'
- name: Create release notes - name: Create release notes
if: startsWith(github.ref, 'refs/tags/v')
run: npm run package-release-notes run: npm run package-release-notes
- name: Create GitHub release for tag - name: Create GitHub release for tag
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
@@ -329,3 +328,9 @@ jobs:
prerelease: ${{ contains(github.ref, '-rc') }} prerelease: ${{ contains(github.ref, '-rc') }}
makeLatest: ${{ !contains(github.ref, '-rc') }} makeLatest: ${{ !contains(github.ref, '-rc') }}
bodyFile: release-notes.md bodyFile: release-notes.md
- name: Publish platform-specific npm packages
if: startsWith(github.ref, 'refs/tags/v')
run: cd npm && npm publish --workspaces --tag=${{ contains(github.ref, '-rc') && 'next' || 'latest' }}
- name: Publish sharp npm package
if: startsWith(github.ref, 'refs/tags/v')
run: npm publish --tag=${{ contains(github.ref, '-rc') && 'next' || 'latest' }}

View File

@@ -96,7 +96,7 @@ jobs:
steps: steps:
- name: Install Node.js - name: Install Node.js
if: ${{ matrix.runtime == 'node' }} if: ${{ matrix.runtime == 'node' }}
uses: actions/setup-node@v4 uses: actions/setup-node@v5
with: with:
node-version: 20 node-version: 20
- name: Install pnpm - name: Install pnpm
@@ -106,9 +106,9 @@ jobs:
version: 8 version: 8
- name: Install Deno - name: Install Deno
if: ${{ matrix.runtime == 'deno' }} if: ${{ matrix.runtime == 'deno' }}
uses: denoland/setup-deno@v1 uses: denoland/setup-deno@v2
with: with:
deno-version: v1.x deno-version: v2.x
- name: Install Bun - name: Install Bun
if: ${{ matrix.runtime == 'bun' }} if: ${{ matrix.runtime == 'bun' }}
uses: oven-sh/setup-bun@v2 uses: oven-sh/setup-bun@v2
@@ -117,7 +117,7 @@ jobs:
- name: Version - name: Version
id: version id: version
uses: actions/github-script@v7 uses: actions/github-script@v8
with: with:
script: | script: |
core.setOutput('semver', context.ref.replace('refs/tags/v','')) core.setOutput('semver', context.ref.replace('refs/tags/v',''))
@@ -185,7 +185,9 @@ jobs:
- name: Run with Deno - name: Run with Deno
if: ${{ matrix.runtime == 'deno' }} if: ${{ matrix.runtime == 'deno' }}
run: deno run --allow-read --allow-ffi release.mjs run: |
deno install
deno run --allow-env --allow-ffi --allow-read --allow-sys release.mjs
- name: Run with Bun - name: Run with Bun
if: ${{ matrix.runtime == 'bun' }} if: ${{ matrix.runtime == 'bun' }}

View File

@@ -11,8 +11,8 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"@astrojs/starlight": "^0.34.6", "@astrojs/starlight": "^0.35.2",
"astro": "^5.11.1", "astro": "^5.13.5",
"starlight-auto-sidebar": "^0.1.2" "starlight-auto-sidebar": "^0.1.2"
} }
} }

View File

@@ -323,3 +323,6 @@ GitHub: https://github.com/hans00
Name: Thibaut Patel Name: Thibaut Patel
GitHub: https://github.com/tpatel GitHub: https://github.com/tpatel
Name: Maël Nison
GitHub: https://github.com/arcanis

View File

@@ -61,6 +61,8 @@ const rgba = await sharp(rgb)
Extract a single channel from a multi-channel image. Extract a single channel from a multi-channel image.
The output colourspace will be either `b-w` (8-bit) or `grey16` (16-bit).
**Throws**: **Throws**:

View File

@@ -1,10 +1,28 @@
--- ---
title: v0.34.4 - TBD title: v0.34.4 - 17th September 2025
slug: changelog/v0.34.4 slug: changelog/v0.34.4
--- ---
* Upgrade to libvips v8.17.2 for upstream bug fixes.
* Ensure TIFF `subifd` and OpenSlide `level` input options are respected (regression in 0.34.3).
* Ensure `autoOrient` occurs before non-90 angle rotation. * Ensure `autoOrient` occurs before non-90 angle rotation.
[#4425](https://github.com/lovell/sharp/issues/4425) [#4425](https://github.com/lovell/sharp/issues/4425)
* Ensure `autoOrient` removes existing metadata after shrink-on-load. * Ensure `autoOrient` removes existing metadata after shrink-on-load.
[#4431](https://github.com/lovell/sharp/issues/4431) [#4431](https://github.com/lovell/sharp/issues/4431)
* TypeScript: Ensure `KernelEnum` includes `linear`.
[#4441](https://github.com/lovell/sharp/pull/4441)
[@BayanBennett](https://github.com/BayanBennett)
* Ensure `unlimited` flag is passed upstream when reading TIFF images.
[#4446](https://github.com/lovell/sharp/issues/4446)
* Support Electron memory cage when reading XMP metadata (regression in 0.34.3).
[#4451](https://github.com/lovell/sharp/issues/4451)
* Add sharp-libvips rpath for yarn v5 support.
[#4452](https://github.com/lovell/sharp/pull/4452)
[@arcanis](https://github.com/arcanis)

View File

@@ -25,7 +25,7 @@ rotation, extraction, compositing and gamma correction are available.
Most modern macOS, Windows and Linux systems Most modern macOS, Windows and Linux systems
do not require any additional install or runtime dependencies. do not require any additional install or runtime dependencies.
```sh ```sh frame="none"
npm install sharp npm install sharp
``` ```

View File

@@ -12,28 +12,29 @@ If a package manager lockfile must support multiple platforms,
please see the [cross-platform](#cross-platform) section please see the [cross-platform](#cross-platform) section
to help decide which package manager is appropriate. to help decide which package manager is appropriate.
```sh ```sh frame="none"
npm install sharp npm install sharp
``` ```
```sh ```sh frame="none"
pnpm add sharp pnpm add sharp
``` ```
When using `pnpm`, you may need to add `sharp` to When using `pnpm`, add `sharp` to
[ignoredBuiltDependencies](https://pnpm.io/settings#ignoredbuiltdependencies) [ignoredBuiltDependencies](https://pnpm.io/settings#ignoredbuiltdependencies)
to silence warnings. to silence warnings.
```sh ```sh frame="none"
yarn add sharp yarn add sharp
``` ```
```sh ```sh frame="none"
bun add sharp bun add sharp
``` ```
```sh ```sh frame="none"
deno run --allow-ffi ... deno add --quiet npm:sharp
deno run --allow-env --allow-ffi --allow-read --allow-sys ...
``` ```
## Prerequisites ## Prerequisites
@@ -75,7 +76,7 @@ npm `package-lock.json` files shared by multiple platforms can cause installatio
Provides limited support via `--os`, `--cpu` and `--libc` flags. Provides limited support via `--os`, `--cpu` and `--libc` flags.
To support macOS with Intel x64 and ARM64 CPUs: To support macOS with Intel x64 and ARM64 CPUs:
```sh ```sh frame="none"
npm install --cpu=x64 --os=darwin sharp npm install --cpu=x64 --os=darwin sharp
npm install --cpu=arm64 --os=darwin sharp npm install --cpu=arm64 --os=darwin sharp
``` ```
@@ -83,7 +84,7 @@ npm install --cpu=arm64 --os=darwin sharp
When the cross-target is Linux, the C standard library must be specified. When the cross-target is Linux, the C standard library must be specified.
To support glibc (e.g. Debian) and musl (e.g. Alpine) Linux with Intel x64 CPUs: To support glibc (e.g. Debian) and musl (e.g. Alpine) Linux with Intel x64 CPUs:
```sh ```sh frame="none"
npm install --cpu=x64 --os=linux --libc=glibc sharp npm install --cpu=x64 --os=linux --libc=glibc sharp
npm install --cpu=x64 --os=linux --libc=musl sharp npm install --cpu=x64 --os=linux --libc=musl sharp
``` ```
@@ -129,7 +130,7 @@ Building from source requires:
There is an install-time check for these dependencies. There is an install-time check for these dependencies.
If `node-addon-api` or `node-gyp` cannot be found, try adding them via: If `node-addon-api` or `node-gyp` cannot be found, try adding them via:
```sh ```sh frame="none"
npm install --save node-addon-api node-gyp npm install --save node-addon-api node-gyp
``` ```
@@ -152,19 +153,20 @@ Native text rendering is unsupported.
[Tile-based output](/api-output#tile) is unsupported. [Tile-based output](/api-output#tile) is unsupported.
```sh ```sh frame="none"
npm install --cpu=wasm32 sharp npm install --cpu=wasm32 sharp
``` ```
## FreeBSD ## FreeBSD
The `vips` package must be installed before `npm install` is run. The `vips` package must be installed before `npm install` is run,
as well as the additional [building from source](#building-from-source) dependencies.
```sh ```sh frame="none"
pkg install -y pkgconf vips pkg install -y pkgconf vips
``` ```
```sh ```sh frame="none"
cd /usr/ports/graphics/vips/ && make install clean cd /usr/ports/graphics/vips/ && make install clean
``` ```
@@ -213,7 +215,7 @@ Ensure sharp is excluded from bundling via the
[externals](https://webpack.js.org/configuration/externals/) [externals](https://webpack.js.org/configuration/externals/)
configuration. configuration.
```js ```js frame="none"
externals: { externals: {
'sharp': 'commonjs sharp' 'sharp': 'commonjs sharp'
} }
@@ -225,7 +227,7 @@ Ensure sharp is excluded from bundling via the
[external](https://esbuild.github.io/api/#external) [external](https://esbuild.github.io/api/#external)
configuration. configuration.
```js ```js frame="none"
buildSync({ buildSync({
entryPoints: ['app.js'], entryPoints: ['app.js'],
bundle: true, bundle: true,
@@ -234,14 +236,14 @@ buildSync({
}) })
``` ```
```sh ```sh frame="none"
esbuild app.js --bundle --platform=node --external:sharp esbuild app.js --bundle --platform=node --external:sharp
``` ```
For `serverless-esbuild`, ensure platform-specific binaries are installed For `serverless-esbuild`, ensure platform-specific binaries are installed
via the `serverless.yml` configuration. via the `serverless.yml` configuration.
```yaml ```yaml frame="none"
custom: custom:
esbuild: esbuild:
external: external:
@@ -259,7 +261,7 @@ Ensure `sharp` is unpacked from the ASAR archive file using the
[asarUnpack](https://www.electron.build/app-builder-lib.interface.platformspecificbuildoptions#asarunpack) [asarUnpack](https://www.electron.build/app-builder-lib.interface.platformspecificbuildoptions#asarunpack)
option. option.
```json ```json frame="none"
{ {
"build": { "build": {
"asar": true, "asar": true,
@@ -277,7 +279,7 @@ Ensure `sharp` is unpacked from the ASAR archive file using the
[unpack](https://js.electronforge.io/interfaces/_electron_forge_maker_squirrel.InternalOptions.Options.html#asar) [unpack](https://js.electronforge.io/interfaces/_electron_forge_maker_squirrel.InternalOptions.Options.html#asar)
option. option.
```json ```json frame="none"
{ {
"packagerConfig": { "packagerConfig": {
"asar": { "asar": {
@@ -297,7 +299,7 @@ Ensure `sharp` is excluded from bundling via the
[build.rollupOptions](https://vitejs.dev/config/build-options.html) [build.rollupOptions](https://vitejs.dev/config/build-options.html)
configuration. configuration.
```js ```js frame="none"
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
export default defineConfig({ export default defineConfig({

View File

@@ -13,7 +13,7 @@ environment variable, which defaults to 4.
When using more than 4 physical CPU cores, set this environment variable When using more than 4 physical CPU cores, set this environment variable
before the Node.js process starts to increase the thread pool size. before the Node.js process starts to increase the thread pool size.
```sh ```sh frame="none"
export UV_THREADPOOL_SIZE="$(lscpu -p | egrep -v "^#" | sort -u -t, -k 2,4 | wc -l)" export UV_THREADPOOL_SIZE="$(lscpu -p | egrep -v "^#" | sort -u -t, -k 2,4 | wc -l)"
``` ```
@@ -28,7 +28,7 @@ To reduce memory fragmentation when using the default Linux glibc memory allocat
[`MALLOC_ARENA_MAX`](https://www.gnu.org/software/libc/manual/html_node/Memory-Allocation-Tunables.html) [`MALLOC_ARENA_MAX`](https://www.gnu.org/software/libc/manual/html_node/Memory-Allocation-Tunables.html)
environment variable before the Node.js process starts to reduce the number of memory pools. environment variable before the Node.js process starts to reduce the number of memory pools.
```sh ```sh frame="none"
export MALLOC_ARENA_MAX="2" export MALLOC_ARENA_MAX="2"
``` ```
@@ -130,7 +130,7 @@ Note: jimp does not support premultiply/unpremultiply.
Requires Docker. Requires Docker.
```sh ```sh frame="none"
git clone https://github.com/lovell/sharp.git git clone https://github.com/lovell/sharp.git
cd sharp/test/bench cd sharp/test/bench
./run-with-docker.sh ./run-with-docker.sh

View File

@@ -74,6 +74,8 @@ function ensureAlpha (alpha) {
/** /**
* Extract a single channel from a multi-channel image. * Extract a single channel from a multi-channel image.
* *
* The output colourspace will be either `b-w` (8-bit) or `grey16` (16-bit).
*
* @example * @example
* // green.jpg is a greyscale image containing the green channel of the input * // green.jpg is a greyscale image containing the green channel of the input
* await sharp(input) * await sharp(input)

View File

@@ -3,7 +3,7 @@
'use strict'; 'use strict';
const color = require('color'); const color = require('@img/colour');
const is = require('./is'); const is = require('./is');
/** /**

1
lib/index.d.ts vendored
View File

@@ -1784,6 +1784,7 @@ declare namespace sharp {
interface KernelEnum { interface KernelEnum {
nearest: 'nearest'; nearest: 'nearest';
cubic: 'cubic'; cubic: 'cubic';
linear: 'linear';
mitchell: 'mitchell'; mitchell: 'mitchell';
lanczos2: 'lanczos2'; lanczos2: 'lanczos2';
lanczos3: 'lanczos3'; lanczos3: 'lanczos3';

View File

@@ -1,6 +1,6 @@
{ {
"name": "@img/sharp-darwin-arm64", "name": "@img/sharp-darwin-arm64",
"version": "0.34.4-rc.1", "version": "0.34.4",
"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.1" "@img/sharp-libvips-darwin-arm64": "1.2.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@@ -1,6 +1,6 @@
{ {
"name": "@img/sharp-darwin-x64", "name": "@img/sharp-darwin-x64",
"version": "0.34.4-rc.1", "version": "0.34.4",
"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.1" "@img/sharp-libvips-darwin-x64": "1.2.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@@ -1,6 +1,6 @@
{ {
"name": "@img/sharp-linux-arm", "name": "@img/sharp-linux-arm",
"version": "0.34.4-rc.1", "version": "0.34.4",
"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.1" "@img/sharp-libvips-linux-arm": "1.2.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@@ -1,6 +1,6 @@
{ {
"name": "@img/sharp-linux-arm64", "name": "@img/sharp-linux-arm64",
"version": "0.34.4-rc.1", "version": "0.34.4",
"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.1" "@img/sharp-libvips-linux-arm64": "1.2.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@@ -1,6 +1,6 @@
{ {
"name": "@img/sharp-linux-ppc64", "name": "@img/sharp-linux-ppc64",
"version": "0.34.4-rc.1", "version": "0.34.4",
"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.1" "@img/sharp-libvips-linux-ppc64": "1.2.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@@ -1,6 +1,6 @@
{ {
"name": "@img/sharp-linux-s390x", "name": "@img/sharp-linux-s390x",
"version": "0.34.4-rc.1", "version": "0.34.4",
"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.1" "@img/sharp-libvips-linux-s390x": "1.2.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@@ -1,6 +1,6 @@
{ {
"name": "@img/sharp-linux-x64", "name": "@img/sharp-linux-x64",
"version": "0.34.4-rc.1", "version": "0.34.4",
"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.1" "@img/sharp-libvips-linux-x64": "1.2.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@@ -1,6 +1,6 @@
{ {
"name": "@img/sharp-linuxmusl-arm64", "name": "@img/sharp-linuxmusl-arm64",
"version": "0.34.4-rc.1", "version": "0.34.4",
"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.1" "@img/sharp-libvips-linuxmusl-arm64": "1.2.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@@ -1,6 +1,6 @@
{ {
"name": "@img/sharp-linuxmusl-x64", "name": "@img/sharp-linuxmusl-x64",
"version": "0.34.4-rc.1", "version": "0.34.4",
"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.1" "@img/sharp-libvips-linuxmusl-x64": "1.2.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@@ -1,6 +1,6 @@
{ {
"name": "@img/sharp", "name": "@img/sharp",
"version": "0.34.4-rc.1", "version": "0.34.4",
"private": "true", "private": "true",
"workspaces": [ "workspaces": [
"darwin-arm64", "darwin-arm64",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@img/sharp-wasm32", "name": "@img/sharp-wasm32",
"version": "0.34.4-rc.1", "version": "0.34.4",
"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",
@@ -31,7 +31,7 @@
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
}, },
"dependencies": { "dependencies": {
"@emnapi/runtime": "^1.4.5" "@emnapi/runtime": "^1.5.0"
}, },
"cpu": [ "cpu": [
"wasm32" "wasm32"

View File

@@ -1,6 +1,6 @@
{ {
"name": "@img/sharp-win32-arm64", "name": "@img/sharp-win32-arm64",
"version": "0.34.4-rc.1", "version": "0.34.4",
"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",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@img/sharp-win32-ia32", "name": "@img/sharp-win32-ia32",
"version": "0.34.4-rc.1", "version": "0.34.4",
"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",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@img/sharp-win32-x64", "name": "@img/sharp-win32-x64",
"version": "0.34.4-rc.1", "version": "0.34.4",
"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",

View File

@@ -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.4-rc.1", "version": "0.34.4",
"author": "Lovell Fuller <npm@lovell.info>", "author": "Lovell Fuller <npm@lovell.info>",
"homepage": "https://sharp.pixelplumbing.com", "homepage": "https://sharp.pixelplumbing.com",
"contributors": [ "contributors": [
@@ -137,63 +137,63 @@
"vips" "vips"
], ],
"dependencies": { "dependencies": {
"color": "^4.2.3", "@img/colour": "^1.0.0",
"detect-libc": "^2.0.4", "detect-libc": "^2.1.0",
"semver": "^7.7.2" "semver": "^7.7.2"
}, },
"optionalDependencies": { "optionalDependencies": {
"@img/sharp-darwin-arm64": "0.34.4-rc.1", "@img/sharp-darwin-arm64": "0.34.4",
"@img/sharp-darwin-x64": "0.34.4-rc.1", "@img/sharp-darwin-x64": "0.34.4",
"@img/sharp-libvips-darwin-arm64": "1.2.1", "@img/sharp-libvips-darwin-arm64": "1.2.3",
"@img/sharp-libvips-darwin-x64": "1.2.1", "@img/sharp-libvips-darwin-x64": "1.2.3",
"@img/sharp-libvips-linux-arm": "1.2.1", "@img/sharp-libvips-linux-arm": "1.2.3",
"@img/sharp-libvips-linux-arm64": "1.2.1", "@img/sharp-libvips-linux-arm64": "1.2.3",
"@img/sharp-libvips-linux-ppc64": "1.2.1", "@img/sharp-libvips-linux-ppc64": "1.2.3",
"@img/sharp-libvips-linux-s390x": "1.2.1", "@img/sharp-libvips-linux-s390x": "1.2.3",
"@img/sharp-libvips-linux-x64": "1.2.1", "@img/sharp-libvips-linux-x64": "1.2.3",
"@img/sharp-libvips-linuxmusl-arm64": "1.2.1", "@img/sharp-libvips-linuxmusl-arm64": "1.2.3",
"@img/sharp-libvips-linuxmusl-x64": "1.2.1", "@img/sharp-libvips-linuxmusl-x64": "1.2.3",
"@img/sharp-linux-arm": "0.34.4-rc.1", "@img/sharp-linux-arm": "0.34.4",
"@img/sharp-linux-arm64": "0.34.4-rc.1", "@img/sharp-linux-arm64": "0.34.4",
"@img/sharp-linux-ppc64": "0.34.4-rc.1", "@img/sharp-linux-ppc64": "0.34.4",
"@img/sharp-linux-s390x": "0.34.4-rc.1", "@img/sharp-linux-s390x": "0.34.4",
"@img/sharp-linux-x64": "0.34.4-rc.1", "@img/sharp-linux-x64": "0.34.4",
"@img/sharp-linuxmusl-arm64": "0.34.4-rc.1", "@img/sharp-linuxmusl-arm64": "0.34.4",
"@img/sharp-linuxmusl-x64": "0.34.4-rc.1", "@img/sharp-linuxmusl-x64": "0.34.4",
"@img/sharp-wasm32": "0.34.4-rc.1", "@img/sharp-wasm32": "0.34.4",
"@img/sharp-win32-arm64": "0.34.4-rc.1", "@img/sharp-win32-arm64": "0.34.4",
"@img/sharp-win32-ia32": "0.34.4-rc.1", "@img/sharp-win32-ia32": "0.34.4",
"@img/sharp-win32-x64": "0.34.4-rc.1" "@img/sharp-win32-x64": "0.34.4"
}, },
"devDependencies": { "devDependencies": {
"@emnapi/runtime": "^1.4.5", "@emnapi/runtime": "^1.5.0",
"@img/sharp-libvips-dev": "1.2.1", "@img/sharp-libvips-dev": "1.2.3",
"@img/sharp-libvips-dev-wasm32": "1.2.1", "@img/sharp-libvips-dev-wasm32": "1.2.3",
"@img/sharp-libvips-win32-arm64": "1.2.1", "@img/sharp-libvips-win32-arm64": "1.2.3",
"@img/sharp-libvips-win32-ia32": "1.2.1", "@img/sharp-libvips-win32-ia32": "1.2.3",
"@img/sharp-libvips-win32-x64": "1.2.1", "@img/sharp-libvips-win32-x64": "1.2.3",
"@types/node": "*", "@types/node": "*",
"cc": "^3.0.1", "cc": "^3.0.1",
"emnapi": "^1.4.5", "emnapi": "^1.5.0",
"exif-reader": "^2.0.2", "exif-reader": "^2.0.2",
"extract-zip": "^2.0.1", "extract-zip": "^2.0.1",
"icc": "^3.0.0", "icc": "^3.0.0",
"jsdoc-to-markdown": "^9.1.2", "jsdoc-to-markdown": "^9.1.2",
"license-checker": "^25.0.1", "license-checker": "^25.0.1",
"mocha": "^11.7.1", "mocha": "^11.7.2",
"node-addon-api": "^8.5.0", "node-addon-api": "^8.5.0",
"node-gyp": "^11.2.0", "node-gyp": "^11.4.2",
"nyc": "^17.1.0", "nyc": "^17.1.0",
"semistandard": "^17.0.0", "semistandard": "^17.0.0",
"tar-fs": "^3.1.0", "tar-fs": "^3.1.1",
"tsd": "^0.32.0" "tsd": "^0.33.0"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
}, },
"config": { "config": {
"libvips": ">=8.17.1" "libvips": ">=8.17.2"
}, },
"funding": { "funding": {
"url": "https://opencollective.com/libvips" "url": "https://opencollective.com/libvips"

View File

@@ -168,6 +168,7 @@
# Ensure runtime linking is relative to sharp.node # Ensure runtime linking is relative to sharp.node
'-Wl,-rpath,\'@loader_path/../../sharp-libvips-<(platform_and_arch)/lib\'', '-Wl,-rpath,\'@loader_path/../../sharp-libvips-<(platform_and_arch)/lib\'',
'-Wl,-rpath,\'@loader_path/../../../sharp-libvips-<(platform_and_arch)/<(sharp_libvips_version)/lib\'', '-Wl,-rpath,\'@loader_path/../../../sharp-libvips-<(platform_and_arch)/<(sharp_libvips_version)/lib\'',
'-Wl,-rpath,\'@loader_path/../node_modules/@img/sharp-libvips-<(platform_and_arch)/lib\'',
'-Wl,-rpath,\'@loader_path/../../node_modules/@img/sharp-libvips-<(platform_and_arch)/lib\'', '-Wl,-rpath,\'@loader_path/../../node_modules/@img/sharp-libvips-<(platform_and_arch)/lib\'',
'-Wl,-rpath,\'@loader_path/../../../node_modules/@img/sharp-libvips-<(platform_and_arch)/lib\'', '-Wl,-rpath,\'@loader_path/../../../node_modules/@img/sharp-libvips-<(platform_and_arch)/lib\'',
'-Wl,-rpath,\'@loader_path/../../../../../@img-sharp-libvips-<(platform_and_arch)-npm-<(sharp_libvips_version)-<(sharp_libvips_yarn_locator)/node_modules/@img/sharp-libvips-<(platform_and_arch)/lib\'' '-Wl,-rpath,\'@loader_path/../../../../../@img-sharp-libvips-<(platform_and_arch)-npm-<(sharp_libvips_version)-<(sharp_libvips_yarn_locator)/node_modules/@img/sharp-libvips-<(platform_and_arch)/lib\''
@@ -208,11 +209,9 @@
'-Oz', '-Oz',
'-sALLOW_MEMORY_GROWTH', '-sALLOW_MEMORY_GROWTH',
'-sENVIRONMENT=node', '-sENVIRONMENT=node',
'-sEXPORTED_FUNCTIONS=["emnapiInit", "_vips_shutdown", "_uv_library_shutdown"]', '-sEXPORTED_FUNCTIONS=emnapiInit,_vips_shutdown,_uv_library_shutdown',
'-sNODERAWFS', '-sNODERAWFS',
'-sTEXTDECODER=0', '-sWASM_ASYNC_COMPILATION=0'
'-sWASM_ASYNC_COMPILATION=0',
'-sWASM_BIGINT'
], ],
'libraries': [ 'libraries': [
'<!@(PKG_CONFIG_PATH="<!(node -p "require(\'@img/sharp-libvips-dev-wasm32/lib\')")/pkgconfig" pkg-config --static --libs vips-cpp)' '<!@(PKG_CONFIG_PATH="<!(node -p "require(\'@img/sharp-libvips-dev-wasm32/lib\')")/pkgconfig" pkg-config --static --libs vips-cpp)'

View File

@@ -396,6 +396,7 @@ namespace sharp {
imageType == ImageType::JPEG || imageType == ImageType::JPEG ||
imageType == ImageType::PNG || imageType == ImageType::PNG ||
imageType == ImageType::SVG || imageType == ImageType::SVG ||
imageType == ImageType::TIFF ||
imageType == ImageType::HEIF; imageType == ImageType::HEIF;
} }
@@ -420,14 +421,14 @@ namespace sharp {
->set("high_bitdepth", descriptor->svgHighBitdepth); ->set("high_bitdepth", descriptor->svgHighBitdepth);
break; break;
case ImageType::TIFF: case ImageType::TIFF:
option->set("tiffSubifd", descriptor->tiffSubifd); option->set("subifd", descriptor->tiffSubifd);
break; break;
case ImageType::PDF: case ImageType::PDF:
option->set("dpi", descriptor->density) option->set("dpi", descriptor->density)
->set("background", descriptor->pdfBackground); ->set("background", descriptor->pdfBackground);
break; break;
case ImageType::OPENSLIDE: case ImageType::OPENSLIDE:
option->set("openSlideLevel", descriptor->openSlideLevel); option->set("level", descriptor->openSlideLevel);
break; break;
case ImageType::JP2: case ImageType::JP2:
option->set("oneshot", descriptor->jp2Oneshot); option->set("oneshot", descriptor->jp2Oneshot);

View File

@@ -16,8 +16,8 @@
#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 < 17) || \
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 17 && VIPS_MICRO_VERSION < 1) (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 17 && VIPS_MICRO_VERSION < 2)
#error "libvips version 8.17.1+ is required - please see https://sharp.pixelplumbing.com/install" #error "libvips version 8.17.2+ is required - please see https://sharp.pixelplumbing.com/install"
#endif #endif
#if defined(__has_include) #if defined(__has_include)

View File

@@ -19,7 +19,6 @@
'-sAUTO_JS_LIBRARIES=0', '-sAUTO_JS_LIBRARIES=0',
'-sAUTO_NATIVE_LIBRARIES=0', '-sAUTO_NATIVE_LIBRARIES=0',
'-sDEFAULT_TO_CXX=0', '-sDEFAULT_TO_CXX=0',
'-sNODEJS_CATCH_EXIT=0',
'-sNODEJS_CATCH_REJECTION=0' '-sNODEJS_CATCH_REJECTION=0'
], ],
'defines': [ 'defines': [

View File

@@ -261,11 +261,11 @@ class MetadataWorker : public Napi::AsyncWorker {
info.Set("iptc", Napi::Buffer<char>::NewOrCopy(env, baton->iptc, baton->iptcLength, sharp::FreeCallback)); info.Set("iptc", Napi::Buffer<char>::NewOrCopy(env, baton->iptc, baton->iptcLength, sharp::FreeCallback));
} }
if (baton->xmpLength > 0) { if (baton->xmpLength > 0) {
info.Set("xmp", Napi::Buffer<char>::NewOrCopy(env, baton->xmp, baton->xmpLength, sharp::FreeCallback));
if (g_utf8_validate(static_cast<char const *>(baton->xmp), baton->xmpLength, nullptr)) { if (g_utf8_validate(static_cast<char const *>(baton->xmp), baton->xmpLength, nullptr)) {
info.Set("xmpAsString", info.Set("xmpAsString",
Napi::String::New(env, static_cast<char const *>(baton->xmp), baton->xmpLength)); Napi::String::New(env, static_cast<char const *>(baton->xmp), baton->xmpLength));
} }
info.Set("xmp", Napi::Buffer<char>::NewOrCopy(env, baton->xmp, baton->xmpLength, sharp::FreeCallback));
} }
if (baton->tifftagPhotoshopLength > 0) { if (baton->tifftagPhotoshopLength > 0) {
info.Set("tifftagPhotoshop", info.Set("tifftagPhotoshop",

View File

@@ -82,7 +82,6 @@ describe('Image channel extraction', function () {
const output = fixtures.path('output.extract-alpha-2-channel.png'); const output = fixtures.path('output.extract-alpha-2-channel.png');
sharp(fixtures.inputPngWithGreyAlpha) sharp(fixtures.inputPngWithGreyAlpha)
.extractChannel('alpha') .extractChannel('alpha')
.toColourspace('b-w')
.toFile(output, function (err, info) { .toFile(output, function (err, info) {
if (err) throw err; if (err) throw err;
assert.strictEqual(1, info.channels); assert.strictEqual(1, info.channels);

View File

@@ -179,7 +179,7 @@ describe('libvips binaries', function () {
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, '7e40558001'); assert.strictEqual(locatorHash, '7c141893d6');
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;

View File

@@ -43,7 +43,7 @@ describe('Median filter', function () {
.raw() .raw()
.toBuffer(); .toBuffer();
assert.deepStrictEqual(data.subarray(0, 6), Buffer.from([0, 3, 15, 15, 63, 127])); assert.deepStrictEqual(data.subarray(0, 6), Buffer.from(row));
}); });
it('invalid radius', () => { it('invalid radius', () => {