Photo size in bytes

Topics: Developer Forum, Project Management Forum, User Forum
Aug 17, 2008 at 6:05 PM

I'm sorry if that's a trivial question, but is there a way to check the size (in bytes!) of a photo (small, medium, large, thumb, original...) and it's width and height without downloading it and doing it locally?

Thank you in advance!

Aug 18, 2008 at 8:06 AM
No, unfortunately there isn't. There isn't going to be a huge difference in the size of the thumbnail images though I shouldn't imagine.

Aug 18, 2008 at 12:47 PM


But I needed the actual size of the largest photo available... =/

But that's ok! I'll work around it.

Thank you for the reply!


Jan 28, 2010 at 9:30 PM


I am developing a C# application that downloads 100 images from flickr. The problem is its taking around 7-10 mins to download all.

Is there anyway I can download those images that are of minimal size ?



Jan 28, 2010 at 9:42 PM

What do you mean by 'minimal size'? You can download the medium or small size for each photo, but there is no way of searching based on the file size of the photo.

Jan 28, 2010 at 10:51 PM

Thanks for your reply.

How would I choose 'small' size for a photo? I do not see PhotosGetSize class in the library. This is what I am doing to download images.





searchOptions_2.Page = 2;

<font size="2">

searchOptions_2.SafeSearch =




// Filtering Inappropriate Images

<font size="2">





microsoftPhotos_2 = flick.PhotosSearch(searchOptions_2);<font size="2">





allPhotos_2 = microsoftPhotos_2.PhotoCollection;


<font size="2">




foreach (Photo photo in


inputStream = flick.DownloadPicture(photo.LargeUrl.ToString());

<font size="2">

bufferedInput =


new System.IO.BufferedStream(inputStream);<font size="2">

outputPath =


"My Path";<font size="2">

fileOutputStream =


new System.IO.FileStream(outputPath, System.IO.FileMode.Create);<font size="2">



while ((read = bufferedInput.Read(buff, 0, len)) > 0)

           fileOutputStream.Write(buff, 0, read);




Jan 29, 2010 at 9:40 AM

Firstly, you'd use Photo.SmallUrl rather than Photo.LargeUrl.

Secondly, you might find your code is easier if you use WebClient to download the photos, rather than Flickr.DownloadPicture - one line replaces about 20 lines in your example above.


WebClient.DownloadFile(photo.SmallUrl, outputPath);


Jan 29, 2010 at 7:45 PM

Thanks Sam. I appreciate your help.

My one other requirement is to make sure I download only high quality images. How can I achieve this ?

Jan 30, 2010 at 12:37 PM
suren159 wrote:

Thanks Sam. I appreciate your help.

My one other requirement is to make sure I download only high quality images. How can I achieve this ?

What do you mean by high quality.  And if it is it probably isn't going to be the smaller image.

Feb 2, 2010 at 2:36 PM

Yes.. You are right. I have fixed it. Thanks for helping me out. I have another question.

Ho do I search for images as per creative commons license ?

Feb 3, 2010 at 8:30 AM

You need to use the PhotoSearchOptions.AddLicense method to add the licenses you want to include in the results.

PhotoSearchOptions o = new PhotoSearchOptions();
o.Tags = "microsoft";
o.Extras = PhotoSearchExtras.License;