2014-10-28 27 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')}}')"> 

我希望這會幫助你