I'm running into a problem where a particularly huge image is causing my VPS server to reboot because of memory issues. The configuration of this is out of my hands, it's sort of like the host's failsafe.
I have a VPS with 300M memory, which I believe is sufficient for my WordPress installation, at least with day-to-day operations.
The image I am uploading isn't particularly big in file size (~380 kb) and is mostly black with white letters. However, its resolution is 4583 * 4583. When I upload it through WordPress, I get an HTTP error in the upload window, and when I go check the live site, it's down for a couple of minutes.
I was wondering if it's possible to detect an images resolution and prevent it from being uploaded. I'm clever enough to mess around a bit in an image processor, but some of my authors may not be savvy enough to process the image before they upload something as big as this.
It would be even better if the limitation could be based on the images bits-per-pixel, but I have no idea what my server's limit is for this, so I guess an error message saying the image can't be uploaded because it's larger than, say, 2000 * 2000 is enough.