== Introduction ==

This plugin allows CWIS to automatically capture screenshots for
resources which do not currently have a screenshot.

Currently, there are two methods supported for obtaining these
screenshots.  Both methods require some server-side configuration
before they will work.  The first, wkhtmltoimage, is easier to
configure but less reliable.  The second, firefox via Xvbf and
imagemagick requires more server-side support, but more reliably
captures images.

== Setting up wkhtmltoimage ==

Obtain a statically built binary of wkhtmltoimage for your platform
from: http://code.google.com/p/wkhtmltopdf/

Binaries are available for linux runnong on i386 and amd64
processors.  You may also be able to build for other operating systems
and architectures, but we haven't tested this.

Place the 'wkhtmltoimage-i386' or 'wkhtmltoimage-amd64' binary in
SITE_ROOT/plugins/AutoScreenshot/bin .  Make sure that the user who is
running apache (usually 'www', 'www-data', or 'apache') has
permissions to run the wkhtmltoimage binary.

This should be all that is required

== Setting up firefox ==

Install firefox, Xvfb, and Imagemagick for your platform.  The wide
variety of distributions out prevents us from being able to provide
more detailed instructions.

Be sure that the folders .gnome2 and .mozilla exist in the home
directory of your apache user (usually /var/www), and that your apache user has
read/write access to them.  The former folder is necessary because
firefox is linked with gvfs and therefore crashes if it cannot access
this.  The latter is for firefox to save preferences.

We'll need to create a .mozilla folder which contains some customized
preferences.  Run firefox as a uzer who doesn't already have a
.mozilla folder.  Uncheck all the menubars, sidebars, and toolbars
from the 'view' menu.  Go into about:config and set the following:
browser.privatebrowsing.autostart = true
browser.sessionstore.max_tabs_undo = 0
browser.sessionstore.max_windows_undo = 0
browser.startup.page = 0
browser.tabs.autoHide = true

Copy the contents of this .mozilla into apache's home directory, and
set the contents of this .mozilla to be readable by apache.

This should be all that is required.