We've been working for a little while here on Omeka 2.2, our next
feature release, and wanted to share a little bit of what's in the
pipeline. We have several major changes for derivative (aka thumbnail)
creation in the works. You can check them out on the Github branch
"derivatives" (
https://github.com/omeka/Omeka/tree/derivatives), and
I'll also call out some of the more interesting changes here.
First, there's a brand new system in place to let an Omeka site
administrator change the way that derivative images get generated.
Previous versions of Omeka had one big class for creating thumbnails,
which incorporated lots of assumptions and specific code for handling
the ImageMagick command line tools.
In Omeka 2.2, there's a separation in place. The new derivative creator
class is generic, and only handles things that are always applicable to
our generation process. It passes off the actual creation of the new
thumbnail images to a derivative "strategy" class. All the code specific
to running the ImageMagick command line tools is refactored out into the
new ExternalImageMagick strategy class. At the same time, we dropped the
call to "identify" that we had added to the creation process. It didn't
serve a particularly useful purpose, and dropping it can cut the time
for making some thumbnails in half.
A site administrator can change the strategy they're using by just
specifying a class name in the application/config/config.ini file. This
is similar to how different Storage adapters can be selected there. In
the same way, entirely new strategies can be included in plugins and
selected in config.ini. A new strategy simply has to implement a single
method that creates one derivative image. We pass along the configured
pixel size constraint, the type of the image (fullsize, thumbnail,
etc.), and the mime type of the original file, to let strategies vary
their behavior accordingly.
These changes make it much easier to introduce the next major change:
Imagick extension support. In addition to just refactoring the old
derivative creator into a strategy, we've created a new strategy that
uses Imagick instead of calling out to the shell and the "convert" binary.
There are a few smaller changes rolled in here as well. We've added
configurable blacklist/whitelist support for mime types, so people with
installations that have trouble with a particular type can blacklist it,
or admins can be generous in the file types they allow to be uploaded,
but set a restrictive whitelist on which types will be processed for
thumbnails.
Finally, the new strategy classes have a system for accepting "options"
specified in the config.ini file. The idea here is to account for
situations where people want to make relatively minor changes to, say,
the command line we give to ImageMagick. As with most of these changes,
the focus is on adding flexibility without making people hack on the
Omeka core code.
This message grew a little longer than I was intially planning, so
here's a short recap. In Omeka 2.2, you can: swap out the derivative
creator code, use Imagick to create your thumbnails, blacklist or
whitelist particular file types from getting thumbnails, and set options
for configuring the thumbnail creator of your choice. These changes
aren't completely finished, and aren't set in stone. We've love to hear
any feedback about these features, the code itself, or things like
specific options that you'd like to see to make your specific use case
work better.
-John