This project has moved and is read-only. For the latest updates, please go here.

PhotosGetSizes takes too long

Topics: User Forum
Mar 18, 2010 at 12:20 AM

Hi All,

I have PhotosGetSizes within a foreach loop and it takes about a minute for my application to display 50 photos. While it's extremely convenient to use PhotosGetSizes to findout which photo sizes I may download, that's far too much time spent on it, plus I can't really have it somewhere else other that the aforementioned foreach loop. Just wondering if anyone else has had a similar problem or figured out a workaround for it.


Mar 19, 2010 at 1:21 PM

The Flickr API imposes a rough limit of 1 query per second on developers. Obviously this is spread over a week, or even a month, so quick bursts are allowed.

I've tried calling PhotosGetSizes 50 times and it seems to take me about 10 seconds, so I'm surprised its taking you so long.

I've also just checked in a new change which allows you to request the image urls along with the search results:


PhotoSearchOptions o = new PhotoSearchOptions();
o.Extras = PhotoSearchExtras.AllUrls;
o.PerPage = 50;
o.Tags = "test";

PhotoCollection photos = f.PhotosSearch(o);

foreach(Photo p in photos)
  if( p.DoesLargeExist )
    Console.WriteLine("Large image doesn't exist.");
  if( p.DoesMediumExist )
   Console.WriteLine("Medium image doesn't exist.");



Mar 26, 2010 at 2:01 AM

Thanks for your reply. It is rather strange. The problem's obviously at my end. I've been trying to optimise my code as much as possible, haven't experienced any change in the delay yet. I'm going to try out the new version, see how it goes.

Apr 13, 2011 at 8:00 PM

Hey Sam,

DoesLargeExist always seems to return false despite there being a largeurl available for example with

Is it a bug or am I missing something?

Thanx in advance.

Apr 15, 2011 at 11:01 AM

I think Flickr recently changed their criteria for when they generate a 'large' image (at the same time as they introduced the Medium 640 image size). However this is not a retrospective change as older photos of that size would not have a large image but newer ones will.

Your best bet is to always ask for the LargeUrl extra to be returned, then you will always get a truthful answer to the question.


Apr 16, 2011 at 12:54 AM
Edited Apr 16, 2011 at 12:55 AM

Thanks for the response Sam but I don't understand your suggestion.  What do you mean by "... ask for the LargeUrl extra to be returned..."?

Also, might we be fortunate enuf to see an update anytime soon that resolves this issue?  :D


Apr 16, 2011 at 8:32 AM

As in the above example, you specify PhotoSearchExtras.AllUrls or PhotoSearchExtras.LargeUrl as part of your search, and then photo.LargeUrl will be returned by Flickr if it exists. The DoesLargeExist property always checks this value first and returns true if it exists.