0

Does it somehow possible to validate image dimensions with PIL of the Image on form submitting? Do someone have such practice of validation?

Also important thing is that this is only one image of ListField(EmbeddedDocumentField(ImageItem)) which has some specific tag in description field, for all other images this validation shouldn't work.

Now all picture are uploading to the s3 bucket, I am thinking of loading the image to some tmp folder, validating it and if the image is fine continue the process, if not raise wtforms.ValidationError.

But maybe some other solutions?

Ivan Sushkov
  • 13
  • 1
  • 3
  • The answers to the linked duplicate explain how to get image dimensions using PIL/Pillow and some other packages. If you need help filtering the `ListField(EmbeddedDocumentField(ImageItem))` by tag that should be a separate question. – snakecharmerb Jul 18 '21 at 10:03

0 Answers0