Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/digineo/thumbshooter

A generator for website thumbshots
https://github.com/digineo/thumbshooter

Last synced: 6 days ago
JSON representation

A generator for website thumbshots

Awesome Lists containing this project

README

        

**Warning!**
Do _not_ use this gem! It is no longer maintained!

Thumbshooter
============

Generates thumbshots of URLs by using Webkit and QT4.

Requirements
============

Please ensure python-qt4 and qt4-webkit is installed.

apt-get install libqt4-ruby libqt4-webkit

You do also need a running x server. You can use a lightweight
x server by doing "apt-get install xvfb" and enabling it:

Thumbshooter.use_xvfb = true

Usage
=======

#Setup options:
shooter = Thumbshooter.new(
:screen => '800x600',
:resize => '600x450',
:crop => '200x150'
)

#Generate thumbnail:
img = shooter.create('http://github.com/')

#Write thumbnail to file:
File.open('thumbshot.png', 'w') {|f| f.write(img) }

**Options for Thumbshooter class:**

**screen**
:screen => 'x'

example:
:screen => '800x600'

**resize**
:resize => 'x'

scaling_option [optional]:
% - image will be resized proportionaly by percentage
# - image will be resized proportionaly by width
example:
:resize => '200x150'
:resize => '200x150#'
:resize => '80x50%'

**crop**
:crop => 'x'

scaling_option [optional]:
% - image will be cropped proportionaly by percentage
example:
:crop => '200x150'
:crop => '80x50%'

important:
size of croped area is based on effect of previous process:
:screen if :resize is not set
:resize if :resize is set
croped area is always gravity center of image

TO-DO
=======

Croping and resizing image should have more options, similar to "thoughtbot's Paperclip"(http://github.com/thoughtbot/paperclip) .

License
=======

Copyright (c) 2009 Julian Kornberger | Digineo GmbH Germany
released under the GNU license