Compare commits

...

23 Commits

Author SHA1 Message Date
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
Lovell Fuller
51d1a49abc v0.34.4-rc.1 2025-07-28 14:32:52 +01:00
Lovell Fuller
dda00f63e6 CI: Remove frontmatter from release notes 2025-07-28 11:34:31 +01:00
36 changed files with 144 additions and 104 deletions

View File

@@ -269,7 +269,7 @@ jobs:
contents: read
name: "build-wasm32 [package]"
runs-on: ubuntu-24.04
container: "emscripten/emsdk:4.0.11"
container: "emscripten/emsdk:4.0.14"
steps:
- uses: actions/checkout@v4
- name: Dependencies
@@ -300,6 +300,7 @@ jobs:
release:
permissions:
contents: write
id-token: write
runs-on: ubuntu-24.04
needs:
- build-native
@@ -313,12 +314,11 @@ jobs:
path: npm
- name: Create npm workspace tarball
run: tar -vcaf npm-workspace.tar.xz --directory npm --exclude=from-local-build.js .
- name: Parse semver for tag
if: startsWith(github.ref, 'refs/tags/v')
uses: madhead/semver-utils@v4
id: semver
- uses: actions/setup-node@v4
with:
version: ${{ github.ref_name }}
node-version: '24'
- name: Create release notes
run: npm run package-release-notes
- name: Create GitHub release for tag
if: startsWith(github.ref, 'refs/tags/v')
uses: ncipollo/release-action@v1
@@ -327,4 +327,10 @@ jobs:
artifactContentType: application/x-xz
prerelease: ${{ contains(github.ref, '-rc') }}
makeLatest: ${{ !contains(github.ref, '-rc') }}
bodyFile: "docs/src/content/docs/changelog/v${{ steps.semver.outputs.major }}.${{ steps.semver.outputs.minor }}.${{ steps.semver.outputs.patch }}.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' }} --dry-run
- name: Publish sharp npm package
if: startsWith(github.ref, 'refs/tags/v')
run: npm publish --tag=${{ contains(github.ref, '-rc') && 'next' || 'latest' }} --dry-run

1
.gitignore vendored
View File

@@ -16,3 +16,4 @@ package-lock.json
.firebase
.astro
docs/dist
release-notes.md

View File

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

View File

@@ -323,3 +323,6 @@ GitHub: https://github.com/hans00
Name: Thibaut Patel
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.
The output colourspace will be either `b-w` (8-bit) or `grey16` (16-bit).
**Throws**:

View File

