mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 15:25:07 +01:00
Expose libjpeg optimize_coding flag (#1265)
This commit is contained in:
committed by
Lovell Fuller
parent
873aa6700f
commit
76c41eaf05
@@ -192,6 +192,7 @@ const Sharp = function (input, options) {
|
||||
jpegTrellisQuantisation: false,
|
||||
jpegOvershootDeringing: false,
|
||||
jpegOptimiseScans: false,
|
||||
jpegOptimiseCoding: true,
|
||||
pngProgressive: false,
|
||||
pngCompressionLevel: 9,
|
||||
pngAdaptiveFiltering: false,
|
||||
|
||||
@@ -148,6 +148,8 @@ function withMetadata (withMetadata) {
|
||||
* @param {Boolean} [options.overshootDeringing=false] - apply overshoot deringing, requires mozjpeg
|
||||
* @param {Boolean} [options.optimiseScans=false] - optimise progressive scans, forces progressive, requires mozjpeg
|
||||
* @param {Boolean} [options.optimizeScans=false] - alternative spelling of optimiseScans
|
||||
* @param {Boolean} [options.optimiseCoding=true] - optimise Huffman coding tables
|
||||
* @param {Boolean} [options.optimizeCoding=true] - alternative spelling of optimiseCoding
|
||||
* @param {Boolean} [options.force=true] - force JPEG output, otherwise attempt to use input format
|
||||
* @returns {Sharp}
|
||||
* @throws {Error} Invalid options
|
||||
@@ -185,6 +187,10 @@ function jpeg (options) {
|
||||
this.options.jpegProgressive = true;
|
||||
}
|
||||
}
|
||||
options.optimiseCoding = is.bool(options.optimizeCoding) ? options.optimizeCoding : options.optimiseCoding;
|
||||
if (is.defined(options.optimiseCoding)) {
|
||||
this._setBooleanOption('jpegOptimiseCoding', options.optimiseCoding);
|
||||
}
|
||||
}
|
||||
return this._updateFormatOut('jpeg', options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user