Validate an image in PHP
<p>I'm using GD to create jpegs from files that a user uploads.</p>

<p>What is the best way to validate that the image the user has uploaded is valid?</p>

<p>By valid I mean that the file is not a corrupt image that GD won't like, I do extension testing client side so they can only upload jpegs/gifs/pngs.</p>

<p>Thanks</p>
