Search code examples
symfony-3.4liipimaginebundle

"Source image not resolvable" Liip


With a ezPlatform 2.5 project (based on Symfony 3.4) i need to import and convert some images. I'm using version 2.2.0 of LiipImagineBundle

I store my images in directories : "web/images/typeA/", "web/images/typeB/" etc...

Here's my configuration :

liip_imagine:
  resolvers:
    default:
      web_path:
        web_root: "%kernel.project_dir%/web"
        cache_prefix: "media/cache"
  loaders:
    default:
      filesystem:
        data_root: "%kernel.root_dir%/../web"
#          - "%kernel.project_dir%/web"
#          - "%kernel.project_dir%/web/images"
  driver: gd
  data_loader: default
  cache: default
  filter_sets:
     # list of filters...

Directories "web/images" and subfolders are created by a symfony command (sources files are imported from NFS). So, if they aren't created yet, i've have the error :

In FileSystemLocator.php line 52:

  Source image not resolvable "/path/to/project/www/web/images/typeA/image.jpg" in  
   root path(s) "/path/to/project/www/web"                                                     


Solution

  • I had the error, and I solved it by setting the following in config/packages/liip_image.yaml:

    liip_imagine :
        resolvers :
            default :
                web_path : ~
        loaders:
            default:
                filesystem:
                    data_root: "/" # <-- This setting