feedatom-feed

Displaying images in atom feed


I have problems with displaying images in atom file. It doesn't include images in feed in google reader, opera or firefox.

As a starting point I did everything like in Listing 6. at [An overview of the Atom 1.0 Syndication Format] But it doesn't work.

Update It is not problem with hotlink protected images. Described here: How to display item photo in atom feed?

Later I changed feed according to description posted here.

I added:

<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="path_to_image.jpg" />

But still it doesn't work


Solution

  • I had the same problem when trying to include images as enclosure, but it seemed that the easiest way for me was to include the image with the normal img tag to the html content.

    (It's also wrapped in CDATA, which might affect the way Google Reader handles the content. I haven't tried without.)

    The following example works for me to make atom feed images visible in Google Reader:

    <content type="html">
      <![CDATA[
        <a href="http://test.lvh.me:3000/listings/341-test-pics?locale=en">
          <img alt="test_pic" src="http://test.lvh.me:3000/system/images/20/medium/test_pic.jpg?1343246102" />
        </a>
      ]]>
    </content>