Origami Plugin

Hi everybody,

I've been trying to get a plugin written that would allow using Northwestern's Origami tiled image viewer with omeka. I've been borrowing heavily from existing plugins to get a general feel for what needs to be done. But I've got a few questions.

But first, a few disorganized thoughts on how I imagine this could work. I've created an Origami Image item type in omeka admin. Origami expects to be given a directory containing the image tiles. So what I would like to do is just store that directory name in the database instead of a file name. Then, when an item of "Origami Image" type is requested the thumbnail would link to a Origami viewer page, possibly with the image directory passed as and GET query or something. As for getting the images up there, I'd like to be able to have the user upload a jpg, and run the tiler on the server.

For launching Origami's tiler, I was looking at the after_file_upload hook. When exactly is that fired? Can I assume that when that hook is fired, the file has been uploaded successfully, but not inserted into the database yet?

In the pdfmenot and ipaper plugins, they define a filetype array. Is that used to compare to the file extension? Or does it look at file's mime type or something. If it looks at the file extension, I was thinking I could just give the image tile directory an extension of .origami or something like that.

I thought I had a couple more things I was stuck on (I should remember to write this stuff down as I think of it.) but that's all the questions I can think of now.

Hi bjstaab. An Origami plugin sounds fantastic. Considering it's technical requirements it also sounds quite ambitious and may prove to be challenging to implement.

Instead of creating an Origami item type, have you considered adding a metafield that asks, "Prepare this image for use in the Origami tiled image viewer? Yes. No." Then, when displaying the item, instead of checking for a particular item type, simply check if the item has been prepared for Origami. This way any item type will have access to Origami if assigned the new metafield. There are many other considerations, as you mention, but I'll leave them to your own ingenuity. (Unless of course you have further questions!)

As for your questions:

The after_upload_file hook fires after the item has been given an ID, after the Dublin Core metadata has been saved to the database, and after the file has been successfully uploaded, but before the metatexts and tags have been saved to the database.

In the case of the iPaper and PdfMeNot plugins, the filetype array is a simple check on the file extension. It's a low-tech method to determine file type, but it usually gets the job done.

The Omeka team is excited about your Origami plugin and we're looking forward to seeing it in action.

I've got an Origami plugin that basically works. Once I found paths.php, and that all the server and web accessable paths I needed were already prepared for me, it was fairly trivial to get basic functionality working. So thanks for that. A few issues remain:

Right now my plugin attempts to prepare everything you upload, so now I'm wondering a little more about your suggestion to use a metafield to turn tiling on/off. I added a metafield via the admin interface, but ended up with a big textarea. A checkbox would be ideal, but even being able to control the size of the textarea would be good. Is there an option I'm missing, or is this level of control not there yet? What do you think about using some javascript to dynamically swap out the textarea with a checkbox? If I can't have a true bool, a tightly controlled vocabulary would be an excellent alternative. I'd like to avoid having to deal with Yes/yes/true/True/TRUE... etc. ucase()/lcase() would be an option too I suppose.

What would be the "best practice" for storing the tiled images? Right now, I'm saving them in archive/origami so they live under the same directory as all the other images. But that would either require an Omeka administrator to create a directory with the correct permissions, or I could have the plugin check for and create the directory. But then you'd have to ensure php is allowed to create directories. Or, I could put the tiled images folder in my plugin's directory, so it's already there when the plugin is installed. Any opinions on which would be preferred?

The tiling operation can take a while, so I'd almost like to do some kind of Ajax-y thing where the tiling operation could be backgrounded, and notify the uploader when it's done. Right now, when an image is uploaded, the page hangs until the tiler is done. I know what is happening but I can see how not having the page load as expected would be confusing to most people.

I almost hate to keep resurrecting this zombie thread, but as of the last couple weeks, our (University of Wyoming Libraries) Omeka installation, with the Origami viewer plugin is live and accessible to the public if anybody wants to take a look. We're actually still trying to decide what to do with it, so there isn't much content up right now.

We're also checking with University legal about redistributing the plugin if anybody wants it. I don't imagine releasing it would be a problem, but you never know. Of course, the other issue is if it's even ready for release to the general public. It's got a couple rough edges I haven't gotten around to smoothing out yet.


That's great! Congratulations. We would love to see the plugin released to the public. Please let us know if there is anything we can do to help. We'd be more than happy, for instance, to add the plugin (or a link to it) to our downloads page, or to help with testing by mobilizing the Omeka community to try it out and provide feedback.

Is Origami released under the GPL?

Nice work.