From 361ed98353a67ecdf2e68a218b677bf2de25665c Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Tue, 23 May 2017 21:57:05 +0100 Subject: [PATCH] Remove previously-deprecated output format 'option' functions --- docs/changelog.md | 5 ++++ lib/output.js | 72 ----------------------------------------------- 2 files changed, 5 insertions(+), 72 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index ccc6e34a..5d14e3a4 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -6,6 +6,11 @@ Requires libvips v8.5.5. #### v0.18.0 - TBD +* Remove the previously-deprecated output format "option" functions: + quality, progressive, compressionLevel, withoutAdaptiveFiltering, + withoutChromaSubsampling, trellisQuantisation, trellisQuantization, + overshootDeringing, optimiseScans and optimizeScans. + * Ensure maximum output dimensions are based on the format to be used. [#176](https://github.com/lovell/sharp/issues/176) [@stephanebachelier](https://github.com/stephanebachelier) diff --git a/lib/output.js b/lib/output.js index eec9dd0a..94351f1e 100644 --- a/lib/output.js +++ b/lib/output.js @@ -1,6 +1,5 @@ 'use strict'; -const util = require('util'); const is = require('./is'); const sharp = require('../build/Release/sharp.node'); @@ -493,66 +492,6 @@ function _pipeline (callback) { } } -// Deprecated output options -/* istanbul ignore next */ -const quality = util.deprecate(function (quality) { - const formatOut = this.options.formatOut; - const options = { quality: quality }; - this.jpeg(options).webp(options).tiff(options); - this.options.formatOut = formatOut; - return this; -}, 'quality: use jpeg({ quality: ... }), webp({ quality: ... }) and/or tiff({ quality: ... }) instead'); -/* istanbul ignore next */ -const progressive = util.deprecate(function (progressive) { - const formatOut = this.options.formatOut; - const options = { progressive: (progressive !== false) }; - this.jpeg(options).png(options); - this.options.formatOut = formatOut; - return this; -}, 'progressive: use jpeg({ progressive: ... }) and/or png({ progressive: ... }) instead'); -/* istanbul ignore next */ -const compressionLevel = util.deprecate(function (compressionLevel) { - const formatOut = this.options.formatOut; - this.png({ compressionLevel: compressionLevel }); - this.options.formatOut = formatOut; - return this; -}, 'compressionLevel: use png({ compressionLevel: ... }) instead'); -/* istanbul ignore next */ -const withoutAdaptiveFiltering = util.deprecate(function (withoutAdaptiveFiltering) { - const formatOut = this.options.formatOut; - this.png({ adaptiveFiltering: (withoutAdaptiveFiltering === false) }); - this.options.formatOut = formatOut; - return this; -}, 'withoutAdaptiveFiltering: use png({ adaptiveFiltering: ... }) instead'); -/* istanbul ignore next */ -const withoutChromaSubsampling = util.deprecate(function (withoutChromaSubsampling) { - const formatOut = this.options.formatOut; - this.jpeg({ chromaSubsampling: (withoutChromaSubsampling === false) ? '4:2:0' : '4:4:4' }); - this.options.formatOut = formatOut; - return this; -}, 'withoutChromaSubsampling: use jpeg({ chromaSubsampling: "4:4:4" }) instead'); -/* istanbul ignore next */ -const trellisQuantisation = util.deprecate(function (trellisQuantisation) { - const formatOut = this.options.formatOut; - this.jpeg({ trellisQuantisation: (trellisQuantisation !== false) }); - this.options.formatOut = formatOut; - return this; -}, 'trellisQuantisation: use jpeg({ trellisQuantisation: ... }) instead'); -/* istanbul ignore next */ -const overshootDeringing = util.deprecate(function (overshootDeringing) { - const formatOut = this.options.formatOut; - this.jpeg({ overshootDeringing: (overshootDeringing !== false) }); - this.options.formatOut = formatOut; - return this; -}, 'overshootDeringing: use jpeg({ overshootDeringing: ... }) instead'); -/* istanbul ignore next */ -const optimiseScans = util.deprecate(function (optimiseScans) { - const formatOut = this.options.formatOut; - this.jpeg({ optimiseScans: (optimiseScans !== false) }); - this.options.formatOut = formatOut; - return this; -}, 'optimiseScans: use jpeg({ optimiseScans: ... }) instead'); - /** * Decorate the Sharp prototype with output-related functions. * @private @@ -578,15 +517,4 @@ module.exports = function (Sharp) { ].forEach(function (f) { Sharp.prototype[f.name] = f; }); - // Deprecated - Sharp.prototype.quality = quality; - Sharp.prototype.progressive = progressive; - Sharp.prototype.compressionLevel = compressionLevel; - Sharp.prototype.withoutAdaptiveFiltering = withoutAdaptiveFiltering; - Sharp.prototype.withoutChromaSubsampling = withoutChromaSubsampling; - Sharp.prototype.trellisQuantisation = trellisQuantisation; - Sharp.prototype.trellisQuantization = trellisQuantisation; - Sharp.prototype.overshootDeringing = overshootDeringing; - Sharp.prototype.optimiseScans = optimiseScans; - Sharp.prototype.optimizeScans = optimiseScans; };