mytardis/mytardis — pull request #63 by tjdett (2012-03-01 07:42:52+00:00)
Title: Datafile viewing (not just downloading)

Here's what this pull-request adds:

* All data files now have an extra "download" button, which replicates the previous "individual download" link behaviour.
* Files with mime-types of `text/*` and `image/*` are now viewable in the browser by clicking on them.

For TIFF files, which are by far the most common in microscopy (and also not supported by many browsers) the behaviour depends on if you have ImageMagick installed and available:

* If you do, then the TIFF file is converted to a PNG on the fly when you click the "view" link.
* If you don't, then the TIFF file won't have a view link, and using the "view" URL will just get you a TIFF file.

I thought about putting this in a plugin, but I think that making "viewing" distinct from "downloading" is probably good core behaviour.

I'll probably modularise view handling at some point when things get a bit fancier.