Bad Urls for diff Image sizes...

Topics: Developer Forum, User Forum
Oct 6, 2007 at 4:59 PM

Hi,

I have a Flickr .NET implementation which works very well, except for two problems. I am using version 2.1.5 of Flickr.NET

1. The large url for photos (PhotoInfo.LargeUrl) always shows a standard white Flickr image which contains text on it reading - "This image is not currently available". It does not matter if the image was uploaded by my app or directly on the Flickr site. Interestingly, this feature is something that was working before and just stopped working one fine summer morning.

2. Can we delete photos through the API? PhotosDelete(PhotoId) does not seem to work.

Any light shed on these problems will be greatly appreciated.

Thanks,
Shiv

Coordinator
Oct 7, 2007 at 3:17 PM
1. It should be fine - are you sure the image being uploaded is large enough to have a large image.

If it still doesn't work then can you tell me the URL that is being used and I will fix it.

2. Should work fine, I will try to check it out.
Coordinator
Oct 7, 2007 at 3:36 PM
Another options is that the user has disabled downloading, or isn't a pro user. There are many reasons why the large image may not be available.
Oct 7, 2007 at 5:51 PM
Hi Sam,

Here is one url that should be working, but doesn't.
http://farm2.static.flickr.com/1059/1461281980c18a9004d4b.jpg

1. I am testing this stuff with my own account and so am sure that I have not turned off downloading, unless it has happened inadvertently. I will check that again.

2. I do not think I am a Pro User. But I was able to view large images until a few weeks ago.

Regards,
Shiv


Coordinator
Oct 7, 2007 at 10:17 PM
Right, this is one of Flickr's little 'features'.

They only produce a particular size of image if the difference between it and the original is large enough.

http://www.flickr.com/photo_zoom.gne?id=1461281980&size=o

Here you can see that your image's largest image is actually the original, and there is no 'large' image (even though it uses the word large on the web page.
Oct 8, 2007 at 1:58 AM

MediumUrl and WebUrl work correctly, but do not meet my requirement.

OriginalUrl throws an exception about "Format information not available" for all images.

Is there any way, I can access the full size or something close to it from my application? I appreciate you taking the time to clarify.

Regards,
Shiv

Coordinator
Oct 8, 2007 at 7:35 AM
You can try adding the request for the original information to your search, but seeing as you are not a Pro user then I don't think this information is available via the API. Your best bet is to use PhotosGetSizes and see what that returns.
Oct 12, 2007 at 6:49 AM

PhotosGetSizes tells me there is a large size and the largeurl is a real url - the problem is it points to a custom Flickr blank image.

My App will be used by any kind of user - I cannot restrict the application for pro users only. There are applications out there doing this - how is that they can see
large images and I cannot?

Regards,
Shiv

Coordinator
Oct 12, 2007 at 7:53 AM
PhotosGetSizes tells you there is what it calls a 'Large' image, but the URL is actually the URL for the original image, not the large one.

The Photo.LargeUrl properties are really just helper methods for getting the URL, it doesn't guarantee that the image exists unfortunately.
Oct 15, 2007 at 4:40 PM
Edited Oct 15, 2007 at 4:41 PM

Thanks Sam, I think I see what's happening though the problem remains unresolved. Unless the image is bigger than a certain cut-off size, a large image will not be generated, which marks the beginning of my woes. In such cases, we need to try and access the original image, but that has limited access. If download is disabled and if the user is not a pro, then it will just not happen.

I peeked into your code and discovered that you are forming the original url from the "original secret" and "original format". But originalformat is an empty string if the user is not a pro or if download is turned off. I am having any kind of user (pro or otherwise) log into Flickr through my app and view images.

a) Once the user logs in, is there an Api call that will have me turn on downloads for that user so that original url will work? I mean something to retrieve the original format?

b) What is the original secret? Who sets it and when? I looked high, middle and low and cannot find an api that allows me to set it.

c) If I - the Api key owner - am a pro user, will it help in anyway?

Thanks,
Shiv





Coordinator
Oct 16, 2007 at 9:11 AM
a) No, you can't change that - it would kinda defeat the purpose of having the setting if an application could just override it.
b) Flickr sets the original secret exactly like they set the normal secret when a user uploads the photo. You can't change it.
c) No, the pro or otherwise setting of the API key owner makes no difference.

The best I can suggest is that you call PhotosGetSizes and use the last (and hence largest) size returned.
Oct 17, 2007 at 4:18 PM

Thanks for all the help Sam. I am resigning myself to the fact that I may not get anything better than a medium size in most cases. Here is what I do now,

1. Look for an original url ( originalformat and originalsecret are not empty).
2. If not, then I look for a large url (does not have a "_o" in the url)
3. If not, settle for the medium url.

Btw, I set authlevel to delete and yet, image delete fails due to lack of permissions. This is not a high priority req, but you may want to check it out sometime.

Thanks again,
Shiv






Coordinator
Oct 17, 2007 at 9:32 PM
I did try delete, and it works fine.

If you've previously authorised it with write permissions can you try unauthorising it (http://www.flickr.com/account/?tab=extend) and trying again.
Oct 18, 2007 at 3:14 PM

Thanks Sam, I will try that again.

How do I sign out of Flickr without closing the session? I am not finding any API for that.

Regards,
Shiv
Coordinator
Oct 18, 2007 at 4:43 PM
You don't need to sign out, just unauthenticate your api key from the list.

The actual link you need is http://www.flickr.com/services/auth/list.gne
Apr 29, 2009 at 4:30 PM
Edited Apr 29, 2009 at 4:42 PM
I know this is a bit old of a thread, but I have had the same problem. I am not sure if anyone posted a solution, but I have an idea. What you could do (takes a little tweaking), is if your original image is greater than 500x500,  you can resize it up proportionally and put it on a 1281x1281 background, so when the image is resized back down to 1024x1024 it looks original, but on a white background. For instance, if someone uploaded an image that is 1024x768, you can resize that image to 1281x1025 (or whatever the math would be), which Flickr would resize back down to 1024x768, but provide you a URL you could actually use without needing the Pro account. I did notice (and this is weird) that Flickr does not resize your image unless it exceeds 1280x1280, so an image 1280x1280 is not resized, but an image 1281x1281 will be resized down to 1024x1024. Hope this helps.

Edit: Basically you need to multiply the width and height of every image by 1.25 + 1 pixel and put it on a 1281x1281 background (if the original image size exceeds 1024 than either width or height just need to be 1281, the lesser can be derived from the formula). I believe this math should be correct and give us what we need.
Jan 23, 2010 at 1:11 PM

Hm, i was also having problems with getting large size images from flickr, but that is mostly because user disabled downloading of large and original images or the original is smaller than large format.

You can check my sollution on my blog: http://shelastyle.net/blog/using-flickr-in-net-applications/