sfu-dhil / wphp

Women's Print History Project database front end.
https://womensprinthistoryproject.com/
GNU General Public License v2.0
1 stars 8 forks source link

Constrain image upload size #339

Open joeytakeda opened 1 year ago

joeytakeda commented 1 year ago

Images uploaded in TinyMCE don't seem to be bound by any file size constraints; we should add some constraints as I don't think there are any cases where a file uploaded in TinyMCE will need to be large (i.e. no images, etc). Probably 3MB is more than enough, but we should look through the current uploads and see what the ranges of sizes are.

andrew-gardener commented 1 year ago

~95% of images are under 3MB Of the ~5% that are over, most are between 3MB and 12MB. There are 2 at 65MB.

I think it's reasonable to rather add a 3MB upload limit or automatically reduce filesize server side for web (with the former being much easier).

joeytakeda commented 1 year ago

Thanks @andrew-gardener for getting those ranges! Yes, I think a simple constraint will be a bit easier and safer (we could always provide a link to something like Sqoosh so that uploaders could be control how they want the image to be compressed)