how to get information of photos of a photoset

Topics: Developer Forum, User Forum
Jan 14, 2011 at 8:22 AM
Edited Jan 14, 2011 at 8:24 AM

i am sending you code below in which i am retriving information of photos of a photoset
in this i am getting the photo title but photo Description is not coming it is coming blank
and Photo Tags is giving (Tag = System.Collections.ObjectModel.Collection`1[System.String]) , how to solve this can please help me ,how to solve this


As i am coding in c# for windows form aplication

PhotosetPhotoCollection photos = myFlickr.PhotosetsGetPhotos("72157625681762281");

             foreach(Photo photo in photos)
            {
                MessageBox.Show("Title = " + photo.Title);
                MessageBox.Show("Description = " + photo.Description);
                MessageBox.Show("Tag = " + photo.Tags);
            }
Coordinator
Jan 14, 2011 at 10:16 AM

To get the description returned you need to tell Flickr to return it. You do this using the PhotoSearchExtras parameter like so:

PhotosetPhotoCollection photos = myFlickr.PhotosetsGetPhotos("72157625681762281", PhotoSearchExtras.Description);

foreach(Photo photo in photos)
{
    MessageBox.Show("Title = " + photo.Title);
    MessageBox.Show("Description = " + photo.Description);
}

Photo.Tags is a collection, like the error says, so you would need to loop through the tags in the collection, much like you are looping through the photos in the PhotoCollection.

Sam

Jan 14, 2011 at 10:29 AM

Thanks Sam

now i am getting the description if photos of photoset but not getting the photo Tags..

Coordinator
Jan 14, 2011 at 10:34 AM

You need to tell Flickr to return that too. Try change PhotoSearchExtras.Description to PhotoSearchExtras.All to return all extras.

 

Jan 14, 2011 at 10:43 AM

Hi Sam

i have also change PhotoSearchExtras.Description to PhotoSearchExtras.All by this description is coming but tag are not its is giving (Tag = System.Collections.ObjectModel.Collection`1[System.String])

Coordinator
Jan 14, 2011 at 12:31 PM

I've already answered this. Please read my previous posts more carefully.