A new API for sequences of photos?

Posted by Dave Winer, 5/14/03 at 3:35:39 PM.

A picture named fujifilm.jpgThis is something I've wanted for ages -- an efficient way to upload a sequence of images to a server, and be able to reference them as a group.

Individual photos are too small a unit these days. When I take a trip I end up with a folder of photos on my local computer. When I've figured out which ones form a sequence, I want to run a script, have them go up on the server, and then be able to have a news item already created that includes all the pictures. Think of a sequence as the 21st Century analog of a roll of film.

Here are some examples of sequences I created by hand. Obviously there are many other ways of displaying a sequence of photos. The API doesn't have anything to say about that.

I'm going to design this in so that it can be implemented in any CMS, as part of its support for the MetaWeblog API. I'm doing my implementation in Manila, but put this up for review with other developers to be sure it's not specific to Manila.

Status 

Think of this as a pre-RFC.

I've done some thinking, and actually have implemented the server side of these RPC handlers, so I know they work. But I'm not sure that this is something I will deploy, or something that I'll include in the MetaWeblog API. I want to hear what the Movable Type people think, because we've been working together on the MetaWeblog API. I also hope at some point the Blogger people will have an opinion. I noted that Brent Simmons, the author of NetNewsWire is interested in this area. So if you have comments, please post them on the MetaWeblog API mail list.

None of this is cast in concrete. Not even wet concrete. Do not deploy. ;->

metaWeblog.newImageSequence (blogid, username, password, sequenceName) returns boolean 

The blogid, username and password params are as in the Blogger API.

sequenceName identifies the sequence. It must be unique for the weblog indicated by blogid. It's an identifier string, begins with an alpha character, subsequent characters are alpha, numeric or underscore.

If newImageSequence fails, it throws an error. If it succeeds, it returns true.

Only the user who created the image sequence can add to it or otherwise modify it.

metaWeblog.addImageToSequence (blogid, username, password, sequenceName, array) returns struct 

sequenceName identifies a sequence created through newImageSequence, above.

array contains any number of structs, each of which contains two elements: type and bits, as in metaWeblog.newMediaObject.

Order in the sequence is determined by the order in which the images appear in the array. The first item in the array is the first item in the sequence. If there are N items in the sequence, and addImageToSequence is called again, the first item in the array will be image N+1 in the sequence, and the second will be N+2 and so on.

Notes on the Manila implementation 

Image sequences are stored in a new top-level website table, #imageSequences.

Each sequence has two subtables, one called metadata, and the other called images.

The images are not stored in the object database. The Frontier settings must be set to static storage of pictures. If not, any call to create an image sequence will fail, with an internal error (with a reasonably meaningful error message).

Discuss this message.