Photo.OriginalUrl shows "This Photo is currently Unavailable"

Topics: Developer Forum, User Forum
Feb 28, 2007 at 9:38 PM
Edited Feb 28, 2007 at 9:39 PM
Hi everyone,

I am trying to retrieve the originalUrl for a Photo object. However, I get the "This Photo is currently unavailable" photo instead.

I have the following code:

FlickrNet.PhotoSearchOptions psoOptions = new FlickrNet.PhotoSearchOptions();
psoOptions.PerPage = 100;
bool bDone = false;

for(int j=1;;j+=1)
{
psoOptions.Page = j;
FlickrNet.Photos oPhotos = FlickrWrappr.Instance().GetPhotosForCurrentUser(psoOptions);

if(oPhotos.PhotoCollection==null||oPhotos.PhotoCollection.Length==0)
{
bDone = true;
break;
}
else
{
foreach(FlickrNet.Photo oPhoto in oPhotos.PhotoCollection)
{
if(oPhoto.PhotoId==sFlickrImageId)
{
sReturn = oPhoto.OriginalUrl;
bDone = true;
}
}
if(bDone)
break;
}
}

and

public FlickrNet.Photos GetPhotosForCurrentUser(FlickrNet.PhotoSearchOptions psoOptions)
{
string sMsg=string.Empty;
try
{
Flickr.FlushCache();
psoOptions.UserId = sCurrentUser;
psoOptions.Extras = PhotoSearchExtras.All;
return flickr.PhotosSearch(psoOptions);
}
catch (Exception ex)
{
sMsg = "FlickrWrappr.GetPhotosForCurrentUser(): Error Occurred trying to perform
Photo search(psoOptions = "psoOptions.ToString()").\nThe error was:\n"
+ ex.Message;
SM.Configuration.Instance().WriteLogEntry( sMsg, EventLogEntryType.Error);
throw new Exception(sMsg,ex);
}
}

my code returns the following url:
http://static.flickr.com/150/4059570016aa7ca748fo.jpg

when i log into my account on flickr, I get the following URL:

http://farm1.static.flickr.com/150/4059570018ff0ae5cb1o.jpg

I am able to see the Original photo from my account using the above url, however, I cannot see the photo at the first url, which is the url that my code returns.

Am I missing something?

Your assistance in this matter is appreciated,

Regards,
Maciek
Mar 21, 2007 at 2:11 AM
I've been encountering the same problem too since the other day. I thought it was Flickr that somehow made the original photos unavailable for now.
Apr 3, 2007 at 10:22 PM
I have also been facing the same issue. Does anyone know what the cause is?
Apr 10, 2007 at 2:31 AM
The problem is in the fact that the original url's are now constructed differently.
see http://www.flickr.com/services/api/misc.urls.html.
There is no fix in Flickr.Net for this as far as I know now. You need to obtain a originalsecret value (different from normal secret value) to construct the url.
Coordinator
Apr 10, 2007 at 10:35 AM
If you download the latest source that should work fine.

I'll try and get a proper release out soon.
Apr 26, 2007 at 12:10 PM

samjudson wrote:
If you download the latest source that should work fine.

I have tested the Photo.OriginalUrl still unavailable.
May 2, 2007 at 7:56 PM
Yeah, it still looks like it just appends the _o in the standard url.

return Utils.UrlFormat(this, "_o", OriginalFormat);
May 7, 2007 at 10:00 PM
Ahh, entirely my fault, sorry...

You have actually fixed this, it was just not where i whas looking. Thanks...
Coordinator
May 8, 2007 at 10:13 AM
Yeah, it works out whether to use the original or normal secret inside the Utils.UrlFormat method. Glad you worked that out (and I can't remember why I didn't reply earlier, sorry).
Jul 17, 2007 at 5:54 PM
Sorry ...but I still don't get what the process is from this thread? I need the original url from a photo, but photo.originalurl gives me the flickr unavailable image.

