Loading thumbnail sprites from an XML file in Quicktime Part 2

In Flickr each image tag has an associated RSS feed automatically generated from a URL with the following structure:

http://www.flickr.com/services/feeds/photos_public.gne?tags=###&format=rss_200

where ### is your search tag.

So to do a search for “factory” I take the string “http://www.flickr.com/services/feeds/photos_public.gne?tags=” and add it to the contents of the text box and then add “&format=rss_200″ to the end. This give me the URL of the feed. I then use the “LoadQTListFromXML” command to load it into the movie. The RSS file is structured as below, it has a lot of information for each picture.



    
        
         http://www.flickr.com/photos/         A feed of factory - Everyone’s Tagged Photos
         Fri, 24 Sep 2004 23:05:08 PST         Fri, 24 Sep 2004 23:05:08 PST
        http://www.flickr.com/
        
            http://flickr.com/buddyicons/0@N0.jpg
            
             http://www.flickr.com/photos/         
        
            
             http://www.flickr.com/photos/42039133@N00/560315/             <img src="http://www.flickr.com/photos/560315_ac00de7218_m.jpg"
            /><br />I’m not sure whether the quotation marks
            add to the effect, or detract from it.

             Fri, 24 Sep 2004 23:05:08 PST             nobody@flickr.com (several_bees)
                         length="16472" type="image/jpeg" />
        

        
            
             http://www.flickr.com/photos/rae/547742/             <img src="http://www.flickr.com/photos/547742_555b39e9fb_m.jpg"
            /><br />Watching the precious bottles of Cascade beer get packaged up.

             Thu, 23 Sep 2004 23:30:10 PST             nobody@flickr.com (Raelene)
                         length="17794" type="image/jpeg" />
        

        
            
             http://www.flickr.com/photos/rae/547738/             <img src="http://www.flickr.com/photos/547738_9b3371cb06_m.jpg"
            /><br />Apparently this cat lives at the Cascade factory. It was there the last time
            Tony visited.

             Thu, 23 Sep 2004 23:29:40 PST             nobody@flickr.com (Raelene)
                         type="image/jpeg" />
        

        
            
             http://www.flickr.com/photos/rae/547736/             <img src="http://www.flickr.com/photos/547736_b821d44133_m.jpg"
            /><br />The Cascade beer brewery in Tasmania. Yum!

             Thu, 23 Sep 2004 23:29:09 PST             nobody@flickr.com (Raelene)
                         type="image/jpeg" />
        

        …
    

If you compare this with the previous XML example you can see some similarities. Where I have the whole list surrounded by the tags, the RSS list is surrounded by and tags. Where I have each clip name surrounded by the tag, the RSS list has each item surrounded by the tags. Within the tag there is more information and it is more structured. For locating the images, the important URLs can be found in the…

Ok I just realised it would have been much easier to find the image details from in the enclosure tag, but I used the description tag. I’ll change this next version. Anyway…

For each item, there is a url for a medium sized jpg image. After some quick snooping around I found that the images are coded with a letter to describe their size. For example here is an image from DocManhattan’s Flickr photostram showing the various sizes and their urls (note the how only the last letters change):


http://www.flickr.com/photos/550041_75d3362292_s_d.jpg


http://www.flickr.com/photos/550041_75d3362292_t_d.jpg


http://www.flickr.com/photos/550041_75d3362292_m_d.jpg


http://www.flickr.com/photos/550041_75d3362292_d.jpg


http://www.flickr.com/photos/550041_75d3362292_o_d.jpg

The RSS points to the “m” sized image but what I need is the “t” thumbnail sized version so I remove the last few letters and add “t_d.jpg” to the end.

This post is getting really long so I’ll continue with part 3 soon. Please leave a comment if I need to explain anything more clearly.

0 Responses to “Loading thumbnail sprites from an XML file in Quicktime Part 2”


Comments are currently closed.