diff --git a/docs/api-input.md b/docs/api-input.md index 98ebb015..1db1e976 100644 --- a/docs/api-input.md +++ b/docs/api-input.md @@ -87,6 +87,8 @@ Returns **Sharp** An advanced setting that switches the libvips access method to `VIPS_ACCESS_SEQUENTIAL`. This will reduce memory usage and can improve performance on some systems. +The default behaviour _before_ function call is `false`, meaning the libvips access method is not sequential. + **Parameters** - `sequentialRead` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** (optional, default `true`) diff --git a/docs/api-output.md b/docs/api-output.md index 1a2b03d4..922c649b 100644 --- a/docs/api-output.md +++ b/docs/api-output.md @@ -140,7 +140,7 @@ Use these TIFF options for output image. - `options.quality` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** quality, integer 1-100 (optional, default `80`) - `options.force` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** force TIFF output, otherwise attempt to use input format (optional, default `true`) - `options.compression` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** compression options: lzw, deflate, jpeg (optional, default `'jpeg'`) - - `options.predictor` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** compression predictor options: none, horizontal, float (optional, default `'none'`) + - `options.predictor` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** compression predictor options: none, horizontal, float (optional, default `'horizontal'`) - `options.xres` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** horizontal resolution in pixels/mm (optional, default `1.0`) - `options.yres` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** vertical resolution in pixels/mm (optional, default `1.0`) - `options.squash` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** squash 8-bit images down to 1 bit (optional, default `false`) diff --git a/docs/api-resize.md b/docs/api-resize.md index aafc7e2a..039a2367 100644 --- a/docs/api-resize.md +++ b/docs/api-resize.md @@ -160,6 +160,8 @@ Do not enlarge the output image if the input image width _or_ height are already This is equivalent to GraphicsMagick's `>` geometry option: "_change the dimensions of the image only if its width or height exceeds the geometry specification_". +The default behaviour _before_ function call is `false`, meaning the image will be enlarged. + **Parameters** - `withoutEnlargement` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** (optional, default `true`) diff --git a/docs/changelog.md b/docs/changelog.md index c72e1d33..62ab2dc5 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -22,6 +22,8 @@ Requires libvips v8.6.0. [#977](https://github.com/lovell/sharp/pull/977) [@jardakotesovec](https://github.com/jardakotesovec) +* TIFF output: switch default predictor from 'none' to 'horizontal' to match libvips' behaviour. + ### v0.18 - "*ridge*" Requires libvips v8.5.5. diff --git a/lib/constructor.js b/lib/constructor.js index 73f37d45..cd80ddcd 100644 --- a/lib/constructor.js +++ b/lib/constructor.js @@ -198,7 +198,7 @@ const Sharp = function (input, options) { webpNearLossless: false, tiffQuality: 80, tiffCompression: 'jpeg', - tiffPredictor: 'none', + tiffPredictor: 'horizontal', tiffSquash: false, tiffXres: 1.0, tiffYres: 1.0, diff --git a/lib/output.js b/lib/output.js index ab2b511d..bd368f54 100644 --- a/lib/output.js +++ b/lib/output.js @@ -214,7 +214,7 @@ function webp (options) { * @param {Number} [options.quality=80] - quality, integer 1-100 * @param {Boolean} [options.force=true] - force TIFF output, otherwise attempt to use input format * @param {Boolean} [options.compression='jpeg'] - compression options: lzw, deflate, jpeg - * @param {Boolean} [options.predictor='none'] - compression predictor options: none, horizontal, float + * @param {Boolean} [options.predictor='horizontal'] - compression predictor options: none, horizontal, float * @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 diff --git a/src/pipeline.h b/src/pipeline.h index df834a31..22b1e118 100644 --- a/src/pipeline.h +++ b/src/pipeline.h @@ -184,7 +184,7 @@ struct PipelineBaton { webpQuality(80), tiffQuality(80), tiffCompression(VIPS_FOREIGN_TIFF_COMPRESSION_JPEG), - tiffPredictor(VIPS_FOREIGN_TIFF_PREDICTOR_NONE), + tiffPredictor(VIPS_FOREIGN_TIFF_PREDICTOR_HORIZONTAL), tiffSquash(false), tiffXres(1.0), tiffYres(1.0),