0

I am currently using vich_uploader to upload files to S3 (this works correctly). However now I also want to apply some liip_imagine filter_sets, the current config.yml looks like:

liip_imagine:
    loaders:
        loader_aws_s3_images:
            flysystem:
                filesystem_service: oneup_flysystem.awss3v3_filesystem
    resolvers:
        profile_photos:
            flysystem:
                filesystem_service: oneup_flysystem.awss3v3_filesystem
                root_url:           "%s3_directory%"
                cache_prefix:       media/cache
                visibility:         public
    filter_sets:
        cache: ~
        179x151:
            filters:
                thumbnail: { size: [179, 151], mode: inset }
        50x50:
            filters:
                thumbnail: { size: [50, 50], mode: inset }
oneup_flysystem:
    adapters:
        upload_adapter:
            awss3v3:                  
                client: ct_file_store.s3 #this needs to match the "service" you defined above
                # service_id: client.s3
                bucket: %aws_s3_bucket%
                prefix: ~
    filesystems:
        awss3v3:
            adapter:    upload_adapter
            mount:   prefix

vich_uploader:
    db_driver: orm 
    storage:   flysystem
    mappings:
        profile_pics:
            # uri_prefix: https://s3.eu-central-1.amazonaws.com/%aws_s3_bucket% # you'll need this set to use the Vich URL generator
            upload_destination: prefix
            # upload_destination: %kernel.root_dir%/../web/images/profile_pics
            namer: vich_uploader.namer_uniqid
            delete_on_remove: true
            delete_on_update: true
        project_docs:
            # uri_prefix: https://s3.eu-central-1.amazonaws.com/%aws_s3_bucket% # you'll need this set to use the Vich URL generator
            upload_destination: prefix
            # upload_destination: %kernel.root_dir%/../web/images/profile_pics
            namer: vich_uploader.namer_uniqid
            delete_on_remove: true
            delete_on_update: true

composer.json:

"liip/imagine-bundle": "@stable",
"aws/aws-sdk-php": "@stable",
"oneup/flysystem-bundle": "@stable",
"league/flysystem-aws-s3-v3": "@stable"

Currently I get a Source image could not be found I have tried to create custom resolvers/loaders to read from S3 to no success.

T Max
  • 31
  • 5
  • I had a similar setup and when I was developing it, I had problems with the prefixes. The files where stored in a route and Liip was trying to load them from another. Using and empty bucket and going step by step to locate where the files were stored help me to find the proper config. Good luck!! – Carlos May 08 '17 at 15:54
  • Thanks man! I will look into it. There isn't anything like this that exists, I specifically want to change the size of the UploadedFile before it is written to S3. – T Max May 08 '17 at 22:45
  • I'm saving everything in S3, the original file and the generated thumbnails. In our case the S3 cost us few € by month so we can afford it. – Carlos May 09 '17 at 08:29

0 Answers0