thumbnails for images and pdfs via http.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.settings
app
conf
install
project
public
test
.gitignore
.travis.yml
LICENSE
README.textile
build.sbt

README.textile

thumby

Thumby is a district in germany and a thumbnail generator as a web service. Pass an image or a pdf to the service and get a thumbnail image back.

Supports
- pdf
- still images

Requirements

1. Java 8
2. Typesafe Activator

cd /tmp
wget http://downloads.typesafe.com/typesafe-activator/1.3.2/typesafe-activator-1.3.2-minimal.zip
unzip typesafe-activator-1.3.2-minimal.zip
sudo mv activator-1.3.2-minimal /opt

Run

Download

cd /tmp
git clone https://github.com/hbz/thumby
cd thumby

Configure

Provide a list of servers, that thumby is allowed to connect to.

editor conf/application.conf
thumby.whitelist="localhost,127.0.0.1,pbs.twimg.com"

Specify a location where thumby stores thumbnails

thumby.storageLocation="/tmp/thumby-storage"

Run

/opt/activator-1.3.2-minimal/activator run

Go to http://localhost:9000/tools/thumby

Manual Test

curl -XGET "http://localhost:9000//tools/thumby?url=https://pbs.twimg.com/profile_images/2262780036/jan_128_400x400.jpg&size=200"

that’s all! Repeating requests will be answered with a cached version using ‘url’ and ‘size’ as cache address.

Install on Ubuntu


cd /tmp/thumby
/opt/activator-1.3.2-minimal/activator dist
cp target/universal/thumby-0.1.0-SNAPSHOT.zip  /tmp
cd /tmp
unzip thumby-0.1.0-SNAPSHOT.zip
mv thumby-0.1.0-SNAPSHOT /opt/thumby

edit /opt/thumby/conf/application.conf

http.path="/tools/"
application.context="/tools/thumby"
#Provide a comma separated list of servers. Thumby will not access files on any other servers. 
thumby.whitelist="localhost,127.0.0.1"

edit startscript

sudo cp /tmp/thumby/install/thumby.tmpl /etc/init.d/thumby
sudo chmod u+x /etc/init.d/thumby
sudo editor /etc/init.d/thumby

set the following vars

JAVA_HOME=/opt/java
HOME="/opt/thumby"
USER="user to run thumby"
GROUP="user to run thumby"
SECRET=`uuidgen` # generate a secret e.g. using uuidgen
PORT=9000

include into system start and shutdown

sudo update-rc.d thumby defaults 99 20

start

sudo service thumby start

Update


rm -rf /tmp/thumby
cd /tmp
git clone https://github.com/hbz/thumby
cd /tmp/thumby
/opt/activator-1.3.2-minimal/activator dist
cp target/universal/thumby-0.1.0-SNAPSHOT.zip  /tmp
cd /tmp
unzip thumby-0.1.0-SNAPSHOT.zip
cp /opt/thumby/conf/* /tmp/thumby-0.1.0-SNAPSHOT/conf
sudo service thumby stop
rm -rf /opt/thumby/*
mv /tmp/thumby-0.1.0-SNAPSHOT/* /opt/thumby/
sudo service thumby start

License

GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007