image upload can harm the server
Description
When uploading image, some image can make the server abort and raise no message to the user.
Steps to Reproduce
- go to the page of group you administrate
- upload a big image in banner or avatar
- click "update group"
Expected behaviour:
group avatar or banner is updated and a green message "group settings saved" is displayed
Actual behaviour:
nothing is displayed, settings are not updated, server has been busy for minutes and failed.
Reproduces how often:
100%
Versions
1.2.3
Additional Information
I can reproduce that on mobilizon.fr and on keskonfai.fr (on keskonfai.fr, with smaller images as the server is less beefy than mobilizon.fr one).
This is due to "convert" utility that takes 100% CPU for a long time until timeouted.
This is due to the fact that some big pictures (4000x2000) can be compressed until a size that is under the upload limit. But are still big in RAM and process time.
I suggest to first check the geometry (width x height) and reject images that are too large with a clear error message to the user.