title: How do I get an atom enclosure image out using Simple Pie
body: <p>I am building an RSS aggregator and trying to handle images from a broad range of sources. </p>
  
  <p>The majority of my sources are using images in the content or media:RSS enclosures.</p>
  
  <p>I have managed to get Simple Pie to pick up enclosures for media:RSS </p>
  
  <p>and also to strip images from the content of an RSS post.</p>
  
  <p>But feeds from a CMS called Silver Stripe have an embedded image in each post with an atom style </p>
  
  <p>notation that I cannot get Simple Pie to read and extract images from.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;link rel="enclosure" type="image/JPG" href="http://example.com/image.jpg" /&gt;
  </code></pre>
  
  <p>Do I need to modify the enclosure class to get this to work or am I missing something, is it </p>
  
  <p>something to do with the namespaces I am using?</p>
  
  <p><a href="http://www.nmit.ac.nz/nmit-news/rss" rel="nofollow noreferrer">Here is one of the feeds I am trying to get</a></p>
  
  <p>I am accessing about 7 other different SilverStipe sites, all of these include the same image links...</p>
  
  <p>Here is my current image script:</p>
  
  <pre class="lang-php prettyprint-override"><code>if ($enclosures = $prPost-&gt;get_enclosures())
      {
          foreach ($enclosures as $enclosure)
          {
              $this-&gt;Fields['image'] = $enclosure-&gt;get_link();
          }
      }
  
      if (preg_match('/&lt;img.+?src="(.+?)"/', $this-&gt;Fields['desc'], $matches) &amp;&amp; strlen($this-&gt;Fields['image']) &lt; 5) {
          $this-&gt;Fields['image'] = $matches[1];
          $this-&gt;Fields['desc'] = preg_replace('/&lt;img(.*)&gt;/i' , "" , $this-&gt;Fields['desc'], 1); 
      }
  </code></pre>