Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 1.49 KB

0200-trivial-thumbnail.org

File metadata and controls

51 lines (35 loc) · 1.49 KB

trivial-thumbnail

This is the library by @Shinmera. It does one trivial thing - shrinks images, squeezes them into smaller thumbnails. Actually, it is a wrapper around ImageMagick.

The cool thing about this library is that it is able to preserve GIF animations. This way you can create animated avatars for users of your next-generation Facebook killer social network, written in Common Lisp!

For example, let’s pretend the user loads this cute dog animation which has 800×800 pixels size, and weights 44KB:

../../media/0200/dog.gif

If we want our avatars to be 64x64 pixels, then trivial-thumbnail will help us:

POFTHEDAY> (trivial-thumbnail:create "docs/media/0200/dog.gif"
                                     "docs/media/0200/small-dog.gif"
                                     :width 64)
#P"docs/media/0200/small-dog.gif"

Here is the result:

../../media/0200/small-dog.gif

To make it work you have to install ImageMagick. On OSX the easiest way to do this is to use Homebrew:

brew install imagemagick

There are also other options. They are covered by documentation.

Seems this is a cool library to make avatars, preview and thumbnails.