0

I use Symfony 6 and ApiPlatform. I want to put out miniature photos. I am using Flysystem and LiipImagineBundle. I did everything as in the Symfony documentation. However, when I want to use the method "filterService-> getUrlOfFilteredImage ()" I get an error:

Liip\ImagineBundle\Binary\Loader\FlysystemV2Loader::__construct(): Argument #2 ($filesystem) must be of type League\Flysystem\FilesystemOperator, League\Flysystem\Local\LocalFilesystemAdapter given, called in /var/www/var/cache/dev/Container6Sb4vUT/getLiipImagine_Binary_Loader_FlysystemLoaderService.php on line 23

Is this a library bug?

My config.yml

liip_imagine:
    # valid drivers options include "gd" or "gmagick" or "imagick"
    driver: "imagick"

    loaders:
        flysystem_loader:
            flysystem:
                filesystem_service: flysystem.adapter.private.storage
    data_loader: flysystem_loader

    filter_sets:
        my_thumb:
            filters:
                thumbnail:
                    size: [200, 200]
                    mode: outbound
                    allow_upscale: true


############################
flysystem:
    storages:
        private.storage:
            adapter: 'local'
            options:
                directory: '%kernel.project_dir%/var/storage/files'
ciastekkkk
  • 89
  • 7

1 Answers1

0

As I found out in this comment on a Github issue, you have to exclude the flysystem.adapter part in the filesystem_service key.

Leaving only private.storage in your case. As such :

liip_imagine:
  driver: "imagick"

loaders:
    flysystem_loader:
        flysystem:
            filesystem_service: private.storage
Greg Berger
  • 714
  • 7
  • 10