smugmug.images.get&Extras intermittent problem
jiminy
Registered Users Posts: 10 Big grins
I have been using images.get&Extras to return a subset of the urls for images in a gallery( i.e. the thumb and medium urls ), then I download the images using those urls. This generally works fine, but sometimes when trying to download the image, I am returned a zero length content length.
This is intermittent and appears to go away if I simply retry the download a couple of times.
Is this an expected behavior or is there something that I should be doing differently to avoid the random zero length download responses?
thanks
Jim
This is intermittent and appears to go away if I simply retry the download a couple of times.
Is this an expected behavior or is there something that I should be doing differently to avoid the random zero length download responses?
thanks
Jim
0
Comments
#link removed# (see my next message)
When I view the above page, I get broken links for the thumbnails and when I click on the links to view the medium image, it displays a blank page -- but here is the kicker, this seems to only happen with links to images in my smugmug account. I have tested with friends' smugmug accounts, and the thumbs and medium size image links work as expected.
I suspect that if anyone else tries to view the above page they will see the thumbs and can click to view the medium images.
I know the URLs are valid because if I manually try using them directly, after awhile I can get the medium image or thumbnail to display.
Is there some kind of security at play here on the Smugmug side? Has anyone encountered this before?
If so, it makes sense that the thumbs and medium images are not displaying.
However it appears that Smugmug hiccups from time to time and actually allows the images to display.
What I did notice when it happened was that the urls to the images appeared to take some time to become valid. If I retried getting an image that returned a zero length content length immediately, it usually failed. But if I waited about 30 seconds then it generally worked.
The urls are the permanent links to your images so they will always be valid, but not if external links are off and you are attempting to view the images "external" from smugmug.
Hope this helps.
The API fully supports downloading any and all images (including those in galleries with external links off) as long as you log-in as "owner" and do the following (based on API 1.2.2):
I am working on an iPhone app where the user is logged on to their account. The code is using objective C to download the images. It isn't using flash, so I'm not sure that the crossdomain.xml file comes into play.
I always send the SessionID that was returned from the smugmug.login.withPassword call on subsequent calls to smugmug.images.get&Extras. I think that should work equally well as sending the SMSESS cookie if I understand the documentation properly and in fact it works perfectly 99% of the time.
I tried setting the Sandboxed=1 to see if it alters any of the urls returned, but everything looks the same. I notice that each request for an image is always redirected by the smugmug server from an url like www. smugmug. com/photos/ to photos. smugmug. com/ photos/.
I'm speculating that possibly the redirected to url is not always valid immediately, hence I get back a content length of zero sometimes. However at the moment it is all working just fine without any hiccups, so I can't really test it to see what is happening.
Here are the relevant traces copied from the packet sniffer:
... initial request… at 5.6 seconds
GET /photos/761109707_oJVxL-Th.jpg HTTP/1.1..Host: photos.smugmug.com..User-Agent: SyncPhoto/1.0.0 CFNetwork/459 Darwin/10.2.0..Accept: */*..Accept-Language: en-us..Accept-Encoding: gzip, deflate..Cookie: shott=[removed]; SMSESS=[removed]; snapp=[removed]..Connection: keep-alive....
... redirect from server...
HTTP/1.1 301 Moved Permanently..Date: Sun, 10 Jan 2010 04:01:03 GMT..Server: Apache..X-Powered-By: smugmug/1.2.0..X-SmugID: 27.27.207..Location: http:// photos.smugmug.com/photos/761109707_oJVxL-Th.jpg..Content-Length:0..Keep-Alive: timeout=5, max=866..Connection: Keep-Alive..Content-Type: text/html; charset=utf-8....
... redirected request to the new url provided above by the server...
GET /photos/761109707_oJVxL-Th.jpg HTTP/1.1..Host: photos.smugmug.com..User-Agent: SyncPhoto/1.0.0 CFNetwork/459Darwin/10.2.0..Accept: */*..Accept-Language: en-us..Accept-Encoding: gzip, deflate..Cookie: shott=[removed];SMSESS=[removed]; snapp=[removed]..Connection: keep-alive..
... 404 error file not found ...
HTTP/1.1 404 Not Found..Content-Type: text/html; charset=UTF-8..Server: Apache..X-Smug-Phone: 0.17453002929688..Content-Length: 0..Date: Sun, 10 Jan 2010 04:01:04 GMT..Connection: keep-alive..Vary: Accept-Encoding....
... 50 seconds later - first request...
GET /photos/761109707_oJVxL-Th.jpg HTTP/1.1..Host: www.smugmug.com..User-Agent: SyncPhoto/1.0.0 CFNetwork/459 Darwin/10.2.0..Accept: */*..Accept-Language: en-us..Accept-Encoding: gzip, deflate..Cookie: shott=[removed]; SMSESS=[removed]; snapp=[removed]..Connection:keep-alive
... redirect from the server ...
HTTP/1.1 301 Moved Permanently..Date: Sun, 10 Jan 2010 04:01:53 GMT..Server: Apache..X-Powered-By: smugmug/1.2.0..X-SmugID: 27.160.12..Location:http://photos.smugmug.com/photos/761109707_oJVxL-Th.jpg..Content-Length: 0..Keep-Alive: timeout=5, max=893..Connection: Keep-Alive..Content-Type: text/html; charset=utf-8....
... request to redirected url provided above ...
GET /photos/761109707_oJVxL-Th.jpg HTTP/1.1..Host: photos.smugmug.com..User-Agent: SyncPhoto/1.0.0 CFNetwork/459Darwin/10.2.0..Accept: */*..Accept-Language: en-us..Accept-Encoding: gzip, deflate..Cookie: shott=[removed];SMSESS=[removed]; snapp=[removed]..Connection: keep-alive..
... successfully retrieved the file and begins download...
HTTP/1.1 200 OK..Content-Type: image/jpeg..ETag:83432a8631d309e6ac1b8aecd0346222..Last-Modified: Sun, 10 Jan 2010 03:59:50 GMT..Server: Apache..X-Powered-By: smugmug/1.3.0..X-Robots-Tag: noarchive, noindex, nosnippet..X-Smug-Phone: 0.099683046340942..Content-Length: 10423..Cache-Control: public, max-age=31708800..Expires: Wed, 12 Jan2011 04:01:53 GMT..Date: Sun, 10 Jan 2010 04:01:53 GMT..Connection: keep-alive.
001a0 0a 0d 0a ff d8 ff e0 00 10 4a 46 49 46 00 01 01 .........JFIF...
[Mod edit] removed specific cookie values, please be careful about what cookie data you post online
We are currently investigating an intermittent issue (basically what you described) with relation to password protected galleries or galleries within passworded protected sites and potentially having the 'External Links' option set to NO.
Cheers,
David
SmugMug API Developer
My Photos
Thanks,
David
SmugMug API Developer
My Photos
I'll post here if it seems to be happening again.
thanks
Jim
David or anyone, I'm back to playing around with this. I'm trying to generate a web page of thumbnails and have requested smugmug.images.get with both Sandboxed=1 set and not set. I see the URL changes when setting Sandboxed, but I can't figure out how to get the images to display in the browser.
I'm doing the smugmug.images.get via the API 1.2.2 on the web server (after logging in as owner), generating a list of img src links. The web browser then attempts to display the images and I just get broken links. I'm trying to figure out how to set the SMSESS cookie as the GET request is coming from the end users web browser, not my web server.
Any hints or tips that would help me get the thumbnails to display on my third party website for a user logged in via my script?
http://api.smugmug.com/services/api/rest/1.2.1/?method=smugmug.categories.get&SessionID=xxxxxxxxxxxxxxxxxxxxxxxxxxxx
juergen@sentiam.com
http://fotoflot.com
Thanks for the idea. Now to see if I can come up with a good solution based on it!
Using 1.2.2 API
1) Login to smugmug as account owner (via phpSmug)
2) Make an API request (via curl) to set the SMSESS cookie (confirmed working)
3) Request image (via curl) to display
Results:
Images in External=yes galleries are displayed correctly.
Images in External=no galleries get 404 errors.
I'm still trying to figure out how to get the external=no images to display without 404 errors.
I would love it if devbobo or someone else who is very familiar with this could take a look at my logic and provide feedback.