Symfony2 で LiipImagineBundle を使用して
おり、gaufrette と統合して amazonS3 で画像を取得しようとしていますが、画像の「src」が間違っています。エラーが私の設定であるかどうかはわかりません...
この小枝コード:
{{ '123.jpg' | imagine_filter('128_128_75_s3') }}
// return http://localhost/project/web/media/cache/resolve/128_128_75_s3/123.jpg
// expected is http://bucket.s3.amazonaws.com/media/cache/resolve/128_128_75_s3/123.jpg
私のサービス.yml:
services:
amazonS3:
class: AmazonS3
arguments:
options:
key: %aws_key%
secret: %aws_secret%
liip_imagine.cache.resolver.amazon_s3:
class: Liip\ImagineBundle\Imagine\Cache\Resolver\AmazonS3Resolver
arguments:
- "@amazonS3"
- "%aws_bucket%"
tags:
- { name: 'liip_imagine.cache.resolver', resolver: 'resolver.amazon' }
liip_imagine.binary.loader.stream.import:
class: Liip\ImagineBundle\Binary\Loader\StreamLoader
arguments:
- 'gaufrette://import/'
tags:
- { name: 'liip_imagine.binary.loader', loader: 'import' }
私のconfig.yml:
# Gaufrette media bundle
knp_gaufrette:
adapters:
import:
amazon_s3:
amazon_s3_id: amazonS3
bucket_name: %aws_bucket%
options:
create: true
filesystems:
import:
adapter: import
alias: import
stream_wrapper: ~
#Liip Imagine Bundle
liip_imagine:
cache: resolver.amazon
data_loader: stream.import
filter_sets:
128_128_75_s3:
quality: 75
filters:
thumbnail: { size: [128, 128], mode: outbound }