diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a94483a3..53b5e12d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,6 +110,17 @@ jobs: nodejs_version: "^22.9.0" nodejs_version_major: 22 platform: win32-x64 + - os: windows-11-arm + nodejs_arch: arm64 + nodejs_version: "^20.3.0" + nodejs_version_major: 20 + platform: win32-arm64 + prebuild: true + - os: windows-11-arm + nodejs_arch: arm64 + nodejs_version: "^22.9.0" + nodejs_version_major: 22 + platform: win32-arm64 steps: - name: Dependencies (Rocky Linux glibc) if: contains(matrix.container, 'rockylinux') diff --git a/docs/public/humans.txt b/docs/public/humans.txt index f8bd272f..01af76f0 100644 --- a/docs/public/humans.txt +++ b/docs/public/humans.txt @@ -317,3 +317,6 @@ GitHub: https://github.com/florentzabera Name: Quentin Pinçon GitHub: https://github.com/qpincon + +Name: Hans Chen +GitHub: https://github.com/hans00 diff --git a/docs/src/content/docs/changelog.md b/docs/src/content/docs/changelog.md index d45e433e..5026a602 100644 --- a/docs/src/content/docs/changelog.md +++ b/docs/src/content/docs/changelog.md @@ -14,6 +14,10 @@ Requires libvips v8.16.1 * Ensure `pdfBackground` constructor property is used. [#4207](https://github.com/lovell/sharp/pull/4207) +* Add support for prebuilt Windows ARM64 binaries. + [#4375](https://github.com/lovell/sharp/pull/4375) + [@hans00](https://github.com/hans00) + * TypeScript: Ensure `smartDeblock` property is included in WebP definition. [#4387](https://github.com/lovell/sharp/pull/4387) [@Stephen-X](https://github.com/Stephen-X) diff --git a/docs/src/content/docs/install.md b/docs/src/content/docs/install.md index 0ca0290b..3e0a4a01 100644 --- a/docs/src/content/docs/install.md +++ b/docs/src/content/docs/install.md @@ -53,6 +53,7 @@ Ready-compiled sharp and libvips binaries are provided for use on the most commo * Linux x64 (glibc >= 2.26, musl >= 1.2.2, CPU with SSE4.2) * Windows x64 * Windows x86 +* Windows ARM64 This provides support for the JPEG, PNG, WebP, AVIF (limited to 8-bit depth), TIFF, GIF and SVG (input) image formats. diff --git a/lib/libvips.js b/lib/libvips.js index 9a563975..254361e3 100644 --- a/lib/libvips.js +++ b/lib/libvips.js @@ -20,7 +20,7 @@ const prebuiltPlatforms = [ 'darwin-arm64', 'darwin-x64', 'linux-arm', 'linux-arm64', 'linux-s390x', 'linux-x64', 'linuxmusl-arm64', 'linuxmusl-x64', - 'win32-ia32', 'win32-x64' + 'win32-arm64', 'win32-ia32', 'win32-x64' ]; const spawnSyncOptions = { diff --git a/npm/package.json b/npm/package.json index fd921905..5c15b996 100644 --- a/npm/package.json +++ b/npm/package.json @@ -13,6 +13,7 @@ "linuxmusl-arm64", "linuxmusl-x64", "wasm32", + "win32-arm64", "win32-ia32", "win32-x64" ] diff --git a/npm/win32-arm64/package.json b/npm/win32-arm64/package.json new file mode 100644 index 00000000..b7e2acb2 --- /dev/null +++ b/npm/win32-arm64/package.json @@ -0,0 +1,39 @@ +{ + "name": "@img/sharp-win32-arm64", + "version": "0.34.1", + "description": "Prebuilt sharp for use with Windows 64-bit ARM", + "author": "Lovell Fuller ", + "homepage": "https://sharp.pixelplumbing.com", + "repository": { + "type": "git", + "url": "git+https://github.com/lovell/sharp.git", + "directory": "npm/win32-arm64" + }, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "funding": { + "url": "https://opencollective.com/libvips" + }, + "preferUnplugged": true, + "files": [ + "lib", + "versions.json" + ], + "publishConfig": { + "access": "public" + }, + "type": "commonjs", + "exports": { + "./sharp.node": "./lib/sharp-win32-arm64.node", + "./package": "./package.json", + "./versions": "./versions.json" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "os": [ + "win32" + ], + "cpu": [ + "arm64" + ] +} diff --git a/package.json b/package.json index 6970f9ec..85ade990 100644 --- a/package.json +++ b/package.json @@ -160,6 +160,7 @@ "@img/sharp-linuxmusl-arm64": "0.34.1", "@img/sharp-linuxmusl-x64": "0.34.1", "@img/sharp-wasm32": "0.34.1", + "@img/sharp-win32-arm64": "0.34.1", "@img/sharp-win32-ia32": "0.34.1", "@img/sharp-win32-x64": "0.34.1" }, @@ -167,6 +168,7 @@ "@emnapi/runtime": "^1.4.0", "@img/sharp-libvips-dev": "1.1.0", "@img/sharp-libvips-dev-wasm32": "1.1.0", + "@img/sharp-libvips-win32-arm64": "1.1.0", "@img/sharp-libvips-win32-ia32": "1.1.0", "@img/sharp-libvips-win32-x64": "1.1.0", "@types/node": "*", diff --git a/test/unit/text.js b/test/unit/text.js index a81a88c9..0efe05bc 100644 --- a/test/unit/text.js +++ b/test/unit/text.js @@ -59,7 +59,7 @@ describe('Text to image', function () { assert.strictEqual('png', info.format); assert.strictEqual(3, info.channels); assert.ok(inRange(info.width, 400, 600), `Actual width ${info.width}`); - assert.ok(inRange(info.height, 300, 500), `Actual height ${info.height}`); + assert.ok(inRange(info.height, 290, 500), `Actual height ${info.height}`); assert.ok(inRange(info.textAutofitDpi, 900, 1300), `Actual textAutofitDpi ${info.textAutofitDpi}`); done(); });