forked from thumbor/thumbor
-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
heynemann edited this page Mar 30, 2011
·
30 revisions
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 and is used only on jpeg images
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'
# this is the security key used to encrypt/decrypt urls.
# make sure this is unique and not well-known
# This can be any string of up to 24 characters
SECURITY_KEY="MY_SECURE_KEY"
# if you enable this, the unencrypted URL won't be enabled
# and thumbor will return 404 if users try to access it
# IT IS VERY ADVISED TO SET THIS TO TRUE TO STOP URL
# TAMPERING FROM MALICIOUS USERS
SECURE_URL_ONLY=False