@@ -3,8 +3,24 @@ title: v0.34.4 - TBD
slug: changelog/v0.34.4
---
* Upgrade to libvips v8.17.2 for upstream bug fixes.
* Ensure `autoOrient` occurs before non-90 angle rotation.
[#4425](https://github.com/lovell/sharp/issues/4425)
* Ensure `autoOrient` removes existing metadata after shrink-on-load.
[#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
do not require any additional install or runtime dependencies.
```sh
```sh frame="none"
npm install sharp
```

View File

@@ -12,11 +12,11 @@ If a package manager lockfile must support multiple platforms,
please see the [cross-platform](#cross-platform) section
to help decide which package manager is appropriate.
```sh
```sh frame="none"
npm install sharp
```
```sh
```sh frame="none"
pnpm add sharp
```
@@ -24,15 +24,15 @@ When using `pnpm`, you may need to add `sharp` to
[ignoredBuiltDependencies](https://pnpm.io/settings#ignoredbuiltdependencies)
to silence warnings.
```sh
```sh frame="none"
yarn add sharp
```
```sh
```sh frame="none"
bun add sharp
```
```sh
```sh frame="none"
deno run --allow-ffi ...
```
@@ -75,7 +75,7 @@ npm `package-lock.json` files shared by multiple platforms can cause installatio
Provides limited support via `--os`, `--cpu` and `--libc` flags.
To support macOS with Intel x64 and ARM64 CPUs:
```sh
```sh frame="none"
npm install --cpu=x64 --os=darwin sharp
npm install --cpu=arm64 --os=darwin sharp
```
@@ -83,7 +83,7 @@ npm install --cpu=arm64 --os=darwin sharp
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:
```sh
```sh frame="none"
npm install --cpu=x64 --os=linux --libc=glibc sharp
npm install --cpu=x64 --os=linux --libc=musl sharp
```
@@ -129,7 +129,7 @@ Building from source requires:
There is an install-time check for these dependencies.
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
```
@@ -152,19 +152,20 @@ Native text rendering is unsupported.
[Tile-based output](/api-output#tile) is unsupported.
```sh
```sh frame="none"
npm install --cpu=wasm32 sharp
```
## 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
```
```sh
```sh frame="none"
cd /usr/ports/graphics/vips/ && make install clean
```
@@ -213,7 +214,7 @@ Ensure sharp is excluded from bundling via the
[externals](https://webpack.js.org/configuration/externals/)
configuration.
```js
```js frame="none"
externals: {
'sharp': 'commonjs sharp'
}
@@ -225,7 +226,7 @@ Ensure sharp is excluded from bundling via the
[external](https://esbuild.github.io/api/#external)
configuration.
```js
```js frame="none"
buildSync({
entryPoints: ['app.js'],
bundle: true,
@@ -234,14 +235,14 @@ buildSync({
})
```
```sh
```sh frame="none"
esbuild app.js --bundle --platform=node --external:sharp
```
For `serverless-esbuild`, ensure platform-specific binaries are installed
via the `serverless.yml` configuration.
```yaml
```yaml frame="none"
custom:
esbuild:
external:
@@ -259,7 +260,7 @@ Ensure `sharp` is unpacked from the ASAR archive file using the
[asarUnpack](https://www.electron.build/app-builder-lib.interface.platformspecificbuildoptions#asarunpack)
option.
```json
```json frame="none"
{
"build": {
"asar": true,
@@ -277,7 +278,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)
option.
```json
```json frame="none"
{
"packagerConfig": {
"asar": {
@@ -297,7 +298,7 @@ Ensure `sharp` is excluded from bundling via the
[build.rollupOptions](https://vitejs.dev/config/build-options.html)
configuration.
```js
```js frame="none"
import { defineConfig } from 'vite';
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
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)"
```
@@ -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)
environment variable before the Node.js process starts to reduce the number of memory pools.
```sh
```sh frame="none"
export MALLOC_ARENA_MAX="2"
```
@@ -130,7 +130,7 @@ Note: jimp does not support premultiply/unpremultiply.
Requires Docker.
```sh
```sh frame="none"
git clone https://github.com/lovell/sharp.git
cd sharp/test/bench
./run-with-docker.sh

View File

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

View File

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

1
lib/index.d.ts vendored
View File

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

View File

@@ -1,6 +1,6 @@
{
"name": "@img/sharp-darwin-arm64",
"version": "0.34.4-rc.0",
"version": "0.34.4-rc.2",
"description": "Prebuilt sharp for use with macOS 64-bit ARM",
"author": "Lovell Fuller <npm@lovell.info>",
"homepage": "https://sharp.pixelplumbing.com",
@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-darwin-arm64": "1.2.1"
"@img/sharp-libvips-darwin-arm64": "1.2.2"
},
"files": [
"lib"

View File

@@ -1,6 +1,6 @@
{
"name": "@img/sharp-darwin-x64",
"version": "0.34.4-rc.0",
"version": "0.34.4-rc.2",
"description": "Prebuilt sharp for use with macOS x64",
"author": "Lovell Fuller <npm@lovell.info>",
"homepage": "https://sharp.pixelplumbing.com",
@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-darwin-x64": "1.2.1"
"@img/sharp-libvips-darwin-x64": "1.2.2"
},
"files": [
"lib"

View File

@@ -1,6 +1,6 @@
{
"name": "@img/sharp-linux-arm",
"version": "0.34.4-rc.0",
"version": "0.34.4-rc.2",
"description": "Prebuilt sharp for use with Linux (glibc) ARM (32-bit)",
"author": "Lovell Fuller <npm@lovell.info>",
"homepage": "https://sharp.pixelplumbing.com",
@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linux-arm": "1.2.1"
"@img/sharp-libvips-linux-arm": "1.2.2"
},
"files": [
"lib"

View File

@@ -1,6 +1,6 @@
{
"name": "@img/sharp-linux-arm64",
"version": "0.34.4-rc.0",
"version": "0.34.4-rc.2",
"description": "Prebuilt sharp for use with Linux (glibc) 64-bit ARM",
"author": "Lovell Fuller <npm@lovell.info>",
"homepage": "https://sharp.pixelplumbing.com",
@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linux-arm64": "1.2.1"
"@img/sharp-libvips-linux-arm64": "1.2.2"
},
"files": [
"lib"

View File

@@ -1,6 +1,6 @@
{
"name": "@img/sharp-linux-ppc64",
"version": "0.34.4-rc.0",
"version": "0.34.4-rc.2",
"description": "Prebuilt sharp for use with Linux (glibc) ppc64",
"author": "Lovell Fuller <npm@lovell.info>",
"homepage": "https://sharp.pixelplumbing.com",
@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linux-ppc64": "1.2.1"
"@img/sharp-libvips-linux-ppc64": "1.2.2"
},
"files": [
"lib"

View File

@@ -1,6 +1,6 @@
{
"name": "@img/sharp-linux-s390x",
"version": "0.34.4-rc.0",
"version": "0.34.4-rc.2",
"description": "Prebuilt sharp for use with Linux (glibc) s390x",
"author": "Lovell Fuller <npm@lovell.info>",
"homepage": "https://sharp.pixelplumbing.com",
@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linux-s390x": "1.2.1"
"@img/sharp-libvips-linux-s390x": "1.2.2"
},
"files": [
"lib"

View File

@@ -1,6 +1,6 @@
{
"name": "@img/sharp-linux-x64",
"version": "0.34.4-rc.0",
"version": "0.34.4-rc.2",
"description": "Prebuilt sharp for use with Linux (glibc) x64",
"author": "Lovell Fuller <npm@lovell.info>",
"homepage": "https://sharp.pixelplumbing.com",
@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linux-x64": "1.2.1"
"@img/sharp-libvips-linux-x64": "1.2.2"
},
"files": [
"lib"

View File

@@ -1,6 +1,6 @@
{
"name": "@img/sharp-linuxmusl-arm64",
"version": "0.34.4-rc.0",
"version": "0.34.4-rc.2",
"description": "Prebuilt sharp for use with Linux (musl) 64-bit ARM",
"author": "Lovell Fuller <npm@lovell.info>",
"homepage": "https://sharp.pixelplumbing.com",
@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linuxmusl-arm64": "1.2.1"
"@img/sharp-libvips-linuxmusl-arm64": "1.2.2"
},
"files": [
"lib"

View File

@@ -1,6 +1,6 @@
{
"name": "@img/sharp-linuxmusl-x64",
"version": "0.34.4-rc.0",
"version": "0.34.4-rc.2",
"description": "Prebuilt sharp for use with Linux (musl) x64",
"author": "Lovell Fuller <npm@lovell.info>",
"homepage": "https://sharp.pixelplumbing.com",
@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linuxmusl-x64": "1.2.1"
"@img/sharp-libvips-linuxmusl-x64": "1.2.2"
},
"files": [
"lib"

View File

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

9
npm/release-notes.js Normal file
View File

@@ -0,0 +1,9 @@
const { readFileSync, writeFileSync } = require('node:fs');
const { version } = require('./package.json');
const versionWithoutPreRelease = version.replace(/-rc\.\d+$/, '');
const markdown = readFileSync(`./docs/src/content/docs/changelog/v${versionWithoutPreRelease}.md`, 'utf8');
const markdownWithoutFrontmatter = markdown.replace(/---\n.*?\n---\n+/s, '');
writeFileSync('./release-notes.md', markdownWithoutFrontmatter);

View File

@@ -1,6 +1,6 @@
{
"name": "@img/sharp-wasm32",
"version": "0.34.4-rc.0",
"version": "0.34.4-rc.2",
"description": "Prebuilt sharp for use with wasm32",
"author": "Lovell Fuller <npm@lovell.info>",
"homepage": "https://sharp.pixelplumbing.com",
@@ -31,7 +31,7 @@
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
},
"dependencies": {
"@emnapi/runtime": "^1.4.5"
"@emnapi/runtime": "^1.5.0"
},
"cpu": [
"wasm32"

View File

@@ -1,6 +1,6 @@
{
"name": "@img/sharp-win32-arm64",
"version": "0.34.4-rc.0",
"version": "0.34.4-rc.2",
"description": "Prebuilt sharp for use with Windows 64-bit ARM",
"author": "Lovell Fuller <npm@lovell.info>",
"homepage": "https://sharp.pixelplumbing.com",

View File

@@ -1,6 +1,6 @@
{
"name": "@img/sharp-win32-ia32",
"version": "0.34.4-rc.0",
"version": "0.34.4-rc.2",
"description": "Prebuilt sharp for use with Windows x86 (32-bit)",
"author": "Lovell Fuller <npm@lovell.info>",
"homepage": "https://sharp.pixelplumbing.com",

View File

@@ -1,6 +1,6 @@
{
"name": "@img/sharp-win32-x64",
"version": "0.34.4-rc.0",
"version": "0.34.4-rc.2",
"description": "Prebuilt sharp for use with Windows x64",
"author": "Lovell Fuller <npm@lovell.info>",
"homepage": "https://sharp.pixelplumbing.com",

View File

@@ -1,7 +1,7 @@
{
"name": "sharp",
"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.0",
"version": "0.34.4-rc.2",
"author": "Lovell Fuller <npm@lovell.info>",
"homepage": "https://sharp.pixelplumbing.com",
"contributors": [
@@ -101,6 +101,7 @@
"test-leak": "./test/leak/leak.sh",
"test-types": "tsd",
"package-from-local-build": "node npm/from-local-build.js",
"package-release-notes": "node npm/release-notes.js",
"docs-build": "node docs/build.mjs",
"docs-serve": "cd docs && npm start",
"docs-publish": "cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"
@@ -136,63 +137,63 @@
"vips"
],
"dependencies": {
"color": "^4.2.3",
"detect-libc": "^2.0.4",
"@img/colour": "^1.0.0",
"detect-libc": "^2.1.0",
"semver": "^7.7.2"
},
"optionalDependencies": {
"@img/sharp-darwin-arm64": "0.34.4-rc.0",
"@img/sharp-darwin-x64": "0.34.4-rc.0",
"@img/sharp-libvips-darwin-arm64": "1.2.1",
"@img/sharp-libvips-darwin-x64": "1.2.1",
"@img/sharp-libvips-linux-arm": "1.2.1",
"@img/sharp-libvips-linux-arm64": "1.2.1",
"@img/sharp-libvips-linux-ppc64": "1.2.1",
"@img/sharp-libvips-linux-s390x": "1.2.1",
"@img/sharp-libvips-linux-x64": "1.2.1",
"@img/sharp-libvips-linuxmusl-arm64": "1.2.1",
"@img/sharp-libvips-linuxmusl-x64": "1.2.1",
"@img/sharp-linux-arm": "0.34.4-rc.0",
"@img/sharp-linux-arm64": "0.34.4-rc.0",
"@img/sharp-linux-ppc64": "0.34.4-rc.0",
"@img/sharp-linux-s390x": "0.34.4-rc.0",
"@img/sharp-linux-x64": "0.34.4-rc.0",
"@img/sharp-linuxmusl-arm64": "0.34.4-rc.0",
"@img/sharp-linuxmusl-x64": "0.34.4-rc.0",
"@img/sharp-wasm32": "0.34.4-rc.0",
"@img/sharp-win32-arm64": "0.34.4-rc.0",
"@img/sharp-win32-ia32": "0.34.4-rc.0",
"@img/sharp-win32-x64": "0.34.4-rc.0"
"@img/sharp-darwin-arm64": "0.34.4-rc.2",
"@img/sharp-darwin-x64": "0.34.4-rc.2",
"@img/sharp-libvips-darwin-arm64": "1.2.2",
"@img/sharp-libvips-darwin-x64": "1.2.2",
"@img/sharp-libvips-linux-arm": "1.2.2",
"@img/sharp-libvips-linux-arm64": "1.2.2",
"@img/sharp-libvips-linux-ppc64": "1.2.2",
"@img/sharp-libvips-linux-s390x": "1.2.2",
"@img/sharp-libvips-linux-x64": "1.2.2",
"@img/sharp-libvips-linuxmusl-arm64": "1.2.2",
"@img/sharp-libvips-linuxmusl-x64": "1.2.2",
"@img/sharp-linux-arm": "0.34.4-rc.2",
"@img/sharp-linux-arm64": "0.34.4-rc.2",
"@img/sharp-linux-ppc64": "0.34.4-rc.2",
"@img/sharp-linux-s390x": "0.34.4-rc.2",
"@img/sharp-linux-x64": "0.34.4-rc.2",
"@img/sharp-linuxmusl-arm64": "0.34.4-rc.2",
"@img/sharp-linuxmusl-x64": "0.34.4-rc.2",
"@img/sharp-wasm32": "0.34.4-rc.2",
"@img/sharp-win32-arm64": "0.34.4-rc.2",
"@img/sharp-win32-ia32": "0.34.4-rc.2",
"@img/sharp-win32-x64": "0.34.4-rc.2"
},
"devDependencies": {
"@emnapi/runtime": "^1.4.5",
"@img/sharp-libvips-dev": "1.2.1",
"@img/sharp-libvips-dev-wasm32": "1.2.1",
"@img/sharp-libvips-win32-arm64": "1.2.1",
"@img/sharp-libvips-win32-ia32": "1.2.1",
"@img/sharp-libvips-win32-x64": "1.2.1",
"@emnapi/runtime": "^1.5.0",
"@img/sharp-libvips-dev": "1.2.2",
"@img/sharp-libvips-dev-wasm32": "1.2.2",
"@img/sharp-libvips-win32-arm64": "1.2.2",
"@img/sharp-libvips-win32-ia32": "1.2.2",
"@img/sharp-libvips-win32-x64": "1.2.2",
"@types/node": "*",
"cc": "^3.0.1",
"emnapi": "^1.4.5",
"emnapi": "^1.5.0",
"exif-reader": "^2.0.2",
"extract-zip": "^2.0.1",
"icc": "^3.0.0",
"jsdoc-to-markdown": "^9.1.2",
"license-checker": "^25.0.1",
"mocha": "^11.7.1",
"mocha": "^11.7.2",
"node-addon-api": "^8.5.0",
"node-gyp": "^11.2.0",
"node-gyp": "^11.4.2",
"nyc": "^17.1.0",
"semistandard": "^17.0.0",
"tar-fs": "^3.1.0",
"tsd": "^0.32.0"
"tsd": "^0.33.0"
},
"license": "Apache-2.0",
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
},
"config": {
"libvips": ">=8.17.1"
"libvips": ">=8.17.2"
},
"funding": {
"url": "https://opencollective.com/libvips"

View File

@@ -168,6 +168,7 @@
# 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)/<(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/../../../../../@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',
'-sALLOW_MEMORY_GROWTH',
'-sENVIRONMENT=node',
'-sEXPORTED_FUNCTIONS=["emnapiInit", "_vips_shutdown", "_uv_library_shutdown"]',
'-sEXPORTED_FUNCTIONS=emnapiInit,_vips_shutdown,_uv_library_shutdown',
'-sNODERAWFS',
'-sTEXTDECODER=0',
'-sWASM_ASYNC_COMPILATION=0',
'-sWASM_BIGINT'
'-sWASM_ASYNC_COMPILATION=0'
],
'libraries': [
'<!@(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::PNG ||
imageType == ImageType::SVG ||
imageType == ImageType::TIFF ||
imageType == ImageType::HEIF;
}

View File

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

View File

@@ -19,7 +19,6 @@
'-sAUTO_JS_LIBRARIES=0',
'-sAUTO_NATIVE_LIBRARIES=0',
'-sDEFAULT_TO_CXX=0',
'-sNODEJS_CATCH_EXIT=0',
'-sNODEJS_CATCH_REJECTION=0'
],
'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));
}
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)) {
info.Set("xmpAsString",
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) {
info.Set("tifftagPhotoshop",

View File

@@ -82,7 +82,6 @@ describe('Image channel extraction', function () {
const output = fixtures.path('output.extract-alpha-2-channel.png');
sharp(fixtures.inputPngWithGreyAlpha)
.extractChannel('alpha')
.toColourspace('b-w')
.toFile(output, function (err, info) {
if (err) throw err;
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_libc = '';
const locatorHash = libvips.yarnLocator();
assert.strictEqual(locatorHash, '7e40558001');
assert.strictEqual(locatorHash, '9773928ef2');
delete process.env.npm_config_platform;
delete process.env.npm_config_arch;
delete process.env.npm_config_libc;

View File

@@ -43,7 +43,7 @@ describe('Median filter', function () {
.raw()
.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', () => {