images

By arievanleyen

I am trying to get a grip on the api and up until now everything runs smoothly.



However, I would also like to get the images that accompany a story. This can be done, but it only returns thumbnails that are so small that you can hardly see them (45x45).



How do I get larger images?



Filed Under:

arievanleyen, The image that

arievanleyen,

The image that is returned with the article also contains a <url> tag that is a link to the larger image - usually these URLs give you a 610pix (for wider pics) or 340px (for vertical pics) wide picture.

 

<article>
    <headline type="str">Obama in Panic Mode, Flip Flops on SPR … Polls a Toss up … Rasmussen & Zogby Have McCain Ahead </headline>
    <image>
        <image_id type="str">0bd2cqc8OcdoQ</image_id>
        <url type="str">http://cache.daylife.com/imageserve/0bd2cqc8OcdoQ/340x.jpg</url>
        <thumb_url type="str">http://cache.daylife.com/imageserve/0bd2cqc8OcdoQ/45x45.jpg</thumb_url>

        <height type="int4">150</height>
        <width type="int4">150</width>

   ............

 

You can also provide a better experience by using the original <width> and <height> of the image. For e.g., the image above was originally 150x150 when it was published. You can replace the 45x45.jpg in the thumb_url by 150x150.jpg to get an image of size that it was originally published in e.g.

http://cache.daylife.com/imageserve/0bd2cqc8OcdoQ/150x150.jpg

 

-- Vineet