diff --git a/docs/config.rst b/docs/config.rst index a7f2bb6..b123051 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -23,7 +23,8 @@ Example:: "png": 90, "jpeg": 80, "webp": 90 - } + }, + "maxSize": 2048 }, "styles": { "basic": { @@ -69,6 +70,11 @@ 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] +``maxSize`` +----------- + +Maximum image side length to be allowed to be rendered (including scale factor). Default is ``2048``. + ``styles`` ========== diff --git a/src/serve_rendered.js b/src/serve_rendered.js index 4d542bd..b5e7da4 100644 --- a/src/serve_rendered.js +++ b/src/serve_rendered.js @@ -254,7 +254,7 @@ module.exports = function(options, repo, params, id, dataResolver) { return res.status(400).send('Invalid center'); } if (Math.min(width, height) <= 0 || - Math.max(width, height) * scale > 2048) { + Math.max(width, height) * scale > (options.maxSize || 2048)) { return res.status(400).send('Invalid size'); } if (format == 'png' || format == 'webp') {