Hi all. I have several sites that require larger upload limits to be set on the server in order to allow for video and audio file uploads. The problem is that I am constantly having to fix my client's image file sizes. I found a 12,000 x 7000 pixel file they were trying to upload for use as a thumbnail. This causes the server to through a Internal Server Error trying to process the image. Anyway, I wanted to figure out a way to guard against this and came up with this...
I included the zero width check because it seems that some uploads are small enough to upload but too large to give the image a height and width property and as a result defaults to 0.
My question I guess is, is this the best way to do it? Am I missing something?
This website stores cookies on your computer. These cookies are used to improve
your website experience and provide more personalized services to you, both on this website and through
other media. To find out more about the cookies we use, see our Privacy Policy.