Easiest way to Display Original size if Large is Unavailable

Topics: Developer Forum, User Forum
Jul 23, 2008 at 6:49 PM
Edited Jul 23, 2008 at 6:51 PM
I'm creating a WPF app and displaying the smallUrl, which mostly exist. Sometimes the smallurls appears all white but I think that might be it still downloading or timed out?
When I click on a small picture I display the largeUrl. Sometimes I just get that standard flickr image, and I would rather have it try to show me the original size. I just have the xaml display the photos.largurl. It would be possible maybe to call photos.getsizes during the search for each photo and if the largurl doesn't exist I could stick the original link into the largeUrl link. Or I could call the getsizes in the xaml, but that would be a little harder I think. I don't suppose there is a method for this already? It seems like it would be a common problem.

Edit: Just found out the LargeUrl is readonly...
Jul 24, 2008 at 9:55 AM
This is something I've been considering for a while - so I've just added a new property to the Photo class - DoesLargeExist. You need to return the original dimensions for it to work.
Jul 25, 2008 at 5:22 PM
I suppose that won't be available to your next release? I was able to get around it for downloading the largest size available by the following lines, which work, but are a bit awkward.

Sizes sizes = m_Helper.GetSizes(Photo.PhotoId);
client.DownloadFile(sizes.SizeCollection[(sizes.SizeCollection.Length - 1)].Source, m_strDirectory + "\\Images\\" + Photo.PhotoId + ".jpg");
Jul 26, 2008 at 10:17 AM
Edited Jul 26, 2008 at 10:33 AM
I have already included the code in the latest source code - I just need to get around to doing a full release (something that is long overdue).

Also, you have a FLickrHelper class there that does GetSizes()? The Flickr class has that function you know, Flickr.PhotosGetSizes()

Jul 28, 2008 at 9:28 PM
Right, GetSizes uses Flickr.PhotosGetSizes(). I might change it to use it directly, but it works ok for now I think.