Feature request - ALLOWED_WIDTHS and ALLOWED_HEIGHTS
Author: mylselganCreated Nov 22, 2023Updated Jun 18, 2025
LabelsFEATURENeed helpdo-not-reap
Feature Request
We use only 3 to 4 dimensions of images in our site. We already configured ALLOWED_SOURCES so that others can not abuse our server with their domain. Additionally ALLOWED_WIDTHS and ALLOWED_HEIGHTS would be very useful so that we won't need to configure complex SECURITY_KEY feature to prevent image size abuses.
For example ALLOWED_WIDTHS = ["400", "550"] ALLOWED_HEIGHTS = ["200", "400"]
with this configuration we only can create 400x200, 400x400, 550x200 and 550x400
I think this can be easily implemented (I am not sure about the complexity) as MAX_WIDTH and MAX_HEIGHT feature is already available.
100s of Thanks to the developers, contributors and financial supporters for this great open source tool.
Source: thumbor/thumbor