mirror of
https://github.com/lovell/sharp.git
synced 2026-02-05 06:06:18 +01:00
Compare commits
6 Commits
v0.34.2-rc
...
v0.34.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d04b7c1fa | ||
|
|
d4b30b7392 | ||
|
|
7f03502003 | ||
|
|
63b0a11b5b | ||
|
|
c4d6aec48c | ||
|
|
e75ae970ed |
@@ -70,10 +70,10 @@ export default defineConfig({
|
|||||||
{ label: 'Performance', slug: 'performance' },
|
{ label: 'Performance', slug: 'performance' },
|
||||||
{ label: 'Changelog', slug: 'changelog' }
|
{ label: 'Changelog', slug: 'changelog' }
|
||||||
],
|
],
|
||||||
social: {
|
social: [
|
||||||
openCollective: 'https://opencollective.com/libvips',
|
{ icon: 'openCollective', label: 'Open Collective', href: 'https://opencollective.com/libvips' },
|
||||||
github: 'https://github.com/lovell/sharp'
|
{ icon: 'github', label: 'GitHub', href: 'https://github.com/lovell/sharp' }
|
||||||
}
|
]
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/starlight": "^0.32.3",
|
"@astrojs/starlight": "^0.34.3",
|
||||||
"astro": "^5.5.3"
|
"astro": "^5.7.13"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -626,6 +626,9 @@ Use these AVIF options for output image.
|
|||||||
AVIF image sequences are not supported.
|
AVIF image sequences are not supported.
|
||||||
Prebuilt binaries support a bitdepth of 8 only.
|
Prebuilt binaries support a bitdepth of 8 only.
|
||||||
|
|
||||||
|
This feature is experimental on the Windows ARM64 platform
|
||||||
|
and requires a CPU with ARM64v8.4 or later.
|
||||||
|
|
||||||
|
|
||||||
**Throws**:
|
**Throws**:
|
||||||
|
|
||||||
|
|||||||
@@ -6,15 +6,16 @@ title: Changelog
|
|||||||
|
|
||||||
Requires libvips v8.16.1
|
Requires libvips v8.16.1
|
||||||
|
|
||||||
### v0.34.2 - TBD
|
### v0.34.2 - 20th May 2025
|
||||||
|
|
||||||
* Ensure animated GIF to WebP conversion retains loop (regression in 0.34.0).
|
* Ensure animated GIF to WebP conversion retains loop (regression in 0.34.0).
|
||||||
[#3394](https://github.com/lovell/sharp/issues/3394)
|
[#3394](https://github.com/lovell/sharp/issues/3394)
|
||||||
|
|
||||||
* Ensure `pdfBackground` constructor property is used.
|
* Ensure `pdfBackground` constructor property is used.
|
||||||
[#4207](https://github.com/lovell/sharp/pull/4207)
|
[#4207](https://github.com/lovell/sharp/pull/4207)
|
||||||
|
[#4398](https://github.com/lovell/sharp/issues/4398)
|
||||||
|
|
||||||
* Add support for prebuilt Windows ARM64 binaries.
|
* Add experimental support for prebuilt Windows ARM64 binaries.
|
||||||
[#4375](https://github.com/lovell/sharp/pull/4375)
|
[#4375](https://github.com/lovell/sharp/pull/4375)
|
||||||
[@hans00](https://github.com/hans00)
|
[@hans00](https://github.com/hans00)
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ pnpm add sharp
|
|||||||
```
|
```
|
||||||
|
|
||||||
When using `pnpm`, you may need to add `sharp` to
|
When using `pnpm`, you may need to add `sharp` to
|
||||||
[ignoredBuiltDependencies](https://pnpm.io/package_json#pnpmignoredbuiltdependencies)
|
[ignoredBuiltDependencies](https://pnpm.io/settings#ignoredbuiltdependencies)
|
||||||
to silence warnings.
|
to silence warnings.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -53,7 +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)
|
* Linux x64 (glibc >= 2.26, musl >= 1.2.2, CPU with SSE4.2)
|
||||||
* Windows x64
|
* Windows x64
|
||||||
* Windows x86
|
* Windows x86
|
||||||
* Windows ARM64
|
* Windows ARM64 (experimental, CPU with ARMv8.4 required for all features)
|
||||||
|
|
||||||
This provides support for the
|
This provides support for the
|
||||||
JPEG, PNG, WebP, AVIF (limited to 8-bit depth), TIFF, GIF and SVG (input) image formats.
|
JPEG, PNG, WebP, AVIF (limited to 8-bit depth), TIFF, GIF and SVG (input) image formats.
|
||||||
@@ -94,7 +94,7 @@ Use the [supportedArchitectures](https://yarnpkg.com/configuration/yarnrc#suppor
|
|||||||
|
|
||||||
### pnpm v8+
|
### pnpm v8+
|
||||||
|
|
||||||
Use the [supportedArchitectures](https://pnpm.io/package_json#pnpmsupportedarchitectures) configuration.
|
Use the [supportedArchitectures](https://pnpm.io/settings#supportedarchitectures) configuration.
|
||||||
|
|
||||||
## Custom libvips
|
## Custom libvips
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ npm install --save node-addon-api node-gyp
|
|||||||
```
|
```
|
||||||
|
|
||||||
When using `pnpm`, you may need to add `sharp` to
|
When using `pnpm`, you may need to add `sharp` to
|
||||||
[onlyBuiltDependencies](https://pnpm.io/package_json#pnpmonlybuiltdependencies)
|
[onlyBuiltDependencies](https://pnpm.io/settings#onlybuiltdependencies)
|
||||||
to ensure the installation script can be run.
|
to ensure the installation script can be run.
|
||||||
|
|
||||||
For cross-compiling, the `--platform`, `--arch` and `--libc` npm flags
|
For cross-compiling, the `--platform`, `--arch` and `--libc` npm flags
|
||||||
|
|||||||
@@ -1019,6 +1019,9 @@ function tiff (options) {
|
|||||||
* AVIF image sequences are not supported.
|
* AVIF image sequences are not supported.
|
||||||
* Prebuilt binaries support a bitdepth of 8 only.
|
* Prebuilt binaries support a bitdepth of 8 only.
|
||||||
*
|
*
|
||||||
|
* This feature is experimental on the Windows ARM64 platform
|
||||||
|
* and requires a CPU with ARM64v8.4 or later.
|
||||||
|
*
|
||||||
* @example
|
* @example
|
||||||
* const data = await sharp(input)
|
* const data = await sharp(input)
|
||||||
* .avif({ effort: 2 })
|
* .avif({ effort: 2 })
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-darwin-arm64",
|
"name": "@img/sharp-darwin-arm64",
|
||||||
"version": "0.34.2-rc.0",
|
"version": "0.34.2",
|
||||||
"description": "Prebuilt sharp for use with macOS 64-bit ARM",
|
"description": "Prebuilt sharp for use with macOS 64-bit ARM",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-darwin-x64",
|
"name": "@img/sharp-darwin-x64",
|
||||||
"version": "0.34.2-rc.0",
|
"version": "0.34.2",
|
||||||
"description": "Prebuilt sharp for use with macOS x64",
|
"description": "Prebuilt sharp for use with macOS x64",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linux-arm",
|
"name": "@img/sharp-linux-arm",
|
||||||
"version": "0.34.2-rc.0",
|
"version": "0.34.2",
|
||||||
"description": "Prebuilt sharp for use with Linux (glibc) ARM (32-bit)",
|
"description": "Prebuilt sharp for use with Linux (glibc) ARM (32-bit)",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linux-arm64",
|
"name": "@img/sharp-linux-arm64",
|
||||||
"version": "0.34.2-rc.0",
|
"version": "0.34.2",
|
||||||
"description": "Prebuilt sharp for use with Linux (glibc) 64-bit ARM",
|
"description": "Prebuilt sharp for use with Linux (glibc) 64-bit ARM",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linux-ppc64",
|
"name": "@img/sharp-linux-ppc64",
|
||||||
"version": "0.34.2-rc.0",
|
"version": "0.34.2",
|
||||||
"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",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linux-s390x",
|
"name": "@img/sharp-linux-s390x",
|
||||||
"version": "0.34.2-rc.0",
|
"version": "0.34.2",
|
||||||
"description": "Prebuilt sharp for use with Linux (glibc) s390x",
|
"description": "Prebuilt sharp for use with Linux (glibc) s390x",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linux-x64",
|
"name": "@img/sharp-linux-x64",
|
||||||
"version": "0.34.2-rc.0",
|
"version": "0.34.2",
|
||||||
"description": "Prebuilt sharp for use with Linux (glibc) x64",
|
"description": "Prebuilt sharp for use with Linux (glibc) x64",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linuxmusl-arm64",
|
"name": "@img/sharp-linuxmusl-arm64",
|
||||||
"version": "0.34.2-rc.0",
|
"version": "0.34.2",
|
||||||
"description": "Prebuilt sharp for use with Linux (musl) 64-bit ARM",
|
"description": "Prebuilt sharp for use with Linux (musl) 64-bit ARM",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-linuxmusl-x64",
|
"name": "@img/sharp-linuxmusl-x64",
|
||||||
"version": "0.34.2-rc.0",
|
"version": "0.34.2",
|
||||||
"description": "Prebuilt sharp for use with Linux (musl) x64",
|
"description": "Prebuilt sharp for use with Linux (musl) x64",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp",
|
"name": "@img/sharp",
|
||||||
"version": "0.34.2-rc.0",
|
"version": "0.34.2",
|
||||||
"private": "true",
|
"private": "true",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"darwin-arm64",
|
"darwin-arm64",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-wasm32",
|
"name": "@img/sharp-wasm32",
|
||||||
"version": "0.34.2-rc.0",
|
"version": "0.34.2",
|
||||||
"description": "Prebuilt sharp for use with wasm32",
|
"description": "Prebuilt sharp for use with wasm32",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-win32-arm64",
|
"name": "@img/sharp-win32-arm64",
|
||||||
"version": "0.34.2-rc.0",
|
"version": "0.34.2",
|
||||||
"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",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-win32-ia32",
|
"name": "@img/sharp-win32-ia32",
|
||||||
"version": "0.34.2-rc.0",
|
"version": "0.34.2",
|
||||||
"description": "Prebuilt sharp for use with Windows x86 (32-bit)",
|
"description": "Prebuilt sharp for use with Windows x86 (32-bit)",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@img/sharp-win32-x64",
|
"name": "@img/sharp-win32-x64",
|
||||||
"version": "0.34.2-rc.0",
|
"version": "0.34.2",
|
||||||
"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
package.json
28
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.2-rc.0",
|
"version": "0.34.2",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
@@ -142,8 +142,8 @@
|
|||||||
"semver": "^7.7.2"
|
"semver": "^7.7.2"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-darwin-arm64": "0.34.2-rc.0",
|
"@img/sharp-darwin-arm64": "0.34.2",
|
||||||
"@img/sharp-darwin-x64": "0.34.2-rc.0",
|
"@img/sharp-darwin-x64": "0.34.2",
|
||||||
"@img/sharp-libvips-darwin-arm64": "1.1.0",
|
"@img/sharp-libvips-darwin-arm64": "1.1.0",
|
||||||
"@img/sharp-libvips-darwin-x64": "1.1.0",
|
"@img/sharp-libvips-darwin-x64": "1.1.0",
|
||||||
"@img/sharp-libvips-linux-arm": "1.1.0",
|
"@img/sharp-libvips-linux-arm": "1.1.0",
|
||||||
@@ -153,16 +153,16 @@
|
|||||||
"@img/sharp-libvips-linux-x64": "1.1.0",
|
"@img/sharp-libvips-linux-x64": "1.1.0",
|
||||||
"@img/sharp-libvips-linuxmusl-arm64": "1.1.0",
|
"@img/sharp-libvips-linuxmusl-arm64": "1.1.0",
|
||||||
"@img/sharp-libvips-linuxmusl-x64": "1.1.0",
|
"@img/sharp-libvips-linuxmusl-x64": "1.1.0",
|
||||||
"@img/sharp-linux-arm": "0.34.2-rc.0",
|
"@img/sharp-linux-arm": "0.34.2",
|
||||||
"@img/sharp-linux-arm64": "0.34.2-rc.0",
|
"@img/sharp-linux-arm64": "0.34.2",
|
||||||
"@img/sharp-linux-s390x": "0.34.2-rc.0",
|
"@img/sharp-linux-s390x": "0.34.2",
|
||||||
"@img/sharp-linux-x64": "0.34.2-rc.0",
|
"@img/sharp-linux-x64": "0.34.2",
|
||||||
"@img/sharp-linuxmusl-arm64": "0.34.2-rc.0",
|
"@img/sharp-linuxmusl-arm64": "0.34.2",
|
||||||
"@img/sharp-linuxmusl-x64": "0.34.2-rc.0",
|
"@img/sharp-linuxmusl-x64": "0.34.2",
|
||||||
"@img/sharp-wasm32": "0.34.2-rc.0",
|
"@img/sharp-wasm32": "0.34.2",
|
||||||
"@img/sharp-win32-arm64": "0.34.2-rc.0",
|
"@img/sharp-win32-arm64": "0.34.2",
|
||||||
"@img/sharp-win32-ia32": "0.34.2-rc.0",
|
"@img/sharp-win32-ia32": "0.34.2",
|
||||||
"@img/sharp-win32-x64": "0.34.2-rc.0"
|
"@img/sharp-win32-x64": "0.34.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@emnapi/runtime": "^1.4.3",
|
"@emnapi/runtime": "^1.4.3",
|
||||||
@@ -179,7 +179,7 @@
|
|||||||
"icc": "^3.0.0",
|
"icc": "^3.0.0",
|
||||||
"jsdoc-to-markdown": "^9.1.1",
|
"jsdoc-to-markdown": "^9.1.1",
|
||||||
"license-checker": "^25.0.1",
|
"license-checker": "^25.0.1",
|
||||||
"mocha": "^11.2.2",
|
"mocha": "^11.4.0",
|
||||||
"node-addon-api": "^8.3.1",
|
"node-addon-api": "^8.3.1",
|
||||||
"nyc": "^17.1.0",
|
"nyc": "^17.1.0",
|
||||||
"prebuild": "^13.0.1",
|
"prebuild": "^13.0.1",
|
||||||
|
|||||||
@@ -294,6 +294,7 @@ class PipelineWorker : public Napi::AsyncWorker {
|
|||||||
option->set("n", baton->input->pages);
|
option->set("n", baton->input->pages);
|
||||||
option->set("page", baton->input->page);
|
option->set("page", baton->input->page);
|
||||||
option->set("dpi", baton->input->density);
|
option->set("dpi", baton->input->density);
|
||||||
|
option->set("background", baton->input->pdfBackground);
|
||||||
|
|
||||||
if (baton->input->buffer != nullptr) {
|
if (baton->input->buffer != nullptr) {
|
||||||
// Reload PDF buffer
|
// Reload PDF buffer
|
||||||
|
|||||||
@@ -10,18 +10,20 @@ const sharp = require('../../');
|
|||||||
describe('Utilities', function () {
|
describe('Utilities', function () {
|
||||||
describe('Cache', function () {
|
describe('Cache', function () {
|
||||||
it('Can be disabled', function (done) {
|
it('Can be disabled', function (done) {
|
||||||
queueMicrotask(() => {
|
const check = setInterval(() => {
|
||||||
sharp.cache(false);
|
|
||||||
const cache = sharp.cache(false);
|
const cache = sharp.cache(false);
|
||||||
assert.strictEqual(cache.memory.current, 0);
|
const empty =
|
||||||
assert.strictEqual(cache.memory.max, 0);
|
cache.memory.current +
|
||||||
assert.strictEqual(typeof cache.memory.high, 'number');
|
cache.memory.max +
|
||||||
assert.strictEqual(cache.files.current, 0);
|
cache.files.current +
|
||||||
assert.strictEqual(cache.files.max, 0);
|
cache.files.max +
|
||||||
assert.strictEqual(cache.items.current, 0);
|
cache.items.current +
|
||||||
assert.strictEqual(cache.items.max, 0);
|
cache.items.max === 0;
|
||||||
done();
|
if (empty) {
|
||||||
});
|
clearInterval(check);
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
}, 2000);
|
||||||
});
|
});
|
||||||
it('Can be enabled with defaults', function () {
|
it('Can be enabled with defaults', function () {
|
||||||
const cache = sharp.cache(true);
|
const cache = sharp.cache(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user