title: PHP/GD - Finding Image Resource Type
body: <p><strong>Having only a valid GD image resource is it possible to find out the type of the original image?</strong></p>
  
  <p>For instance:</p>
  
  <pre><code>$image = ImageCreateFromPNG('http://sstatic.net/so/img/logo.png');
  </code></pre>
  
  <p><strong>Can I get the original image type (PNG) having only the $image variable available?</strong></p>