Fix image sizing issue with picture field #6530
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unfortunately, there was an issue with the MAX_UPLOAD_FILE_SIZE check validation workflow for the picture field.
Example scenario: if the MAX_UPLOAD_FILE_SIZE is set as 12MB, when an image less than 12MB but still large e.g 11MB is uploaded into the dropzone then it is accepted and then goes through the cropper which ends up returning an image that may be larger than the 12MB, especially if the original image was .png. When this image is checked again at
def validate_upload_file_size, the validation then fails.This issue with the cropped image being bigger is mention in the cropper library with a workaround https://github.com/fengyuanchen/cropperjs?tab=readme-ov-file#known-issues