API Request: Add support for performing operations against multiple images

MarcusTMarcusT Registered Users Posts: 25 Big grins
Dear SmugMug,

I'm just starting to play with the SmugMug API but am rather surprised to find that there's no support (that I can see) for performing operations against multiple images at the same time. For example, if I want to retrieve all the photos in an album then sort/filter them by a value in the EXIF data (or just display the data next to them) it seems that I have to retrieve this EXIF data for each image individually, which is of course very inefficient due to the number of HTTP requests that have to be made (one for each image).

Instead I would like to be able to pass a delimited list (or array) of image IDs (and matching Keys) to the smugmug.images.getEXIF API call and get back a response listing the EXIF data for each of the images. I would expect to be able to do the same for smugmug.images.delete, and most of the other smugmug.images calls.

Implementing this capability would make implementation easier (elminating the need to loop), improve performance (fewer calls), and surely save SmugMug's server resources & bandwidth too?

Your thoughts please!

Comments

  • pthpth Registered Users Posts: 49 Big grins
    edited April 15, 2010
    +1

    I have written some javascript implementation of a calendar and other views that have (due to the lack of batching) performance issues while looping against the API. I would love to have a batch lookup.

    pth
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited April 15, 2010
    If you are using API 1.2.2, you can retrieve all the EXIF for images using the smugmug.images.get by adding &Extras=EXIF to the call.

    You can also request specific EXIF parameters like DateTime, by adding &Extras=EXIFDateTime.

    And yes, I have been thinking about allowing the ImageIDs to be a comma separated string for a while. The biggest hurdle for this is formatting the response...if the response returns normally returns a single <Image> object, do I just return series of image objects unparented by an <Images> object or is an images object required ?
    <rsp>
    <Image/>
    <Image/>
    </rsp>
    
    <rsp>
    <Images>
    <Image/>
    <Image/>
    </Images>
    </rsp>
    

    What happens if there is a failure on one image but not others ? What do I return as the response status ?

    I'd love to do it, but at this stage I have too many unanswered questions on how to do it...and just much other stuff that needs to be implemented in the api.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • udyudy Registered Users Posts: 139 Major grins
    edited April 15, 2010
    devbobo wrote:
    If you are using API 1.2.2, you can retrieve all the EXIF for images using the smugmug.images.get by adding &Extras=EXIF to the call.

    You can also request specific EXIF parameters like DateTime, by adding &Extras=EXIFDateTime.

    Is the Extras documented? How do we know what to put there?
  • pthpth Registered Users Posts: 49 Big grins
    edited April 15, 2010
    devbobo wrote:
    If you are using API 1.2.2, you can retrieve all the EXIF for images using the smugmug.images.get by adding &Extras=EXIF to the call.

    The extras tag will work for what I need (right now :-).
    And yes, I have been thinking about allowing the ImageIDs to be a comma separated string for a while. The biggest hurdle for this is formatting the response...if the response returns normally returns a single <Image> object, do I just return series of image objects unparented by an <Images> object or is an images object required ?

    I would be happy with either, but semantically I would wrap them in an images tag. As for errors, I would be happy with either just dropping them and putting a dropped count in the header, or on errors put in an empty image tag, possibly with an error code.

    Thanks
  • MarcusTMarcusT Registered Users Posts: 25 Big grins
    edited April 16, 2010
    devbobo wrote:
    If you are using API 1.2.2, you can retrieve all the EXIF for images using the smugmug.images.get by adding &Extras=EXIF to the call.

    You can also request specific EXIF parameters like DateTime, by adding &Extras=EXIFDateTime.
    Aha! Thanks David, that's news to me, and clearly to others here too...

    I see it's mentioned on http://wiki.smugmug.net/display/API/show+1.2.2?method=smugmug.images.get but not explained, so is it only EXIF attributes, or other stuff too?

    I'd like to see a fully documented list of valid values for "Extras" added to the documentation Wiki.

    And can we request more than one Extras attribute at a time, e.g. ...&Extras=EXIFDateTime&Extras=EXIFFocalLength ?
    devbobo wrote:
    I have been thinking about allowing the ImageIDs to be a comma separated string for a while. The biggest hurdle for this is formatting the response...if the response returns normally returns a single <Image> object, do I just return series of image objects unparented by an <Images> object or is an images object required ?
    If you have a free choice (i.e. don't have to maintain backwards compatibility) then wrapping them in an <Images> object is preferable for implementation and syntactically correct.
    devbobo wrote:
    What happens if there is a failure on one image but not others ? What do I return as the response status ?
    By "failure" I presume you mean that the image doesn't have EXIF data in it, for example? If so, then surely the EXIF (or other) attributes requested should be returned blank/empty where their value cannot be provided by SmugMug?

    Otherwise, if a more severe kind of failure then I think that as long as not all of the images failed (i.e. only one/some) then the response should be 200/OK, and that the result set should include each image requested, with as many attributes as are available (at least the ID and Key for failed images) as well as an error code for each image. But if all the images fail then it should be a standard error response, with no dataset returned.
  • MarcusTMarcusT Registered Users Posts: 25 Big grins
    edited November 1, 2010
    @devbobo - Any update on the feature requests & issues discussed above?
Sign In or Register to comment.