summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/slow-impalas-taste.md5
-rw-r--r--packages/astro/src/@types/astro.ts2
-rw-r--r--packages/astro/src/assets/services/sharp.ts4
3 files changed, 8 insertions, 3 deletions
diff --git a/.changeset/slow-impalas-taste.md b/.changeset/slow-impalas-taste.md
new file mode 100644
index 000000000..9825d5420
--- /dev/null
+++ b/.changeset/slow-impalas-taste.md
@@ -0,0 +1,5 @@
+---
+"astro": patch
+---
+
+Fixes the Sharp image service `limitInputPixels` option type
diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts
index 70a11337b..f32bcefe0 100644
--- a/packages/astro/src/@types/astro.ts
+++ b/packages/astro/src/@types/astro.ts
@@ -1118,7 +1118,7 @@ export interface AstroUserConfig {
* @docs
* @name image.service.config.limitInputPixels
* @kind h4
- * @type {boolean}
+ * @type {number | boolean}
* @default `true`
* @version 4.1.0
* @description
diff --git a/packages/astro/src/assets/services/sharp.ts b/packages/astro/src/assets/services/sharp.ts
index 74bf921d9..5175bfb96 100644
--- a/packages/astro/src/assets/services/sharp.ts
+++ b/packages/astro/src/assets/services/sharp.ts
@@ -1,4 +1,4 @@
-import type { FormatEnum } from 'sharp';
+import type { FormatEnum, SharpOptions } from 'sharp';
import { AstroError, AstroErrorData } from '../../core/errors/index.js';
import type { ImageOutputFormat, ImageQualityPreset } from '../types.js';
import {
@@ -12,7 +12,7 @@ export interface SharpImageServiceConfig {
/**
* The `limitInputPixels` option passed to Sharp. See https://sharp.pixelplumbing.com/api-constructor for more information
*/
- limitInputPixels?: number;
+ limitInputPixels?: SharpOptions['limitInputPixels'];
}
let sharp: typeof import('sharp');