diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6239e09a..b65d48b9 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -14,7 +14,7 @@ If a [similar request](https://github.com/lovell/sharp/labels/enhancement) exist it's probably fastest to add a comment to it about your requirement. Implementation is usually straightforward if libvips -[already supports](https://www.libvips.org/API/current/func-list.html) +[already supports](https://www.libvips.org/API/current/function-list.html) the feature you need. ## Submit a Pull Request to fix a bug diff --git a/docs/package.json b/docs/package.json index 89bd0f29..7eaa4194 100644 --- a/docs/package.json +++ b/docs/package.json @@ -11,8 +11,8 @@ "astro": "astro" }, "dependencies": { - "@astrojs/starlight": "^0.35.2", - "astro": "^5.13.5", - "starlight-auto-sidebar": "^0.1.2" + "@astrojs/starlight": "^0.36.2", + "astro": "^5.15.3", + "starlight-auto-sidebar": "^0.1.3" } } diff --git a/docs/src/content/docs/api-channel.md b/docs/src/content/docs/api-channel.md index fb8ed333..214e8611 100644 --- a/docs/src/content/docs/api-channel.md +++ b/docs/src/content/docs/api-channel.md @@ -8,7 +8,7 @@ title: Channel manipulation Remove alpha channels, if any. This is a no-op if the image does not have an alpha channel. -See also [flatten](/api-operation#flatten). +See also [flatten](/api-operation/#flatten). **Example** diff --git a/docs/src/content/docs/api-colour.md b/docs/src/content/docs/api-colour.md index b1085ed2..6fb81deb 100644 --- a/docs/src/content/docs/api-colour.md +++ b/docs/src/content/docs/api-colour.md @@ -80,7 +80,7 @@ as defined by [toColourspace](#tocolourspace). | Param | Type | Description | | --- | --- | --- | -| [colourspace] | string | pipeline colourspace e.g. `rgb16`, `scrgb`, `lab`, `grey16` [...](https://github.com/libvips/libvips/blob/41cff4e9d0838498487a00623462204eb10ee5b8/libvips/iofuncs/enumtypes.c#L774) | +| [colourspace] | string | pipeline colourspace e.g. `rgb16`, `scrgb`, `lab`, `grey16` [...](https://www.libvips.org/API/current/enum.Interpretation.html) | **Example** ```js @@ -123,7 +123,7 @@ By default output image will be web-friendly sRGB, with additional channels inte | Param | Type | Description | | --- | --- | --- | -| [colourspace] | string | output colourspace e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...](https://github.com/libvips/libvips/blob/3c0bfdf74ce1dc37a6429bed47fa76f16e2cd70a/libvips/iofuncs/enumtypes.c#L777-L794) | +| [colourspace] | string | output colourspace e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...](https://www.libvips.org/API/current/enum.Interpretation.html) | **Example** ```js diff --git a/docs/src/content/docs/api-composite.md b/docs/src/content/docs/api-composite.md index ea185ba0..d4f9b855 100644 --- a/docs/src/content/docs/api-composite.md +++ b/docs/src/content/docs/api-composite.md @@ -21,7 +21,7 @@ The `blend` option can be one of `clear`, `source`, `over`, `in`, `out`, `atop`, `hard-light`, `soft-light`, `difference`, `exclusion`. More information about blend modes can be found at -https://www.libvips.org/API/current/libvips-conversion.html#VipsBlendMode +https://www.libvips.org/API/current/enum.BlendMode.html and https://www.cairographics.org/operators/ @@ -64,8 +64,8 @@ and https://www.cairographics.org/operators/ | [images[].raw.height] | Number | | | | [images[].raw.channels] | Number | | | | [images[].animated] | boolean | false | Set to `true` to read all frames/pages of an animated image. | -| [images[].failOn] | string | "'warning'" | @see [constructor parameters](/api-constructor#parameters) | -| [images[].limitInputPixels] | number \| boolean | 268402689 | @see [constructor parameters](/api-constructor#parameters) | +| [images[].failOn] | string | "'warning'" | @see [constructor parameters](/api-constructor/) | +| [images[].limitInputPixels] | number \| boolean | 268402689 | @see [constructor parameters](/api-constructor/) | **Example** ```js diff --git a/docs/src/content/docs/api-input.md b/docs/src/content/docs/api-input.md index e460723c..a5a9e373 100644 --- a/docs/src/content/docs/api-input.md +++ b/docs/src/content/docs/api-input.md @@ -13,7 +13,7 @@ It does not take into consideration any operations to be applied to the output i such as resize or rotate. Dimensions in the response will respect the `page` and `pages` properties of the -[constructor parameters](/api-constructor#parameters). +[constructor parameters](/api-constructor/). A `Promise` is returned when `callback` is not provided. @@ -21,9 +21,9 @@ A `Promise` is returned when `callback` is not provided. - `size`: Total size of image in bytes, for Stream and Buffer input only - `width`: Number of pixels wide (EXIF orientation is not taken into consideration, see example below) - `height`: Number of pixels high (EXIF orientation is not taken into consideration, see example below) -- `space`: Name of colour space interpretation e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...](https://www.libvips.org/API/current/VipsImage.html#VipsInterpretation) +- `space`: Name of colour space interpretation e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...](https://www.libvips.org/API/current/enum.Interpretation.html) - `channels`: Number of bands e.g. `3` for sRGB, `4` for CMYK -- `depth`: Name of pixel depth format e.g. `uchar`, `char`, `ushort`, `float` [...](https://www.libvips.org/API/current/VipsImage.html#VipsBandFormat) +- `depth`: Name of pixel depth format e.g. `uchar`, `char`, `ushort`, `float` [...](https://www.libvips.org/API/current/enum.BandFormat.html) - `density`: Number of pixels per inch (DPI), if present - `chromaSubsampling`: String containing JPEG chroma subsampling, `4:2:0` or `4:4:4` for RGB, `4:2:0:4` or `4:4:4:4` for CMYK - `isProgressive`: Boolean indicating whether the image is interlaced using a progressive scan diff --git a/docs/src/content/docs/api-operation.md b/docs/src/content/docs/api-operation.md index dea7c79e..abcb41fc 100644 --- a/docs/src/content/docs/api-operation.md +++ b/docs/src/content/docs/api-operation.md @@ -179,7 +179,7 @@ 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. -See [libvips sharpen](https://www.libvips.org/API/current/libvips-convolution.html#vips-sharpen) operation. +See [libvips sharpen](https://www.libvips.org/API/current/method.Image.sharpen.html) operation. **Throws**: diff --git a/docs/src/content/docs/api-output.md b/docs/src/content/docs/api-output.md index 800732a2..8368e54d 100644 --- a/docs/src/content/docs/api-output.md +++ b/docs/src/content/docs/api-output.md @@ -201,7 +201,7 @@ const dataWithMergedExif = await sharp(inputWithExif) Keep ICC profile from the input image in the output image. -Where necessary, will attempt to convert the output colour space to match the profile. +For non-RGB output use [toColourspace](/api-colour/#tocolourspace). **Since**: 0.33.0 @@ -430,7 +430,7 @@ Indexed PNG input at 1, 2 or 4 bits per pixel is converted to 8 bits per pixel. Set `palette` to `true` for slower, indexed PNG output. For 16 bits per pixel output, convert to `rgb16` via -[toColourspace](/api-colour#tocolourspace). +[toColourspace](/api-colour/#tocolourspace). **Throws**: @@ -589,7 +589,7 @@ Use these JP2 options for output image. Requires libvips compiled with support for OpenJPEG. The prebuilt binaries do not include this - see -[installing a custom libvips](https://sharp.pixelplumbing.com/install#custom-libvips). +[installing a custom libvips](/install#custom-libvips). **Throws**: @@ -754,7 +754,7 @@ This feature is experimental, please do not use in production systems. Requires libvips compiled with support for libjxl. The prebuilt binaries do not include this - see -[installing a custom libvips](https://sharp.pixelplumbing.com/install#custom-libvips). +[installing a custom libvips](/install/#custom-libvips). **Throws**: diff --git a/docs/src/content/docs/api-utility.md b/docs/src/content/docs/api-utility.md index b2ac1686..73190fd0 100644 --- a/docs/src/content/docs/api-utility.md +++ b/docs/src/content/docs/api-utility.md @@ -114,7 +114,7 @@ e.g. libaom manages its own 4 threads when encoding AVIF images, and these are independent of the value set here. :::note -Further [control over performance](/performance) is available. +Further [control over performance](/performance/) is available. ::: diff --git a/lib/channel.js b/lib/channel.js index 6af20db6..9576ff83 100644 --- a/lib/channel.js +++ b/lib/channel.js @@ -18,7 +18,7 @@ const bool = { /** * Remove alpha channels, if any. This is a no-op if the image does not have an alpha channel. * - * See also {@link /api-operation#flatten|flatten}. + * See also {@link /api-operation/#flatten flatten}. * * @example * sharp('rgba.png') diff --git a/lib/colour.js b/lib/colour.js index f4c2a2b7..a606738c 100644 --- a/lib/colour.js +++ b/lib/colour.js @@ -69,7 +69,7 @@ function grayscale (grayscale) { * * 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 {@link #tocolourspace|toColourspace}. + * as defined by {@link #tocolourspace toColourspace}. * * @since 0.29.0 * @@ -80,7 +80,7 @@ function grayscale (grayscale) { * .toColourspace('srgb') * .toFile('16bpc-pipeline-to-8bpc-output.png') * - * @param {string} [colourspace] - pipeline colourspace e.g. `rgb16`, `scrgb`, `lab`, `grey16` [...](https://github.com/libvips/libvips/blob/41cff4e9d0838498487a00623462204eb10ee5b8/libvips/iofuncs/enumtypes.c#L774) + * @param {string} [colourspace] - pipeline colourspace e.g. `rgb16`, `scrgb`, `lab`, `grey16` [...](https://www.libvips.org/API/current/enum.Interpretation.html) * @returns {Sharp} * @throws {Error} Invalid parameters */ @@ -112,7 +112,7 @@ function pipelineColorspace (colorspace) { * .toColourspace('rgb16') * .toFile('16-bpp.png') * - * @param {string} [colourspace] - output colourspace e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...](https://github.com/libvips/libvips/blob/3c0bfdf74ce1dc37a6429bed47fa76f16e2cd70a/libvips/iofuncs/enumtypes.c#L777-L794) + * @param {string} [colourspace] - output colourspace e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...](https://www.libvips.org/API/current/enum.Interpretation.html) * @returns {Sharp} * @throws {Error} Invalid parameters */ diff --git a/lib/composite.js b/lib/composite.js index aab05896..cd803763 100644 --- a/lib/composite.js +++ b/lib/composite.js @@ -56,7 +56,7 @@ const blend = { * `hard-light`, `soft-light`, `difference`, `exclusion`. * * More information about blend modes can be found at - * https://www.libvips.org/API/current/libvips-conversion.html#VipsBlendMode + * https://www.libvips.org/API/current/enum.BlendMode.html * and https://www.cairographics.org/operators/ * * @since 0.22.0 @@ -123,8 +123,8 @@ const blend = { * @param {Number} [images[].raw.height] * @param {Number} [images[].raw.channels] * @param {boolean} [images[].animated=false] - Set to `true` to read all frames/pages of an animated image. - * @param {string} [images[].failOn='warning'] - @see {@link /api-constructor#parameters|constructor parameters} - * @param {number|boolean} [images[].limitInputPixels=268402689] - @see {@link /api-constructor#parameters|constructor parameters} + * @param {string} [images[].failOn='warning'] - @see {@link /api-constructor/ constructor parameters} + * @param {number|boolean} [images[].limitInputPixels=268402689] - @see {@link /api-constructor/ constructor parameters} * @returns {Sharp} * @throws {Error} Invalid parameters */ diff --git a/lib/input.js b/lib/input.js index 27d24883..a3c13fff 100644 --- a/lib/input.js +++ b/lib/input.js @@ -570,7 +570,7 @@ function _isStreamInput () { * such as resize or rotate. * * Dimensions in the response will respect the `page` and `pages` properties of the - * {@link /api-constructor#parameters|constructor parameters}. + * {@link /api-constructor/ constructor parameters}. * * A `Promise` is returned when `callback` is not provided. * @@ -578,9 +578,9 @@ function _isStreamInput () { * - `size`: Total size of image in bytes, for Stream and Buffer input only * - `width`: Number of pixels wide (EXIF orientation is not taken into consideration, see example below) * - `height`: Number of pixels high (EXIF orientation is not taken into consideration, see example below) - * - `space`: Name of colour space interpretation e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...](https://www.libvips.org/API/current/VipsImage.html#VipsInterpretation) + * - `space`: Name of colour space interpretation e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...](https://www.libvips.org/API/current/enum.Interpretation.html) * - `channels`: Number of bands e.g. `3` for sRGB, `4` for CMYK - * - `depth`: Name of pixel depth format e.g. `uchar`, `char`, `ushort`, `float` [...](https://www.libvips.org/API/current/VipsImage.html#VipsBandFormat) + * - `depth`: Name of pixel depth format e.g. `uchar`, `char`, `ushort`, `float` [...](https://www.libvips.org/API/current/enum.BandFormat.html) * - `density`: Number of pixels per inch (DPI), if present * - `chromaSubsampling`: String containing JPEG chroma subsampling, `4:2:0` or `4:4:4` for RGB, `4:2:0:4` or `4:4:4:4` for CMYK * - `isProgressive`: Boolean indicating whether the image is interlaced using a progressive scan diff --git a/lib/operation.js b/lib/operation.js index 183353fc..9b30efbe 100644 --- a/lib/operation.js +++ b/lib/operation.js @@ -239,7 +239,7 @@ function affine (matrix, options) { * 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. * - * See {@link https://www.libvips.org/API/current/libvips-convolution.html#vips-sharpen|libvips sharpen} operation. + * See {@link https://www.libvips.org/API/current/method.Image.sharpen.html libvips sharpen} operation. * * @example * const data = await sharp(input).sharpen().toBuffer(); @@ -485,7 +485,7 @@ function erode (width) { /** * Merge alpha transparency channel, if any, with a background, then remove the alpha channel. * - * See also {@link /api-channel#removealpha|removeAlpha}. + * See also {@link /api-channel#removealpha removeAlpha}. * * @example * await sharp(rgbaInput) @@ -660,7 +660,7 @@ function normalize (options) { /** * Perform contrast limiting adaptive histogram equalization - * {@link https://en.wikipedia.org/wiki/Adaptive_histogram_equalization#Contrast_Limited_AHE|CLAHE}. + * {@link https://en.wikipedia.org/wiki/Adaptive_histogram_equalization#Contrast_Limited_AHE CLAHE}. * * This will, in general, enhance the clarity of the image by bringing out darker details. * diff --git a/lib/output.js b/lib/output.js index e10dc05b..7ba8707c 100644 --- a/lib/output.js +++ b/lib/output.js @@ -43,7 +43,7 @@ const bitdepthFromColourCount = (colours) => 1 << 31 - Math.clz32(Math.ceil(Math * Note that raw pixel data is only supported for buffer output. * * By default all metadata will be removed, which includes EXIF-based orientation. - * See {@link #withmetadata|withMetadata} for control over this. + * See {@link #withmetadata withMetadata} for control over this. * * The caller is responsible for ensuring directory structures and permissions exist. * @@ -97,12 +97,12 @@ function toFile (fileOut, callback) { * Write output to a Buffer. * JPEG, PNG, WebP, AVIF, TIFF, GIF and raw pixel data output are supported. * - * Use {@link #toformat|toFormat} or one of the format-specific functions such as {@link jpeg}, {@link png} etc. to set the output format. + * Use {@link #toformat toFormat} or one of the format-specific functions such as {@link #jpeg jpeg}, {@link #png png} etc. to set the output format. * * If no explicit format is set, the output format will match the input image, except SVG input which becomes PNG output. * * By default all metadata will be removed, which includes EXIF-based orientation. - * See {@link #withmetadata|withMetadata} for control over this. + * See {@link #withmetadata withMetadata} for control over this. * * `callback`, if present, gets three arguments `(err, data, info)` where: * - `err` is an error, if any. @@ -256,7 +256,7 @@ function withExifMerge (exif) { /** * Keep ICC profile from the input image in the output image. * - * Where necessary, will attempt to convert the output colour space to match the profile. + * For non-RGB output use {@link /api-colour/#tocolourspace toColourspace}. * * @since 0.33.0 * @@ -565,7 +565,7 @@ function jpeg (options) { * Set `palette` to `true` for slower, indexed PNG output. * * For 16 bits per pixel output, convert to `rgb16` via - * {@link /api-colour#tocolourspace|toColourspace}. + * {@link /api-colour/#tocolourspace toColourspace}. * * @example * // Convert any input to full colour PNG output @@ -850,7 +850,7 @@ function gif (options) { * * Requires libvips compiled with support for OpenJPEG. * The prebuilt binaries do not include this - see - * {@link https://sharp.pixelplumbing.com/install#custom-libvips installing a custom libvips}. + * {@link /install#custom-libvips installing a custom libvips}. * * @example * // Convert any input to lossless JP2 output @@ -959,7 +959,7 @@ function trySetAnimationOptions (source, target) { /** * Use these TIFF options for output image. * - * The `density` can be set in pixels/inch via {@link #withmetadata|withMetadata} + * The `density` can be set in pixels/inch via {@link #withmetadata withMetadata} * instead of providing `xres` and `yres` in pixels/mm. * * @example @@ -1194,7 +1194,7 @@ function heif (options) { * * Requires libvips compiled with support for libjxl. * The prebuilt binaries do not include this - see - * {@link https://sharp.pixelplumbing.com/install#custom-libvips installing a custom libvips}. + * {@link /install/#custom-libvips installing a custom libvips}. * * @since 0.31.3 * diff --git a/lib/utility.js b/lib/utility.js index 3ef27a6a..6b445d7c 100644 --- a/lib/utility.js +++ b/lib/utility.js @@ -136,7 +136,7 @@ cache(true); * and these are independent of the value set here. * * :::note - * Further {@link /performance|control over performance} is available. + * Further {@link /performance/ control over performance} is available. * ::: * * @example