Liipimaginebundle: AWS S3 Resolvers seems to be ignored (v 1.4.3)

Created on 24 Jan 2016  路  3Comments  路  Source: liip/LiipImagineBundle

I'm trying to configure again this bundle to dinamically create thumbnails and store them on AWS S3 but the bundles seems to ignore the configuration.

The images are stored in their original version on AWS3. From there they should be resized, saved again to AWS3 (in another folder) and displayed on the page.

I've tried the two options to configure the cache: using factory and using a service

USING FACTORY

# LiipImagine Configuration
liip_imagine:
    cache: amazon_s3_cache_resolver
    resolvers:
        amazon_s3_cache_resolver:
            aws_s3:
                client_config:
                    credentials:
                        key:    %amazon.s3.key%
                        secret: %amazon.s3.secret%
                    region: %amazon.s3.region%
                    version: %amazon.s3.version%
                bucket: %amazon.s3.bucket%
                get_options:
                    Scheme: 'https'
                put_options:
                    CacheControl: 'max-age=86400'
    filter_sets:
        thumb_purchase:
            quality: 75
            filters:
                thumbnail: { size: [120, 90], mode: outbound }

The resulting path is http://127.0.0.1:8000/media/cache/resolve/thumb_purchase/1 (and the image isn't displayed).

USING A SERVICE

#services.yml

    shq.amazon.s3Credentials:
        class: Aws\Credentials\Credentials
        arguments: ["%amazon.s3.key%", "%amazon.s3.secret%"]

    shq.amazon.s3:
        class: Aws\S3\S3Client
        arguments:
            - version: %amazon.s3.version%
              region: %amazon.s3.region%
              credentials: "@shq.amazon.s3Credentials"

    shq.imagine.cache.resolver.amazon_s3_cache_service_title:
            class: Liip\ImagineBundle\Imagine\Cache\Resolver\AwsS3Resolver
            arguments:
                - "@shq.amazon.s3"
                - "%amazon.s3.bucket%"
            tags:
                - { name: 'liip_imagine.cache.resolver', resolver: 'amazon_s3_cache_service' }
# config.yml
# LiipImagine Configuration
liip_imagine:
    cache: amazon_s3_cache_service
    filter_sets:
        thumb_purchase:
            quality: 75
            filters:
                thumbnail: { size: [120, 90], mode: outbound }

The resulting path again is http://127.0.0.1:8000/media/cache/resolve/thumb_purchase/1 (and again the image isn't displayed).

What am I missing?

NOTE
I had problems in configuring the bundle in the past and then I decided to resolve the problem in another moment. At that time I opened an issue (the issue #626) that currently is closed as a PR seems has resolved the problems I had in the past. Just as information.

Most helpful comment

I wrote a post about how to configure LiipImagineBundle with AwsS3 and Gaufrette. Hope this will help.

http://aerendir.me/2016/01/25/how-to-use-liipimaginebundle-to-manage-thumbnails-through-amazon-s3/

All 3 comments

The cache is not generated when the main http page is served. If there is not anything in the cache the bundle generate the link to filter action (here it is: http://127.0.0.1:8000/media/cache/resolve/thumb_purchase/1). The filter action is responsible for creation cache images applying the configured filters and so on. After the action puts an image to cache it does 301 redirect to a cached image. So the action is not hit again.

Next time you'll see the url to the s3.

Ok, thankyou @makasim ... I've seen my logs and seems there are problems with Gaufrette... I'm inspecting deeper...

I wrote a post about how to configure LiipImagineBundle with AwsS3 and Gaufrette. Hope this will help.

http://aerendir.me/2016/01/25/how-to-use-liipimaginebundle-to-manage-thumbnails-through-amazon-s3/

Was this page helpful?
0 / 5 - 0 ratings