kig / thumbnailer

File thumbnailing tool and Ruby library

This URL has Read+Write access

name age message
file INSTALL Thu Sep 20 06:28:30 -0700 2007 initial commit [Ilmari Heikkinen]
file LICENSE Fri Sep 21 00:21:58 -0700 2007 added GPL3 preclude to sources, LICENSE to repo [Ilmari Heikkinen]
file README Sat Apr 19 21:32:20 -0700 2008 change metadata url from dark to github [Ilmari Heikkinen]
directory bin/ Sat Aug 23 13:50:30 -0700 2008 convert_to_pdf: try 3 times [Ilmari Heikkinen]
directory lib/ Sat Aug 23 17:01:45 -0700 2008 more unoconv pain [Ilmari Heikkinen]
file mkrelease.rb Sat Sep 22 03:29:46 -0700 2007 mkrelease require fix [Ilmari Heikkinen]
file run_to_check_dependencies.rb Mon Feb 16 12:36:10 -0800 2009 run_to_check_dependencies.rb: xvfb-run to check... [Ilmari Heikkinen]
file setup.rb Sat Sep 22 03:57:51 -0700 2007 add svg to setup.rb [Ilmari Heikkinen]
README
Description
-----------

  This package `Thumbnailer' comes with a library called `thumbnailer' 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, svg,
      orf, nef, dng, crw, arw, raf, pef, cr2,
      tif, xpm, ppm, tga, pcx, bmp,
      psd

    Uses image icon:
      xcf

    Uses default icon:
      ai, exr


  Videos
    Anything mplayer / ffmpeg can play.
    
    Successfully tested:
      mkv, flv, avi, mpg, mov, wmv, ogg


  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.
    
    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.

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

    Uses default icon:
      chm
      

  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, rar, tar.gz, ttf

    Uses default icon:
      sis, torrent, rb


Requirements
------------

  * Ruby 1.8

  * Metadata library for Ruby
    http://github.com/kig/metadata/tree/master
  
  * Tons of image converter programs and shared-mime-info.
    http://freedesktop.org/wiki/Software/shared-mime-info
    List of debian packages:
      inkscape
      xvfb
      openoffice.org
      python-uno
      libimlib2-ruby
      netpbm
      paps
      gs-common
      imagemagick
      mplayer
      ffmpeg
      libsnack2
      poppler-utils (v0.6 or later, http://poppler.freedesktop.org/)

  * You need the latest version of dcraw to handle some camera raw images.
    http://cybercom.net/~dcoffin/dcraw/

  * You need unoconv for thumbnailing office documents:
    http://dag.wieers.com/home-made/unoconv/


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


Ilmari Heikkinen <ilmari.heikkinen gmail com>