Handling Large Image Files

Permalink
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...

if ( $f && $f->getAttribute('width')!=0 && $f->getAttribute('width')<3200 && $f->getAttribute('height')<3200 ) {
   //do something
}


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?

Thanks in advance.
C

 
Steevb replied on at Permalink Best Answer Reply 1 Attachment
Steevb
Have you tried setting image options in: ‘System & Settings / Image Options’. See attached.
Chrouglas replied on at Permalink Reply
Haaa! I had no idea that was there. Seems a lot more simple huh :)
Thanks for the tip!

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.