2014-03-24 268 views
0

我已经关注了wiki并设置了一切必要,但所有图像现在都被打破了。我使用了​​软件包管理器进行安装。Thumbor安装不起作用

这里是我的配置文件:

/etc/default/thumbor

 
# set this to 0 to disable thumbor, remove or set anything else to enable it 
# you can temporarily override this with 
# sudo service thumbor start force=1 
enabled=1 

# Location of the configuration file 
conffile=/etc/thumbor.conf 

# Location of the keyfile which contains the signing secret used in URLs 
#keyfile=/etc/thumbor.key 

# IP address to bind to. Defaults to all IP addresses 
# ip=127.0.0.1 

# TCP port to bind to. Defaults to port 8888. 
# multiple instances of thumbor can be started by putting several ports coma separeted 
# Ex: 
# port=8888,8889,8890 
# or 
port=8888 #Default 

/etc/thumbor.conf

 
#!/usr/bin/python 
# -*- coding: utf-8 -*- 

# thumbor imaging service 
# https://github.com/globocom/thumbor/wiki 

# Licensed under the MIT license: 
# http://www.opensource.org/licenses/mit-license 
# Copyright (c) 2011 globo.com [email protected] 

# the domains that can have their images resized 
# use an empty list for allow all sources 
#ALLOWED_SOURCES = ['mydomain.com'] 
ALLOWED_SOURCES = ['admin.mj.dev', 'mj.dev', 'api.mj.dev', 's3.amazonaws.com'] 

# the max width of the resized image 
# use 0 for no max width 
# if the original image is larger than MAX_WIDTH x MAX_HEIGHT, 
# it is proportionally resized to MAX_WIDTH x MAX_HEIGHT 
# MAX_WIDTH = 800 

# the max height of the resized image 
# use 0 for no max height 
# if the original image is larger than MAX_WIDTH x MAX_HEIGHT, 
# it is proportionally resized to MAX_WIDTH x MAX_HEIGHT 
# MAX_HEIGHT = 600 

# the quality of the generated image 
# this option can vary widely between 
# imaging engines and works only on jpeg images 
QUALITY = 85 

# enable this options to specify client-side cache in seconds 
MAX_AGE = 24 * 60 * 60 

# client-side caching time for temporary images (using queued detectors or after detection errors) 
MAX_AGE_TEMP_IMAGE = 0 

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

# maximum size of the source image in Kbytes. 
# use 0 for no limit. 
# this is a very important measure to disencourage very 
# large source images. 
# THIS ONLY WORKS WITH http_loader. 
MAX_SOURCE_SIZE = 0 

# if you set UPLOAD_ENABLED to True, 
# a route /upload will be enabled for your thumbor process 
# You can then do a put to this URL to store the photo 
# using the specified Storage 
UPLOAD_ENABLED = False 
UPLOAD_PHOTO_STORAGE = 'thumbor.storages.file_storage' 
UPLOAD_PUT_ALLOWED = False 
UPLOAD_DELETE_ALLOWED = False 

# how to store the loaded images so we don't have to load 
# them again with the loader 
#STORAGE = 'thumbor.storages.redis_storage' 
#STORAGE = 'thumbor.storages.no_storage' 
STORAGE = 'thumbor.storages.file_storage' 
#STORAGE = 'thumbor.storages.mixed_storage' 
# root path of the file storage 
FILE_STORAGE_ROOT_PATH = '/var/lib/thumbor/storage' 

# If you want to cache results, use this options to specify how to cache it 
# Set Expiration seconds to ZERO if you want them not to expire. 
#RESULT_STORAGE = 'thumbor.result_storages.file_storage' 
#RESULT_STORAGE_EXPIRATION_SECONDS = 60 * 60 * 24 # one day 
#RESULT_STORAGE_FILE_STORAGE_ROOT_PATH = '/tmp/thumbor/result_storage' 

RESULT_STORAGE_STORES_UNSAFE=False 

# stores the crypto key in each image in the storage 
# this is VERY useful to allow changing the security key 
STORES_CRYPTO_KEY_FOR_EACH_IMAGE = True 

#REDIS_STORAGE_SERVER_HOST = 'localhost' 
#REDIS_STORAGE_SERVER_PORT = 6379 
#REDIS_STORAGE_SERVER_DB = 0 
#REDIS_STORAGE_SERVER_PASSWORD = None 

# imaging engine to use to process images 
#ENGINE = 'thumbor.engines.graphicsmagick' 
#ENGINE = 'thumbor.engines.pil' 
ENGINE = 'thumbor.engines.opencv' 

# 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', 
] 

# Redis parameters for queued detectors 
# REDIS_QUEUE_SERVER_HOST = 'localhost' 
# REDIS_QUEUE_SERVER_PORT = 6379 
# REDIS_QUEUE_SERVER_DB = 0 
# REDIS_QUEUE_SERVER_PASSWORD = None 

# 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_frontalface_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 16 characters 
SECURITY_KEY = "[email protected]@)!$" 

# if you enable this, the unencryted URL will be available 
# to users. 
# IT IS VERY ADVISED TO SET THIS TO False TO STOP OVERLOADING 
# OF THE SERVER FROM MALICIOUS USERS 
ALLOW_UNSAFE_URL = False 
# Mixed storage classes. Change them to the fullname of the 
# storage you desire for each operation. 
#MIXED_STORAGE_FILE_STORAGE = 'thumbor.storages.file_storage' 
#MIXED_STORAGE_CRYPTO_STORAGE = 'thumbor.storages.no_storage' 
#MIXED_STORAGE_DETECTOR_STORAGE = 'thumbor.storages.no_storage' 

FILTERS = [ 
    'thumbor.filters.brightness', 
    'thumbor.filters.contrast', 
    'thumbor.filters.rgb', 
    'thumbor.filters.round_corner', 
    'thumbor.filters.quality', 
    'thumbor.filters.noise', 
    'thumbor.filters.watermark', 
    'thumbor.filters.equalize', 
    'thumbor.filters.fill', 
    'thumbor.filters.sharpen', 
    'thumbor.filters.strip_icc', 
    'thumbor.filters.frame', 

    # can only be applied if there are already points for the image being served 
    # this means that either you are using the local face detector or the image 
    # has already went through remote detection 
    # 'thumbor.filters.redeye', 

网址,我尝试加载像这样的图片:

http://localhost:8888/Q9boJke8j2p2Qtv53Hbz_g1nMZo=/250x250/smart/http://s3.amazonaws.com/our-company/0ea7eeb2979215f35112d2e5753a1ee5.jpg

我也有设置在/etc/thumbor.key的关键,请让我知道这是否有必要在这里发表。

回答

1

您在thumbor.conf中的filters选项中缺少一个右括号。

您是否错过了这里发布或实际上在thumbor.conf文件?