2015-01-14 29 views
0

如何在不剪切图像的情况下使用AvalancheImagineBundle调整图像大小?Symfony2 AvalancheImagineBundle /调整图像大小

我有其可以是100x50或50×,然后,如果我设置缩略图大小50×50到我将会有这些图像仅中间部分(例如从25到高度的960x75像素)

somewhat: 
       type: thumbnail 
       options: { size: [50, 50], mode: outbound, allow_upscale: true } 

回答

1

我的图像雪崩有这个问题。这似乎是某种错误,或缺少功能(纠正我,如果我错了)。我建议你使用另一个包(也不再支持Avalanche)。 我在我的项目中使用Liip:https://github.com/liip/LiipImagineBundle 它基于Avalanche,所以它非常熟悉。在LiipImagine中,您可以通过以下方式实现所需功能:

foo_filter: 
    filters: 
     thumbnail: { size: [50, 50], mode: inset }