Limit image file size

A feature that smush and some other image optimisation plugins provide is a hard limit on the image dimensions. For example can be set to max width of 2400px.
Would be useful to have this option so that if a user uploads a 9000px wide image from phone or stock image it will not remain on the server at that size