5

I am just trying to get working LiipImagineBundle.

Ok, all I got so far:

  • Installed using composer
    • $ php composer.phar require "liip/imagine-bundle:dev-master"
  • Enabled bundle in AppKernel.php
    • new Liip\ImagineBundle\LiipImagineBundle(),
  • Added to routing.yml
    • _imagine path
  • Added liip_imagine filter in config.yml

    Checked using php app/console router:debug and path _imagine_my_thumb exist.

But after using:

<img src="{{ '/relative/path/to/image.jpg' | imagine_filter('my_thumb') }}" />

image is not rendered, path is simply not found error.

prod.log says that Route _imagine_my_thumb does not exist, although it exist, because it's displayed using router:debug for both environments.

Cœur
  • 32,421
  • 21
  • 173
  • 232
nydiann
  • 111
  • 3
  • 6

2 Answers2

0

You know that you should replace '/relative/path/to/image.jpg' with your image path? Make sure your file exists.

A working example

config:

liip_imagine:
    driver:               gd
    web_root:             %kernel.root_dir%/../web
    data_root:            %kernel.root_dir%/../app
    cache_mkdir_mode:     0777
    cache_prefix:         /media/cache
    cache:                web_path
    cache_clearer:        true
    data_loader:          filesystem
    controller_action:    liip_imagine.controller:filterAction
    formats:              []
    filter_sets:
        avatar:
            filters:
                thumbnail: { size: [40, 40], mode: outbound }
        profile:
            filters:
                relative_resize: { widen: 500 }

html:

<img src="{{ 'uploads/images/filename.jpg' | imagine_filter('avatar') }}" alt="image">
enter code here

routing.yml:

_imagine:
    resource: .
    type:     imagine

Remark: My source folder is in the app folder (see: data_root)

jayv
  • 475
  • 4
  • 13
0

I had similar problem and after enable of php_fileinfo extension in php.ini render start to work.

djuka
  • 5
  • 1
  • 2