Allow max image side length to be configurable

This commit is contained in:
Petr Sloup
2016-08-25 09:41:33 +02:00
parent 78aea26318
commit 90b9af3d95
2 changed files with 8 additions and 2 deletions

View File

@@ -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') {