Thumbnailer 0.1

tarball: http://dark.fhtr.org/repos/thumbnailer/thumbnailer-0.1.tar.gz
git: http://dark.fhtr.org/repos/thumbnailer

example thumbnails:
http://dark.fhtr.org/repos/thumbnailer/example_thumbnails/

Description

This package Thumbnailer' comes with a library calledthumbnailer’
and
a program called `thumbnailer’.

The thumbnailer library uses external thumbnailing programs to create
an
image of wanted size from a given file. Supported output formats are
PNG
and JPEG.

As my own use for the thumbnailer is as a source of mipmapped
textures,
the default behaviour is to create a full-size thumbnail. E.g. if you
have a 3039x2014 camera raw, you’ll get a 3039x2014 jpeg or png out.
For
PDFs and videos, the default size is 2048px on the longest side.

Usage

create a full-size jpeg thumbnail

$ thumbnailer foo.png foo.jpg
$ thumbnailer bar.avi foo.jpg

create a png thumbnail that’s scaled to fit in a 1024x1024 square

$ thumbnailer -s 1024 foo.pdf foo_thumb.png

irb> require ‘thumbnailer’

fit the jpg inside a 256x256 square

irb> Thumbnailer.thumbnail(“foo.png”, “foo_thumb.jpg”, 256)

page five of the pdf

irb> Thumbnailer.thumbnail(“bar.pdf”, “bar_thumb.png”, 2048, 5)

take the main thumbnail at 30 seconds into the video

irb> Thumbnailer.thumbnail(“qux.avi”, “qux_thumb.jpg”, 1024, 30)

List of supported formats

Images
Most image formats. PSDs probably not too accurately.

Successfully tested:
  jpg, png, gif, psd, orf, nef, dng, crw, pef, tif, xpm, ppm, tga, 

svg

Uses image icon:
  xcf

Videos
Anything mplayer / ffmpeg can play.

Successfully tested:
  mkv, flv, avi, mpg, mov

Audio
Anything mplayer can play.

The audio thumbnailing system is a wee bit peculiar. It relies
on a Tcl/Tk app to create a waveform and spectrogram of the audio.
And that requires an X server, of which Xvfb is the best for this
purpose. See Requirements.

Successfully tested:
  mp3, wav, m4a, flac, ra, ogg, wma

Uses audio icon:
  ape

Documents
The document thumbnailer first converts the document into a PDF,
then
thumbnails the PDF. The PDF conversion requires ooffice for office
documents.

The HTML thumbnailer uses GtkMozEmbed, which requires an X server. 

So it
uses yet another Xvfb server for it. See Requirements.

Successfully tested:
  pdf, html, ps, ps.gz, txt, sxi, ppt, odp

Others
Thumbnailer uses a mimetype-specific icon from its icons-directory.
If there’s an SVG icon, the SVG icon will be used. Otherwise a PNG
icon
will be used.

Successfully tested:
  directory, bz2, torrent

Requirements

Install

De-compress archive and enter its top directory.
Then type:

($ su)
# ruby setup.rb

These simple step installs this program under the default
location of Ruby libraries. You can also install files into
your favorite directory by supplying setup.rb some options.
Try “ruby setup.rb --help”.

License

GPL v3

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs