You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/content/docs/api-constructor.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,10 +44,6 @@ where the overall height is the `pageHeight` multiplied by the number of `pages`
44
44
|[options.ignoreIcc]| <code>number</code> | <code>false</code> | should the embedded ICC profile, if any, be ignored. |
45
45
|[options.pages]| <code>number</code> | <code>1</code> | Number of pages to extract for multi-page input (GIF, WebP, TIFF), use -1 for all pages. |
46
46
|[options.page]| <code>number</code> | <code>0</code> | Page number to start extracting from for multi-page input (GIF, WebP, TIFF), zero based. |
47
-
|[options.subifd]| <code>number</code> | <code>-1</code> | subIFD (Sub Image File Directory) to extract for OME-TIFF, defaults to main image. |
48
-
|[options.level]| <code>number</code> | <code>0</code> | level to extract from a multi-level input (OpenSlide), zero based. |
49
-
|[options.pdfBackground]| <code>string</code> \| <code>Object</code> || Background colour to use when PDF is partially transparent. Parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha. Requires the use of a globally-installed libvips compiled with support for PDFium, Poppler, ImageMagick or GraphicsMagick. |
50
-
|[options.jp2Oneshot]| <code>boolean</code> | <code>false</code> | Set to `true` to decode tiled JPEG 2000 images in a single operation, improving compatibility. |
51
47
|[options.animated]| <code>boolean</code> | <code>false</code> | Set to `true` to read all frames/pages of an animated image (GIF, WebP, TIFF), equivalent of setting `pages` to `-1`. |
52
48
|[options.raw]| <code>Object</code> || describes raw pixel input image data. See `raw()` for pixel ordering. |
53
49
|[options.raw.width]| <code>number</code> || integral number of pixels wide. |
@@ -82,6 +78,14 @@ where the overall height is the `pageHeight` multiplied by the number of `pages`
82
78
|[options.join.background]| <code>string</code> \| <code>Object</code> || parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha. |
83
79
|[options.join.halign]| <code>string</code> | <code>"'left'"</code> | horizontal alignment style for images joined horizontally (`'left'`, `'centre'`, `'center'`, `'right'`). |
84
80
|[options.join.valign]| <code>string</code> | <code>"'top'"</code> | vertical alignment style for images joined vertically (`'top'`, `'centre'`, `'center'`, `'bottom'`). |
81
+
|[options.tiff]| <code>Object</code> || Describes TIFF specific options. |
82
+
|[options.tiff.subifd]| <code>number</code> | <code>-1</code> | Sub Image File Directory to extract for OME-TIFF, defaults to main image. |
83
+
|[options.pdf]| <code>Object</code> || Describes PDF specific options. Requires the use of a globally-installed libvips compiled with support for PDFium, Poppler, ImageMagick or GraphicsMagick. |
84
+
|[options.pdf.background]| <code>string</code> \| <code>Object</code> || Background colour to use when PDF is partially transparent. Parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha. |
85
+
|[options.openSlide]| <code>Object</code> || Describes OpenSlide specific options. Requires the use of a globally-installed libvips compiled with support for OpenSlide. |
86
+
|[options.openSlide.level]| <code>number</code> | <code>0</code> | Level to extract from a multi-level input, zero based. |
87
+
|[options.jp2]| <code>Object</code> || Describes JPEG 2000 specific options. Requires the use of a globally-installed libvips compiled with support for OpenJPEG. |
88
+
|[options.jp2.oneshot]| <code>boolean</code> | <code>false</code> | Set to `true` to decode tiled JPEG 2000 images in a single operation, improving compatibility. |
* @param {number} [options.ignoreIcc=false] - should the embedded ICC profile, if any, be ignored.
154
154
* @param {number} [options.pages=1] - Number of pages to extract for multi-page input (GIF, WebP, TIFF), use -1 for all pages.
155
155
* @param {number} [options.page=0] - Page number to start extracting from for multi-page input (GIF, WebP, TIFF), zero based.
156
-
* @param {number} [options.subifd=-1] - subIFD (Sub Image File Directory) to extract for OME-TIFF, defaults to main image.
157
-
* @param {number} [options.level=0] - level to extract from a multi-level input (OpenSlide), zero based.
158
-
* @param {string|Object} [options.pdfBackground] - Background colour to use when PDF is partially transparent. Parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha. Requires the use of a globally-installed libvips compiled with support for PDFium, Poppler, ImageMagick or GraphicsMagick.
159
-
* @param {boolean} [options.jp2Oneshot=false] - Set to `true` to decode tiled JPEG 2000 images in a single operation, improving compatibility.
160
156
* @param {boolean} [options.animated=false] - Set to `true` to read all frames/pages of an animated image (GIF, WebP, TIFF), equivalent of setting `pages` to `-1`.
161
157
* @param {Object} [options.raw] - describes raw pixel input image data. See `raw()` for pixel ordering.
162
158
* @param {number} [options.raw.width] - integral number of pixels wide.
* @param {string|Object} [options.join.background] - parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha.
193
189
* @param {string} [options.join.halign='left'] - horizontal alignment style for images joined horizontally (`'left'`, `'centre'`, `'center'`, `'right'`).
194
190
* @param {string} [options.join.valign='top'] - vertical alignment style for images joined vertically (`'top'`, `'centre'`, `'center'`, `'bottom'`).
195
-
*
191
+
* @param {Object} [options.tiff] - Describes TIFF specific options.
192
+
* @param {number} [options.tiff.subifd=-1] - Sub Image File Directory to extract for OME-TIFF, defaults to main image.
193
+
* @param {Object} [options.pdf] - Describes PDF specific options. Requires the use of a globally-installed libvips compiled with support for PDFium, Poppler, ImageMagick or GraphicsMagick.
194
+
* @param {string|Object} [options.pdf.background] - Background colour to use when PDF is partially transparent. Parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha.
195
+
* @param {Object} [options.openSlide] - Describes OpenSlide specific options. Requires the use of a globally-installed libvips compiled with support for OpenSlide.
196
+
* @param {number} [options.openSlide.level=0] - Level to extract from a multi-level input, zero based.
197
+
* @param {Object} [options.jp2] - Describes JPEG 2000 specific options. Requires the use of a globally-installed libvips compiled with support for OpenJPEG.
198
+
* @param {boolean} [options.jp2.oneshot=false] - Set to `true` to decode tiled JPEG 2000 images in a single operation, improving compatibility.
Copy file name to clipboardExpand all lines: lib/index.d.ts
+32-6Lines changed: 32 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1003,14 +1003,20 @@ declare namespace sharp {
1003
1003
pages?: number|undefined;
1004
1004
/** Page number to start extracting from for multi-page input (GIF, TIFF, PDF), zero based. (optional, default 0) */
1005
1005
page?: number|undefined;
1006
-
/** subIFD (Sub Image File Directory) to extract for OME-TIFF, defaults to main image. (optional, default -1) */
1006
+
/** TIFF specific input options */
1007
+
tiff?: TiffInputOptions|undefined;
1008
+
/** PDF specific input options */
1009
+
pdf?: PdfInputOptions|undefined;
1010
+
/** OpenSlide specific input options */
1011
+
openSlide?: OpenSlideInputOptions|undefined;
1012
+
/** JPEG 2000 specific input options */
1013
+
jp2?: Jp2InputOptions|undefined;
1014
+
/** Deprecated: use tiff.subifd instead */
1007
1015
subifd?: number|undefined;
1008
-
/** Level to extract from a multi-level input (OpenSlide), zero based. (optional, default 0) */
1009
-
level?: number|undefined;
1010
-
/** Background colour to use when PDF is partially transparent. Requires the use of a globally-installed libvips compiled with support for PDFium, Poppler, ImageMagick or GraphicsMagick. */
1016
+
/** Deprecated: use pdf.background instead */
1011
1017
pdfBackground?: Colour|Color|undefined;
1012
-
/** Set to `true` to load JPEG 2000 images using [oneshot mode](https://github.com/libvips/libvips/issues/4205) */
1013
-
jp2Oneshot?: boolean|undefined;
1018
+
/** Deprecated: use openSlide.level instead */
1019
+
level?: number|undefined;
1014
1020
/** Set to `true` to read all frames/pages of an animated image (equivalent of setting `pages` to `-1`). (optional, default false) */
1015
1021
animated?: boolean|undefined;
1016
1022
/** Describes raw pixel input image data. See raw() for pixel ordering. */
@@ -1116,6 +1122,26 @@ declare namespace sharp {
1116
1122
valign?: VerticalAlignment|undefined;
1117
1123
}
1118
1124
1125
+
interfaceTiffInputOptions{
1126
+
/** Sub Image File Directory to extract, defaults to main image. Use -1 for all subifds. */
1127
+
subifd?: number|undefined;
1128
+
}
1129
+
1130
+
interfacePdfInputOptions{
1131
+
/** Background colour to use when PDF is partially transparent. Requires the use of a globally-installed libvips compiled with support for PDFium, Poppler, ImageMagick or GraphicsMagick. */
1132
+
background?: Colour|Color|undefined;
1133
+
}
1134
+
1135
+
interfaceOpenSlideInputOptions{
1136
+
/** Level to extract from a multi-level input, zero based. (optional, default 0) */
1137
+
level?: number|undefined;
1138
+
}
1139
+
1140
+
interfaceJp2InputOptions{
1141
+
/** Set to `true` to load JPEG 2000 images using [oneshot mode](https://github.com/libvips/libvips/issues/4205) */
0 commit comments