mirror of
https://github.com/danbulant/pngjs
synced 2026-06-09 17:41:03 +00:00
added zlib deflateStrategy option, default to Z_RLE
This commit is contained in:
parent
dda49ff154
commit
303e231a7e
1 changed files with 3 additions and 1 deletions
|
|
@ -36,6 +36,7 @@ var Packer = module.exports = function(options) {
|
||||||
|
|
||||||
options.deflateChunkSize = options.deflateChunkSize || 32 * 1024;
|
options.deflateChunkSize = options.deflateChunkSize || 32 * 1024;
|
||||||
options.deflateLevel = options.deflateLevel || 9;
|
options.deflateLevel = options.deflateLevel || 9;
|
||||||
|
options.deflateStrategy = options.deflateStrategy || 3;
|
||||||
|
|
||||||
this.readable = true;
|
this.readable = true;
|
||||||
};
|
};
|
||||||
|
|
@ -55,7 +56,8 @@ Packer.prototype.pack = function(data, width, height) {
|
||||||
// compress it
|
// compress it
|
||||||
var deflate = zlib.createDeflate({
|
var deflate = zlib.createDeflate({
|
||||||
chunkSize: this._options.deflateChunkSize,
|
chunkSize: this._options.deflateChunkSize,
|
||||||
level: this._options.deflateLevel
|
level: this._options.deflateLevel,
|
||||||
|
strategy: this._options.deflateStrategy
|
||||||
});
|
});
|
||||||
deflate.on('error', this.emit.bind(this, 'error'));
|
deflate.on('error', this.emit.bind(this, 'error'));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue