Thumbnail image for category, sub-category and gallery?
jfriend
Registered Users Posts: 8,097 Major grins
Is there any way using the API to get the thumbnail image for a category, sub-category and gallery?
--John
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
0
Comments
How would you like to retrieve this information? One call to get all thumbnail data for all categories/sub-cats/galleries or on per container basis?
http://msphoto.smugmug.com
http://twitter.com/tasmanic
The featured thumbnail seems like a piece of data that should also be in smugmug.albums.getInfo (since it's metadata about the gallery) and smugmug.categories.get and smugmug.subcategories.get (since it's data about those too), but if it was only in those last three functions it would be extremely inefficient for me to fetch it that way for my use because I'd have to make one API call for every single gallery/category/sub-category on a user's site which would take a long time and not be very efficient for Smugmug either.
A work-around could be built using the random thumbnail I guess, but retrieving a random thumbnail doesn't perform very well because it's two roundtrips (and some of your server time) for every single image call (one to request the random image and the second to re-fetch the image redirect that it returns) so it's pretty easy to see how slow random images fill in. For that reason, I try to always feature a photo in my galleries so the category pages don't seem slow to show images. I'd like to avoid that same slowness issue on my sitemap page.
And, of course, the random thumbnail URL doesn't return the featured photo thumbnail when that has been specified. And, it returns an empty gallery thumb for password protected galleries (even when an image is featured) which is certainly not desirable.
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Why are you using smugmug.albums.get to build a site map ? It seems that using smugmug.users.getTree would be more efficient for that task, since cat/subcat information isn't duplicated for every album like it is with smugmug.albums.get and you don't have to manually construct the hierarchy.
Using smugmug.users.getTree, you could that randomly select a highlight image from one of the galleries contained within a category or subcategory.
Cheers,
David
SmugMug API Developer
My Photos
I'll experiment with random images, but that isn't really my preference and it doesn't work for password protected galleries (even when a thumb has been featured).
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
An alternative would be to have the featured photo always by calling the album's URL with an additional parameter of featureImage=true which would return the feature image instead?
Kind of a hack but it would be nice to get details on the feature image on the smugmug.albums.get call.