How to have a "no image found" icon if the image used in the function returns an error?
<p>In my application I use timthumb for resizing images. Those images are not controlled by me because I get them from RSS feeds. Sometimes the image are not shown in my page. When I examine the entire link with the timthumb I get this</p>

<blockquote>
  <p>Warning: imagecreatefromjpeg(http://www.domain.com/image.jpg)
  [function.imagecreatefromjpeg]: failed to open stream: HTTP request
  failed! HTTP/1.1 404 Not Found in /timthumb.php on line 193 Unable to
  open image : <a href="http://www.domain.com/image.jpg" rel="nofollow">http://www.domain.com/image.jpg</a></p>
</blockquote>

<p>So, I am looking for a way to know when an image returns an error, so that I will not display it on page ( the red X icon).</p>

<p>From my RSS feeds, I use regex to get the first image</p>

<pre><code>if (thumb[0]) { show the image using timthumb } 

else { show a no-image icon } 
</code></pre>

<p>but the example above falls into the "show the image using timthumb".</p>

<p>This is a paste from my code
<a href="http://codepad.org/7aFXE8ZY" rel="nofollow">http://codepad.org/7aFXE8ZY</a></p>

<p>Thank you.</p>
