From 3148d6a946b767ee7c2493f4217028d273a2b78f Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 19 Oct 2020 08:56:18 +0100 Subject: [PATCH] Moved definition of default max image width to config (#12289) no issue - centralises definition of max width and allows customisation if needed - allows for passing of the config value through to rendering libraries --- core/server/web/api/middleware/normalize-image.js | 2 +- core/shared/config/overrides.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/server/web/api/middleware/normalize-image.js b/core/server/web/api/middleware/normalize-image.js index f090dcd2c2..b0747391aa 100644 --- a/core/server/web/api/middleware/normalize-image.js +++ b/core/server/web/api/middleware/normalize-image.js @@ -18,7 +18,7 @@ module.exports = function normalize(req, res, next) { in: originalPath, out, ext: req.file.ext, - width: 2000 + width: config.get('imageOptimization:defaultMaxWidth') }, imageOptimizationOptions); imageTransform.resizeFromPath(options) diff --git a/core/shared/config/overrides.json b/core/shared/config/overrides.json index 7385e539fb..51b639309c 100644 --- a/core/shared/config/overrides.json +++ b/core/shared/config/overrides.json @@ -77,6 +77,7 @@ } }, "imageOptimization": { + "defaultMaxWidth": 2000, "contentImageSizes": { "w600": {"width": 600}, "w1000": {"width": 1000},