diff --git a/src/util/Constants.js b/src/util/Constants.js index 44ea09542..5651614c7 100644 --- a/src/util/Constants.js +++ b/src/util/Constants.js @@ -95,13 +95,7 @@ const AllowedImageFormats = [ 'gif', ]; -const AllowedImageSizes = [ - 128, - 256, - 512, - 1024, - 2048, -]; +const AllowedImageSizes = Array.from({ length: 8 }, (e, i) => 2 ** (i + 4)); function makeImageUrl(root, { format = 'webp', size } = {}) { if (format && !AllowedImageFormats.includes(format)) throw new Error('IMAGE_FORMAT', format);