I just want to make something clear, as it isn't clear from
@Gladius's posts.
XF will reject images that exceed the max file size, but it will not reject an image that exceeds the maximum width and height. If a maximum width and height is set, the image will be automatically resized. Of course resizing images will reduce the file size too.
The only way to not reject an image which exceeds the maximum file size is for us to guess (or crudely calculate) what to resize the image to. This seems far from ideal, therefore the optimum way of ensuring files do not take up much space.
In the example I just uploaded to this album, the original image (not resized) is over 4MB. The resized image is
261KB.
https://xenforo.com/community/media/albums/test-album.241/
Put simply, if you set a max width and height, you're always going to get a considerably smaller file size images and therefore it is the perfect way of controlling disk space usage.
I'm not sure what you feel is wrong with that concept, but it's a tried and tested approach since XF 1.0 (it works the same for XF attachments).