Can someone post a code example.

Sorry if this is blatantly obvious :)
Coordinator
Jul 25, 2007 at 9:38 AM
Try downloading the latest release, 2.1.4. If that doesn't work then get back to me.
Aug 6, 2007 at 8:03 PM
Don't forget that if you do not have a Flickr Pro account,
you will NEVER have access to the Original URL,
since only Pro accounts have access to the Original file...

For my App I do a switch statement to determine which one
to download depending upon the user's account status...
(Original) for Pro
(Large) for regular

Hope that helps

-Tim
Oct 20, 2007 at 7:18 AM
Hi,

I have facing a similar kind of problem with Flickr large image url, but with a different behaviour. Some of the images are shown in thumbails and when enlarging I am able to see the large images also. But for some images thumbnail show flickr's "unavailable image" icon. Also cannot see the large image either when enlarging such thumbnails.

Please visit
http://mecanbe.com/goals/1.aspx

I am using highslide for enlarging photos.

http://static.flickr.com/1058/1069494526_13de0b5421.jpg,
this is the image I can see in both in thumbnail and large formats

http://static.flickr.com/1230/1485987794d4631d91a5o.jpg
this the area where i am getting the "unavailable" image,

please help!

regards,
N
Nov 30, 2007 at 3:19 AM
I just downloaded the latest version 2.1.5.19851 and the thumbs come up fine, using the SquareThumbnailUrl property in the PhotoCollection. I and am trying to use the LargeUrl to display the full size image, with a regular (no pro) account. I am receiving a This photo is currently unavailable message. Any help would be appreciated.

Thanks,
Doug
Nov 30, 2007 at 2:55 PM


dbowman wrote:
I just downloaded the latest version 2.1.5.19851 and the thumbs come up fine, using the SquareThumbnailUrl property in the PhotoCollection. I and am trying to use the LargeUrl to display the full size image, with a regular (no pro) account. I am receiving a This photo is currently unavailable message. Any help would be appreciated.

Thanks,
Doug


Hi dbowman,
I have used the following code in my application (C#) and got rid of this problem.

img.ImageUrl = item.SquareThumbnailUrl;
mediumURL.Value = item.MediumUrl;

//---- synrtax ---------
http://farm{farm-id}.static.flickr.com/{server-id}/{id}{secret}mstb.jpg

//---- example ---------
//http://farm1.static.flickr.com/2/14188781e92283336m.jpg


//---- code ---------
string orgStr = "http://farm" + item.Farm + ".static.flickr.com/" + item.Server + "/" + item.PhotoId + "_" + item.Secret + ".jpg";

Also, please check if you have
FlickrNet.dll and FlickrNetCF.dll

in your Bin folder

For reference you can visit
http://mecanbe.com/users/jay74/default.aspx
Click on any image for preview. you will find the actual url being used with all large images

let me know if it helps

regards
N
Coordinator
Nov 30, 2007 at 3:59 PM

dbowman wrote:
I just downloaded the latest version 2.1.5.19851 and the thumbs come up fine, using the SquareThumbnailUrl property in the PhotoCollection. I and am trying to use the LargeUrl to display the full size image, with a regular (no pro) account. I am receiving a This photo is currently unavailable message. Any help would be appreciated.

Thanks,
Doug


All the SquareThumbnailUrl, ThumbnailUrl, MediumUrl, LargeUrl and OriginalUrl properties do is to use the current photo information (i.e. its photo id, server, farm and secret) to guess the photo URL. There is no guarantee that that particular size actually exists - this will depend on the size of the original file uploaded to Flickr.

Use the Flickr.PhotosGetSizes to get the complete list of every file and size held by Flickr.
Nov 30, 2007 at 5:08 PM
Thanks to both of you. I figured out how to reference the medium size image. I will also try PhotosGetSizes.


Thanks,
Doug