diff --git a/docs/package.json b/docs/package.json
index 7eaa4194..77bb169a 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -11,8 +11,9 @@
"astro": "astro"
},
"dependencies": {
- "@astrojs/starlight": "^0.36.2",
- "astro": "^5.15.3",
- "starlight-auto-sidebar": "^0.1.3"
+ "@astrojs/starlight": "^0.37.1",
+ "astro": "^5.16.6",
+ "jsdoc-to-markdown": "^9.1.3",
+ "starlight-auto-sidebar": "^0.1.4"
}
}
diff --git a/docs/src/content/docs/api-operation.md b/docs/src/content/docs/api-operation.md
index abcb41fc..b154f827 100644
--- a/docs/src/content/docs/api-operation.md
+++ b/docs/src/content/docs/api-operation.md
@@ -170,7 +170,7 @@ inputStream
## sharpen
-> sharpen([options], [flat], [jagged]) ⇒ Sharp
+> sharpen([options]) ⇒ Sharp
Sharpen the image.
@@ -189,15 +189,13 @@ See [libvips sharpen](https://www.libvips.org/API/current/method.Image.sharpen.h
| Param | Type | Default | Description |
| --- | --- | --- | --- |
-| [options] | Object \| number | | if present, is an Object with attributes |
+| [options] | Object | | if present, is an Object with attributes |
| [options.sigma] | number | | the sigma of the Gaussian mask, where `sigma = 1 + radius / 2`, between 0.000001 and 10 |
| [options.m1] | number | 1.0 | the level of sharpening to apply to "flat" areas, between 0 and 1000000 |
| [options.m2] | number | 2.0 | the level of sharpening to apply to "jagged" areas, between 0 and 1000000 |
| [options.x1] | number | 2.0 | threshold between "flat" and "jagged", between 0 and 1000000 |
| [options.y2] | number | 10.0 | maximum amount of brightening, between 0 and 1000000 |
| [options.y3] | number | 20.0 | maximum amount of darkening, between 0 and 1000000 |
-| [flat] | number | | (deprecated) see `options.m1`. |
-| [jagged] | number | | (deprecated) see `options.m2`. |
**Example**
```js
@@ -360,8 +358,6 @@ with all white pixel values made fully transparent.
Existing alpha channel values for non-white pixels remain unchanged.
-This feature is experimental and the API may change.
-
**Since**: 0.32.1
**Example**
diff --git a/docs/src/content/docs/api-output.md b/docs/src/content/docs/api-output.md
index 5902912e..d103ae03 100644
--- a/docs/src/content/docs/api-output.md
+++ b/docs/src/content/docs/api-output.md
@@ -740,8 +740,7 @@ Use these AVIF options for output image.
AVIF image sequences are not supported.
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.
+When using Windows ARM64, this feature requires a CPU with ARM64v8.4 or later.
**Throws**:
diff --git a/docs/src/content/docs/changelog/v0.35.0.md b/docs/src/content/docs/changelog/v0.35.0.md
index 29b43f6b..0a07281f 100644
--- a/docs/src/content/docs/changelog/v0.35.0.md
+++ b/docs/src/content/docs/changelog/v0.35.0.md
@@ -8,6 +8,12 @@ slug: changelog/v0.35.0
* Breaking: Remove `install` script from `package.json` file.
Compiling from source is now opt-in via the `build` script.
+* Breaking: Remove deprecated `failOnError` constructor property.
+
+* Breaking: Remove deprecated `paletteBitDepth` from `metadata` response.
+
+* Breaking: Remove deprecated properties from `sharpen` operation.
+
* Upgrade to libvips v8.18.0 for upstream bug fixes.
* Add `withGainMap` to process HDR JPEG images with embedded gain maps.
diff --git a/lib/index.d.ts b/lib/index.d.ts
index 3d6f840c..9c4aab52 100644
--- a/lib/index.d.ts
+++ b/lib/index.d.ts
@@ -259,7 +259,6 @@ declare namespace sharp {
* Set the pipeline colourspace.
* The input image will be converted to the provided colourspace at the start of the pipeline.
* All operations will use this colourspace before converting to the output colourspace, as defined by toColourspace.
- * This feature is experimental and has not yet been fully-tested with all operations.
*
* @param colourspace pipeline colourspace e.g. rgb16, scrgb, lab, grey16 ...
* @throws {Error} Invalid parameters
@@ -470,21 +469,6 @@ declare namespace sharp {
*/
sharpen(options?: SharpenOptions): Sharp;
- /**
- * Sharpen the image.
- * When used without parameters, performs a fast, mild sharpen of the output image.
- * When a sigma is provided, performs a slower, more accurate sharpen of the L channel in the LAB colour space.
- * Fine-grained control over the level of sharpening in "flat" (m1) and "jagged" (m2) areas is available.
- * @param sigma the sigma of the Gaussian mask, where sigma = 1 + radius / 2.
- * @param flat the level of sharpening to apply to "flat" areas. (optional, default 1.0)
- * @param jagged the level of sharpening to apply to "jagged" areas. (optional, default 2.0)
- * @throws {Error} Invalid parameters
- * @returns A sharp instance that can be used to chain operations
- *
- * @deprecated Use the object parameter `sharpen({sigma, m1, m2, x1, y2, y3})` instead
- */
- sharpen(sigma?: number, flat?: number, jagged?: number): Sharp;
-
/**
* Apply median filter. When used without parameters the default window is 3x3.
* @param size square mask size: size x size (optional, default 3)
@@ -910,7 +894,7 @@ declare namespace sharp {
* - sharp.gravity: north, northeast, east, southeast, south, southwest, west, northwest, center or centre.
* - sharp.strategy: cover only, dynamically crop using either the entropy or attention strategy. Some of these values are based on the object-position CSS property.
*
- * The experimental strategy-based approach resizes so one dimension is at its target length then repeatedly ranks edge regions,
+ * The strategy-based approach resizes so one dimension is at its target length then repeatedly ranks edge regions,
* discarding the edge with the lowest score based on the selected strategy.
* - entropy: focus on the region with the highest Shannon entropy.
* - attention: focus on the region with the highest luminance frequency, colour saturation and presence of skin tones.
@@ -999,14 +983,6 @@ declare namespace sharp {
* 'none' (least), 'truncated', 'error' or 'warning' (most), highers level imply lower levels, invalid metadata will always abort. (optional, default 'warning')
*/
failOn?: FailOnOptions | undefined;
- /**
- * By default halt processing and raise an error when loading invalid images.
- * Set this flag to false if you'd rather apply a "best effort" to decode images,
- * even if the data is corrupt or invalid. (optional, default true)
- *
- * @deprecated Use `failOn` instead
- */
- failOnError?: boolean | undefined;
/**
* Do not process input images where the number of pixels (width x height) exceeds this limit.
* Assumes image dimensions contained in the input metadata can be trusted.
@@ -1308,11 +1284,11 @@ declare namespace sharp {
channels: ChannelStats[];
/** Value to identify if the image is opaque or transparent, based on the presence and use of alpha channel */
isOpaque: boolean;
- /** Histogram-based estimation of greyscale entropy, discarding alpha channel if any (experimental) */
+ /** Histogram-based estimation of greyscale entropy, discarding alpha channel if any */
entropy: number;
- /** Estimation of greyscale sharpness based on the standard deviation of a Laplacian convolution, discarding alpha channel if any (experimental) */
+ /** Estimation of greyscale sharpness based on the standard deviation of a Laplacian convolution, discarding alpha channel if any */
sharpness: number;
- /** Object containing most dominant sRGB colour based on a 4096-bin 3D histogram (experimental) */
+ /** Object containing most dominant sRGB colour based on a 4096-bin 3D histogram */
dominant: { r: number; g: number; b: number };
}
diff --git a/lib/input.js b/lib/input.js
index 90a20bc1..5347d14b 100644
--- a/lib/input.js
+++ b/lib/input.js
@@ -30,7 +30,7 @@ const inputStreamParameters = [
// Format-specific
'jp2', 'openSlide', 'pdf', 'raw', 'svg', 'tiff',
// Deprecated
- 'failOnError', 'openSlideLevel', 'pdfBackground', 'tiffSubifd'
+ 'openSlideLevel', 'pdfBackground', 'tiffSubifd'
];
/**
@@ -106,14 +106,6 @@ function _createInputDescriptor (input, inputOptions, containerOptions) {
}`);
}
if (is.object(inputOptions)) {
- // Deprecated: failOnError
- if (is.defined(inputOptions.failOnError)) {
- if (is.bool(inputOptions.failOnError)) {
- inputDescriptor.failOn = inputOptions.failOnError ? 'warning' : 'none';
- } else {
- throw is.invalidParameterError('failOnError', 'boolean', inputOptions.failOnError);
- }
- }
// failOn
if (is.defined(inputOptions.failOn)) {
if (is.string(inputOptions.failOn) && is.inArray(inputOptions.failOn, ['none', 'truncated', 'error', 'warning'])) {
diff --git a/lib/operation.js b/lib/operation.js
index ebbf54e9..b03b2fb7 100644
--- a/lib/operation.js
+++ b/lib/operation.js
@@ -259,45 +259,18 @@ function affine (matrix, options) {
* })
* .toBuffer();
*
- * @param {Object|number} [options] - if present, is an Object with attributes
+ * @param {Object} [options] - if present, is an Object with attributes
* @param {number} [options.sigma] - the sigma of the Gaussian mask, where `sigma = 1 + radius / 2`, between 0.000001 and 10
* @param {number} [options.m1=1.0] - the level of sharpening to apply to "flat" areas, between 0 and 1000000
* @param {number} [options.m2=2.0] - the level of sharpening to apply to "jagged" areas, between 0 and 1000000
* @param {number} [options.x1=2.0] - threshold between "flat" and "jagged", between 0 and 1000000
* @param {number} [options.y2=10.0] - maximum amount of brightening, between 0 and 1000000
* @param {number} [options.y3=20.0] - maximum amount of darkening, between 0 and 1000000
- * @param {number} [flat] - (deprecated) see `options.m1`.
- * @param {number} [jagged] - (deprecated) see `options.m2`.
* @returns {Sharp}
* @throws {Error} Invalid parameters
*/
-function sharpen (options, flat, jagged) {
- if (!is.defined(options)) {
- // No arguments: default to mild sharpen
- this.options.sharpenSigma = -1;
- } else if (is.bool(options)) {
- // Deprecated boolean argument: apply mild sharpen?
- this.options.sharpenSigma = options ? -1 : 0;
- } else if (is.number(options) && is.inRange(options, 0.01, 10000)) {
- // Deprecated numeric argument: specific sigma
- this.options.sharpenSigma = options;
- // Deprecated control over flat areas
- if (is.defined(flat)) {
- if (is.number(flat) && is.inRange(flat, 0, 10000)) {
- this.options.sharpenM1 = flat;
- } else {
- throw is.invalidParameterError('flat', 'number between 0 and 10000', flat);
- }
- }
- // Deprecated control over jagged areas
- if (is.defined(jagged)) {
- if (is.number(jagged) && is.inRange(jagged, 0, 10000)) {
- this.options.sharpenM2 = jagged;
- } else {
- throw is.invalidParameterError('jagged', 'number between 0 and 10000', jagged);
- }
- }
- } else if (is.plainObject(options)) {
+function sharpen (options) {
+ if (is.plainObject(options)) {
if (is.number(options.sigma) && is.inRange(options.sigma, 0.000001, 10)) {
this.options.sharpenSigma = options.sigma;
} else {
@@ -339,7 +312,7 @@ function sharpen (options, flat, jagged) {
}
}
} else {
- throw is.invalidParameterError('sigma', 'number between 0.01 and 10000', options);
+ this.options.sharpenSigma = -1;
}
return this;
}
@@ -510,8 +483,6 @@ function flatten (options) {
*
* Existing alpha channel values for non-white pixels remain unchanged.
*
- * This feature is experimental and the API may change.
- *
* @since 0.32.1
*
* @example
diff --git a/lib/output.js b/lib/output.js
index d1383f19..2f33df86 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -1151,8 +1151,7 @@ function tiff (options) {
* AVIF image sequences are not supported.
* 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.
+ * When using Windows ARM64, this feature requires a CPU with ARM64v8.4 or later.
*
* @example
* const data = await sharp(input)
diff --git a/package.json b/package.json
index 6d2f0e98..73db59c9 100644
--- a/package.json
+++ b/package.json
@@ -182,7 +182,6 @@
"exif-reader": "^2.0.3",
"extract-zip": "^2.0.1",
"icc": "^3.0.0",
- "jsdoc-to-markdown": "^9.1.3",
"node-addon-api": "^8.5.0",
"node-gyp": "^12.1.0",
"tar-fs": "^3.1.1",
diff --git a/src/metadata.cc b/src/metadata.cc
index ef961367..01cbd51f 100644
--- a/src/metadata.cc
+++ b/src/metadata.cc
@@ -190,10 +190,6 @@ class MetadataWorker : public Napi::AsyncWorker {
info.Set("isPalette", baton->isPalette);
if (baton->bitsPerSample > 0) {
info.Set("bitsPerSample", baton->bitsPerSample);
- if (baton->isPalette) {
- // Deprecated, remove with libvips 8.17.0
- info.Set("paletteBitDepth", baton->bitsPerSample);
- }
}
if (baton->pages > 0) {
info.Set("pages", baton->pages);
diff --git a/test/unit/failOn.js b/test/unit/failOn.js
index c4d44e89..7b58340d 100644
--- a/test/unit/failOn.js
+++ b/test/unit/failOn.js
@@ -54,23 +54,6 @@ describe('failOn', () => {
);
});
- it('deprecated failOnError', () => {
- assert.doesNotThrow(
- () => sharp({ failOnError: true })
- );
- assert.doesNotThrow(
- () => sharp({ failOnError: false })
- );
- assert.throws(
- () => sharp({ failOnError: 'zoinks' }),
- /Expected boolean for failOnError but received zoinks of type string/
- );
- assert.throws(
- () => sharp({ failOnError: 1 }),
- /Expected boolean for failOnError but received 1 of type number/
- );
- });
-
it('returns errors to callback for truncated JPEG', (_t, done) => {
sharp(fixtures.inputJpgTruncated, { failOn: 'truncated' }).toBuffer((err, data, info) => {
assert.ok(err.message.includes('VipsJpeg: premature end of'), err);
diff --git a/test/unit/png.js b/test/unit/png.js
index 38cbc4eb..df2dff0b 100644
--- a/test/unit/png.js
+++ b/test/unit/png.js
@@ -154,7 +154,6 @@ describe('PNG', () => {
isProgressive: false,
isPalette: true,
bitsPerSample: 8,
- paletteBitDepth: 8,
hasProfile: false,
hasAlpha: false
});
@@ -226,11 +225,10 @@ describe('PNG', () => {
.png({ colours: 2, palette: false })
.toBuffer();
- const { channels, isPalette, bitsPerSample, paletteBitDepth, space } = await sharp(data).metadata();
+ const { channels, isPalette, bitsPerSample, space } = await sharp(data).metadata();
assert.strictEqual(channels, 1);
assert.strictEqual(isPalette, false);
assert.strictEqual(bitsPerSample, 1);
- assert.strictEqual(paletteBitDepth, undefined);
assert.strictEqual(space, 'b-w');
});
diff --git a/test/unit/sharpen.js b/test/unit/sharpen.js
index 9ea354a7..1b166ff2 100644
--- a/test/unit/sharpen.js
+++ b/test/unit/sharpen.js
@@ -94,24 +94,6 @@ describe('Sharpen', () => {
});
});
- it('invalid sigma', () => {
- assert.throws(() => {
- sharp(fixtures.inputJpg).sharpen(-1.5);
- });
- });
-
- it('invalid flat', () => {
- assert.throws(() => {
- sharp(fixtures.inputJpg).sharpen(1, -1);
- });
- });
-
- it('invalid jagged', () => {
- assert.throws(() => {
- sharp(fixtures.inputJpg).sharpen(1, 1, -1);
- });
- });
-
it('invalid options.sigma', () => assert.throws(
() => sharp().sharpen({ sigma: -1 }),
/Expected number between 0\.000001 and 10 for options\.sigma but received -1 of type number/
@@ -144,24 +126,23 @@ describe('Sharpen', () => {
it('sharpened image is larger than non-sharpened', (_t, done) => {
sharp(fixtures.inputJpg)
- .resize(320, 240)
- .sharpen(false)
+ .resize(32, 24)
.toBuffer((err, notSharpened, info) => {
if (err) throw err;
assert.strictEqual(true, notSharpened.length > 0);
assert.strictEqual('jpeg', info.format);
- assert.strictEqual(320, info.width);
- assert.strictEqual(240, info.height);
+ assert.strictEqual(32, info.width);
+ assert.strictEqual(24, info.height);
sharp(fixtures.inputJpg)
- .resize(320, 240)
- .sharpen(true)
+ .resize(32, 24)
+ .sharpen()
.toBuffer((err, sharpened, info) => {
if (err) throw err;
assert.strictEqual(true, sharpened.length > 0);
assert.strictEqual(true, sharpened.length > notSharpened.length);
assert.strictEqual('jpeg', info.format);
- assert.strictEqual(320, info.width);
- assert.strictEqual(240, info.height);
+ assert.strictEqual(32, info.width);
+ assert.strictEqual(24, info.height);
done();
});
});