How can I restrict the images selectable by the user in Wagtail's ImageChooserBlock?

Some image content on my Wagtail site must meet certain requirements (e.g. a differing minimum size for banner images, carousel images, etc.).

I know I can validate my image requirements after the edit form data is submitted, but I'd like to make the workflow more user-friendly by restricting the widget to only show images that will pass validation in the first place. What is the best way to go about this?

Wagtail 5.2.2

Back to Top