2014-10-28 57 views
0

我刚才在Symfony的avlancheimagine束不产生图像

安装AvalancheImagineBundle和我想的图像转换为缩略图,但其没有工作..

<img src="{{'/hrms/web/uploads/profileimage/8999226bcc8341dc7e076eb09226f8521bbac106.jpeg'|apply_filter('my_thumb')}} " /> 

这里是我的配置文件..

avalanche_imagine:

filters: 
    my_thumb: 
     type: thumbnail 
     options: { size: [120, 90], mode: outbound } 

路由文件如下..

_imagine: 
    resource: . 
    type:  imagine 

我得到这个作为HTML

<img src="/hrms/web/app_dev.php/media/cache/my_thumb/hrms/web/uploads/profileimage/8999226bcc8341dc7e076eb09226f8521bbac106.jpeg }}"> 

我还没有创建任何文件夹是否有必要..? 帮助我..

如果我删除HRMS /网络/从图像的URL,它正在..

回答

0

你好,我使用AvalancheImagineBundle

我的配置和路线是一样的,你,但我得到我的IMG SRC以另一种方式,你有没有创建任何文件夹,例如:

配置:

avalanche_imagine: 
    filters: 
     my_big_banner: 
      type: relative_resize 
      options: { widen: 940, format: jpg, quality: 100 } 

路由:

_imagine: 
    resource: . 
    type:  imagine 

HTML:

<img id="big-bannerImgShow" style="background-image: url('{{ (entity.evenImage.webPath) | apply_filter('my_big_banner')}}')"> 

我希望这会帮助你