0.0
No commit activity in last 3 years
No release in over 3 years
Thumbshooter creates thumbshots of websites using webkit and qt4.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 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 => '<width>x<height>'

example:
    :screen => '800x600'

**resize**    
    :resize => '<width>x<height><scaling_option>'

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 => '<width>x<height><scaling_option>'

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