Disable png quantization by default for now

This commit is contained in:
Petr Sloup 2016-08-25 10:23:42 +02:00
parent 90b9af3d95
commit de60a0a076
2 changed files with 12 additions and 5 deletions

View file

@ -20,9 +20,10 @@ Example::
"127.0.0.1:8080" "127.0.0.1:8080"
], ],
"formatQuality": { "formatQuality": {
"png": 90,
"jpeg": 80, "jpeg": 80,
"webp": 90 "webp": 90,
"pngQuantization": false,
"png": 90
}, },
"maxSize": 2048 "maxSize": 2048
}, },
@ -70,6 +71,8 @@ You can use this to optionally specify on what domains the rendered tiles are ac
Quality of the compression of individual image formats. [0-100] Quality of the compression of individual image formats. [0-100]
The value for ``png`` is only used when ``pngQuantization`` is ``true``.
``maxSize`` ``maxSize``
----------- -----------

View file

@ -317,9 +317,13 @@ module.exports = function(options, repo, params, id, dataResolver) {
} }
if (format == 'png') { if (format == 'png') {
buffer = pngquant.compress(buffer, { var usePngQuant =
quality: [0, formatQuality || 90] (options.formatQuality || {}).pngQuantization === true;
}); if (usePngQuant) {
buffer = pngquant.compress(buffer, {
quality: [0, formatQuality || 90]
});
}
} }
res.set({ res.set({