title: Efficiently detect corrupted jpeg file?
body: <p>Is there an efficient way of detecting if a jpeg file is corrupted?  </p>
  
  <p>Background info:<br>
  &nbsp; solutions needs to work from within a php script<br>
  &nbsp; the jpeg files are on disk<br>
  &nbsp; manual checking is no option (user uploaded data)  </p>
  
  <p>I know that <code>imagecreatefromjpeg(string $filename);</code> can do it. But it is quite slow at doing so.</p>
  
  <p>Does anybody know a faster/more efficient solutions?</p>