What about those new image URLs

jfriendjfriend Registered Users Posts: 8,097 Major grins
Have the results from smugmug.images.get changed at all due to the new form of image URLs that were just introduced? Are they going to change?

They use to look like this:

http://jfriend.smugmug.com/Kenya/Highlights/Animals/JLF5194/344289826_fYUVP-X2-1.jpg

and now they look like this for new images:

http://friend.smugmug.com/Sports/Palo-Alto-Rowing-Club-2011/KevinF/i-xbQPMBK/0/L/rowing-20110415145150_7511-L.jpg

Filename is different.
ImageID is different.
Version is in a different place.
Size is in a different place.

If I request a list of images in a gallery with images.get, what kind of image URLs am I going to get in the results? If it's a new image, will I still get an imageID and imageKey in the results. Will there be a new field "newImageID" that works in the new image ID in the new image URL?

I'm currently using API version 1.2.2 and switching to 1.3.0 soon.

I ask all this because I'm using smugmug.images.get to get a list of images in a gallery and I then construct my own image URLs with a custom size in them. Right now, I'm using the imageID and imageKey from the results and parsing the version out of the ThumbURL and then construction my own URL using /photos/imageID_imageKey-nnnnxmmm-1.jpg. Obviously my parsing of the version will break on new URLs since it's in a different place now. I'm trying to figure out if anything else will break and if there are any updates to the results to reflect this image URL change?
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question

Comments

  • jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited April 28, 2011
    Bump. Questions about the new image URLs and the API responses.

    Can someone at SM explain how the new image URLs are or aren't present in the API responses and what are the future plans for that. Will the new-fangled imageID that shows up in gallery pages be present in a future version of the API?

    Will the API always return old style image URLS with imageID and imageKey and the version number in the old location? Or is it now going to return new image URLs for new images?
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited April 28, 2011
    John,

    To make your life (and other developers) easier, I've just added a CustomSize argument (eg. &CustomSize=200x200) to any methods (1.2.2 and 1.3.0) that returns image urls which will result in a CustomURL parameter in the response.

    That should eliminate the need for any client side parsing.

    I'll let you know when it's live.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited April 28, 2011
    devbobo wrote: »
    John,

    To make your life (and other developers) easier, I've just added a CustomSize argument (eg. &CustomSize=200x200) to any methods (1.2.2 and 1.3.0) that returns image urls which will result in a CustomURL parameter in the response.

    That should eliminate the need for any client side parsing.

    I'll let you know when it's live.

    Cheers,

    David
    I appreciate what you're trying to do, but that won't work for me. The custom size I will need is not known at the time I request images from the gallery and it can change over time (as the window is resized, etc...) and it can vary from image to image. I simply cannot know ahead of time what size I will need. The size requested is even different for different image aspect ratios if the superSize parameter is selected so it can vary from one image to the next. I have to dynamically construct a custom URL to fit my particular situation.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited April 28, 2011
    It should still work for you, given that you now have a known format to replace on with the CustomURL parameter. Without this, you would have to have code that can determine the difference between the two image urls forms...now you just have to replace on a predefined WxH in the url.

    eg: &CustomSize=400x400
    str = str.replace(/400x400/g, customWidth + "x" + customHeight);
    David Parry
    SmugMug API Developer
    My Photos
  • jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited April 28, 2011
    devbobo wrote: »
    It should still work for you, given that you now have a known format to replace on with the CustomURL parameter. Without this, you would have to have code that can determine the difference between the two image urls forms...now you just have to replace on a predefined WxH in the url.

    eg: &CustomSize=400x400
    str = str.replace(/400x400/g, customWidth + "x" + customHeight);
    Clever, that might work. Thanks, I'll give it a try and see if I run into any other issues.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited April 29, 2011
    this is live thumb.gif
    David Parry
    SmugMug API Developer
    My Photos
Sign In or Register to comment.