Upgrade to libvips 8.10.0-beta2

This commit is contained in:
Lovell Fuller
2020-07-14 11:10:20 +01:00
parent ba17db3ab3
commit 3150fad909
18 changed files with 627 additions and 498 deletions

View File

@@ -214,7 +214,7 @@ const Sharp = function (input, options) {
tiffCompression: 'jpeg',
tiffPredictor: 'horizontal',
tiffPyramid: false,
tiffSquash: false,
tiffBitdepth: 8,
tiffTile: false,
tiffTileHeight: 256,
tiffTileWidth: 256,

View File

@@ -187,7 +187,7 @@ function toFormat (format, options) {
* @param {Object} [options] - output options
* @param {number} [options.quality=80] - quality, integer 1-100
* @param {boolean} [options.progressive=false] - use progressive (interlace) scan
* @param {string} [options.chromaSubsampling='4:2:0'] - for quality < 90, set to '4:4:4' to prevent chroma subsampling otherwise defaults to '4:2:0' (use chroma subsampling); for quality >= 90 chroma is never subsampled
* @param {string} [options.chromaSubsampling='4:2:0'] - set to '4:4:4' to prevent chroma subsampling otherwise defaults to '4:2:0' chroma subsampling
* @param {boolean} [options.optimiseCoding=true] - optimise Huffman coding tables
* @param {boolean} [options.optimizeCoding=true] - alternative spelling of optimiseCoding
* @param {boolean} [options.trellisQuantisation=false] - apply trellis quantisation, requires libvips compiled with support for mozjpeg
@@ -386,7 +386,7 @@ function webp (options) {
* sharp('input.svg')
* .tiff({
* compression: 'lzw',
* squash: true
* bitdepth: 1
* })
* .toFile('1-bpp-output.tiff')
* .then(info => { ... });
@@ -402,7 +402,7 @@ function webp (options) {
* @param {boolean} [options.tileHeight=256] - vertical tile size
* @param {number} [options.xres=1.0] - horizontal resolution in pixels/mm
* @param {number} [options.yres=1.0] - vertical resolution in pixels/mm
* @param {boolean} [options.squash=false] - squash 8-bit images down to 1 bit
* @param {boolean} [options.bitdepth=8] - reduce bitdepth to 1, 2 or 4 bit
* @returns {Sharp}
* @throws {Error} Invalid options
*/
@@ -415,8 +415,12 @@ function tiff (options) {
throw is.invalidParameterError('quality', 'integer between 1 and 100', options.quality);
}
}
if (is.defined(options.squash)) {
this._setBooleanOption('tiffSquash', options.squash);
if (is.defined(options.bitdepth)) {
if (is.integer(options.bitdepth) && is.inArray(options.bitdepth, [1, 2, 4, 8])) {
this.options.tiffBitdepth = options.bitdepth;
} else {
throw is.invalidParameterError('bitdepth', '1, 2, 4 or 8', options.bitdepth);
}
}
// tiling
if (is.defined(options.tile)) {