title: getimagesize() returns false on some images
body: <p>I'm running <code>getimagesize()</code> to determine whether or not an uploaded file is a valid image and also it's MIME type. A user of my webapp reported that some of his images where getting an "invalid filetype" error after uploading them. So I asked him to send me some of them to check.</p>
  
  <p>The error string itself is meaningless as it's just a generic text written by me when the functions fails (returns <code>FALSE</code>). I tried increasing PHP's memory limit with no success. Also, logs don't show anything unusual. Is there a problem with the files or is it something else? is there a better way to do this operation?</p>
  
  <p>I'm accepting any file that <code>getimagesize()</code> accepts (meaning it has a width/height), I'm just checking that it doesn't return <code>FALSE</code> (although my real scope would be jpg|jpeg|png|gif|bmp|tif|tiff). The server is running PHP/5.2.6-1+lenny3. I repeat, this happens only with the image linked and some others from the same series, so I'm more inclined to think it's related to what Lizard is hinting.</p>
  
  <p><code>$_FILES</code> seems to be empty before getting to <code>getimagesize($_FILES['Filedata']['tmp_name'])</code> so the file is never really checked. I'll have to figure out why these files are not submitted like the rest (too big for PHP perhaps? any ideas?).</p>