omeka/Omeka — pull request #615 by Daniel-KM (2013-12-03 17:24:27+00:00)
Title: Added possibility to create more types of derivative images, with any effects

Hi,

I need to add another type of derivative image (a thumbnail of intermediate size with some effects).

Fortunately, all the code is ready for that in the core of Omeka: there is method to add derivative types to an uploaded file and a class Omeka_File_Derivative_Image_Creator.

Unfortunately, Omeka won't manage this new derivatives (creation and deletion) because they will not be a standard one. The problem is that the default derivatives are hard coded in application/models/File.php ($_pathsByType = [original, fullsize, thumbnails, square_thumbnails] and in the function createDerivatives() application/model/Files.

So I made a basic patch (see github) to make it more flexible. It:
- makes the PathsByType a function that get list of derivatives from database,
- adds an option in the appearance to list current derivatives and new ones, with their parameters,

The patch is not finalized (it should be integrated in the installer and in the bootstrap), but it is working. You just need to apply the patch and change options in Appearance > Parameters.

Do you think it's usefull or if there is a better way to do that?

I cross-post the patch on Github and Google, because I don't know where it is the better to talk about that.

Sincerely,

--
Daniel Berthereau
Infodoc & Knowledge management