Skip to content
heynemann edited this page Mar 25, 2011 · 30 revisions

Configuring thumbor is divided between run-time configuration and the Server arguments.

thumbor Server Configuration

Running thumbor Server is as easy as typing "thumbor" (considering you went through the proper Installing procedures).

The Server application takes some parameters that will help you tailor the thumbor Server to your needs. If you want to find out what the thumbor Server arguments are, just type:

thumbor --help

-i or --ip

The address that Tornado will listen for incoming request. It defaults to 0.0.0.0 (listening on all adresses).

-p or --port

The port that Tornado will listen for incoming request. It defaults to 8888.

-c or --conf

The full path for the configuration file for this server.

Configuration File

thumbor's configuration file is just a regular python script. Tornado loads it and places the specified options under the Tornado.options.options dictionary.

The full-form of the configuration file is this:

# the domains that can have their images resized
ALLOWED_SOURCES = ['s.glbimg.com', 'www.globo.com']

# the max width of the resized image
MAX_WIDTH = 1280

# the max height of the resized image
MAX_HEIGHT = 800

# the quality of the generated image
# this option can vary widely between
# imaging engines
QUALITY = 80

# the way images are to be loaded
LOADER = 'thumbor.loaders.http_loader'

# how to store the original images
STORAGE = 'thumbor.storages.redis_storage'

# if you are using the file storage, this is
# the path where files will get saved
FILE_STORAGE_ROOT_PATH = /tmp

# if you are using the Redis storage, these are
# the connection options to Redis Server.
REDIS_STORAGE_SERVER = {
    'port': 6379,
    'host': 'localhost',
    'db': 0
})

# imaging engine to use to process images
ENGINE = 'thumbor.engines.imagemagick'

# in case imagemagick engine is used
# the path for the magickwand bindings
# this is not a required option since
# thumbor should be able to find magickwand
# on its own
#MAGICKWAND_PATH = []

# detectors to use to find Focal Points in the image
# more about detectors can be found in thumbor's docs
# at https://github.com/globocom/thumbor/wiki
DETECTORS = [
    'thumbor.detectors.face_detector',
    'thumbor.detectors.feature_detector'
]

# if you use face detection this is the file that
# OpenCV will use to find faces. The default should be
# fine, so change this at your own peril.
# if you set a relative path it will be relative to
# the thumbor/detectors/face_detector folder
#FACE_DETECTOR_CASCADE_FILE = 'haarcascade_frontface_alt.xml'
Clone this wiki locally