如果我将LiipImagineBundle配置为使用stream data loader,我如何制作图像标记以在模板中使用该数据加载器?
更新了配置
knp_gaufrette:
adapters:
image_storage:
amazon_s3:
amazon_s3_id: namespace_admin.amazon_s3
bucket_name: %amazon_s3_bucket_name%
create: false
options:
create: true
directory: 'mydir'
region: %amazon_s3_region%
filesystems:
image_storage:
adapter: image_storage
alias: image_storage_filesystem
s3_storage:
adapter: image_storage
stream_wrapper:
protocol: data
filesystems:
- s3_storage
namespace_admin:
amazon_s3:
aws_key: %amazon_aws_key%
aws_secret_key: %amazon_aws_secret_key%
aws_region: %amazon_s3_region%
base_url: %amazon_s3_base_url%
liip_imagine:
loaders:
stream.my_namespace_images:
stream:
wrapper: data://s3_storage
resolvers:
default:
web_path: ~
filter_sets:
cache: ~
gi_thumb:
data_loader: stream.my_namespace_images
quality: 75
filters:
thumbnail: { size: [120, 90], mode: outbound }
答案 0 :(得分:0)
你需要做两件事。
gi_thumb
过滤器需要将data_loader
设置为stream.get_inspired_images
。imagine_filter
:{{ '/example/path/image.png'|imagine_filter('gi_thumb', true) }}
这会加载此图片:http://your-bucket.s3.amazonaws.com/example/path/image.png
。