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"
],
"formatQuality": {
"png": 90,
"jpeg": 80,
"webp": 90
"webp": 90,
"pngQuantization": false,
"png": 90
},
"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]
The value for ``png`` is only used when ``pngQuantization`` is ``true``.
``maxSize``
-----------

View file

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