title: Check if image is empty php
body: <p>i'm trying to make a php script to get a user picture but when i the returned image is empty, it should return the standard image. This is the code i have that does not work...</p>
  
  <pre><code>&lt;?php
  if (isset($_GET['user']))
  {
  $user = $_GET['user'];
  $skinURL = "http://s3.amazonaws.com/MinecraftSkins/".$user.".png";
  } 
  $debugImage = imagecreatefrompng("http://s3.amazonaws.com/MinecraftSkins/".$user.".png");
  if (empty($debugImage)) // here it checks if $debugImage is empty (doesn't work)
  {
      $skinURL = 'http://www.minecraft.net/images/char.png';
  }
  $skin = imagecreatefrompng($skinURL);
  ?&gt;
  </code></pre>
  
  <p>any ideas?</p>
  
  <p><strong>edit 1:</strong> The link returns a image if it exists, and nothing if it doesn't exist. Thanks already for the answers!</p>