mirror of
https://github.com/lovell/sharp.git
synced 2025-12-18 23:05:04 +01:00
Add support for BigTIFF output (#4459)
This commit is contained in:
@@ -352,6 +352,7 @@ const Sharp = function (input, options) {
|
||||
gifProgressive: false,
|
||||
tiffQuality: 80,
|
||||
tiffCompression: 'jpeg',
|
||||
tiffBigtiff: false,
|
||||
tiffPredictor: 'horizontal',
|
||||
tiffPyramid: false,
|
||||
tiffMiniswhite: false,
|
||||
|
||||
2
lib/index.d.ts
vendored
2
lib/index.d.ts
vendored
@@ -1460,6 +1460,8 @@ declare namespace sharp {
|
||||
quality?: number | undefined;
|
||||
/** Compression options: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k (optional, default 'jpeg') */
|
||||
compression?: string | undefined;
|
||||
/** Use BigTIFF variant (has no effect when compression is none) (optional, default false) */
|
||||
bigtiff?: boolean | undefined;
|
||||
/** Compression predictor options: none, horizontal, float (optional, default 'horizontal') */
|
||||
predictor?: string | undefined;
|
||||
/** Write an image pyramid (optional, default false) */
|
||||
|
||||
@@ -974,6 +974,7 @@ function trySetAnimationOptions (source, target) {
|
||||
* @param {number} [options.quality=80] - quality, integer 1-100
|
||||
* @param {boolean} [options.force=true] - force TIFF output, otherwise attempt to use input format
|
||||
* @param {string} [options.compression='jpeg'] - compression options: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k
|
||||
* @param {boolean} [options.bigtiff=false] - use BigTIFF variant (has no effect when compression is none)
|
||||
* @param {string} [options.predictor='horizontal'] - compression predictor options: none, horizontal, float
|
||||
* @param {boolean} [options.pyramid=false] - write an image pyramid
|
||||
* @param {boolean} [options.tile=false] - write a tiled tiff
|
||||
@@ -1052,6 +1053,10 @@ function tiff (options) {
|
||||
throw is.invalidParameterError('compression', 'one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k', options.compression);
|
||||
}
|
||||
}
|
||||
// bigtiff
|
||||
if (is.defined(options.bigtiff)) {
|
||||
this._setBooleanOption('tiffBigtiff', options.bigtiff);
|
||||
}
|
||||
// predictor
|
||||
if (is.defined(options.predictor)) {
|
||||
if (is.string(options.predictor) && is.inArray(options.predictor, ['none', 'horizontal', 'float'])) {
|
||||
|
||||
Reference in New Issue
Block a user