Skip to content

How To Write A New Thumbnailer

benjaminpick edited this page Jun 4, 2012 · 9 revisions

How To Write A New Thumbnailer

What is a Thumbnailer?

A Thumbnailer is a class that handles the creation of thumbnail files (PNG) of a certain input format (identified by MIME Types). So if you need to add the support of a specific file format, you can follow this guide.

HowTo

  • First, create a developing environment by forking this Github project, checking out your copy of it, and following the steps explained in Building from source.
  • Create a new class implementing the Thumbnailer interface - easier, extend AbstractThumbnailer. You can check DummyThumbnailer or other Thumbnailers to see how they work.
  • Register the thumbnailer:
  • Testing: Copy a file of your input file type into test/testfiles. Add your thumbnailer to ThumbnailerFileTestDummy. Then run ant test and see if something fails, especially ThumbnailGeneratorBasicTest/ThumbnailGeneratorMIMETest.
  • When finished, send me a pull request so that everybody can profit from your improvement!