【问题标题】:LiipImagineBundle imagine_filter not workingLiipImagineBundle 想象过滤器不工作
【发布时间】:2015-08-12 16:59:29
【问题描述】:

即使我在同一张照片上以完全相同的方式使用它,我也对在一个页面上工作而不在其他页面上工作的imagine_filter 有问题。

在我的过滤器工作的第一页中,我有这个 src: http://myserver.com/media/cache/shooting/photo_preview/75/55cb71cc8ba26-00001.jpg

但是,在过滤器不起作用的页面上,我有这个src:

:///media/cache/shooting/photo_preview/75/55cb71cc8ba26-00001.jpg

有人遇到过这样的问题吗?

此外,第一个 src 仅适用于 app.php,不适用于 app_dev.php。

在我的应用程序中,我使用 Gaufrette 将照片上传到 S3,然后使用 Liip 应用过滤器。缓存在我的服务器上。这是我的配置:

"liip/imagine-bundle": "1.3.*@dev",
"knplabs/gaufrette": "0.1.*",
"knplabs/knp-gaufrette-bundle": "0.1.*@dev",
"aws/aws-sdk-php": "2.8.*@dev",

services:
    mycompany.aws_s3.client:
            class:                    Aws\S3\S3Client
            factory_class:       Aws\S3\S3Client
            factory_method:   'factory'
            arguments:
                -
                    key:      %amazon_aws_key%
                    secret:   %amazon_aws_secret_key%
                    region:   %amazon_aws_region%

    mycompany.liip_imagine.binary.loader.stream.shooting:
          class: '%liip_imagine.binary.loader.stream.class%'
          arguments:
            - 'gaufrette://shooting/'
          tags:
            - { name: 'liip_imagine.binary.loader', loader: 'stream.shooting' }

knp_gaufrette:
    adapters:
        shooting:
            aws_s3:
                service_id:     mycompany.aws_s3.client
                bucket_name:    %amazon_s3_bucket%
                options:
                    directory:  shooting
    filesystems:
        shooting:
            adapter:    shooting
            alias:      shooting_filesystem
    stream_wrapper:     ~

liip_imagine:
    resolvers:
        default:
            web_path: ~
        shooting:
            web_path:
                cache_prefix:   /media/cache/shooting
    controller:
        filter_action:      mycompany_imagine.controller:filterAction
    filter_sets:
        photo_preview:
            data_loader:    stream.shooting
            cache:          shooting
            quality:        50
            filters:
                upscale: { min: [690, 690] }
                thumbnail: { size: [690, 690], mode: outbound}

<img src="{{ photo.imagepath | imagine_filter('photo_preview') }}" alt="">  

【问题讨论】:

    标签: symfony amazon-web-services amazon-s3 liipimaginebundle gaufrette


    【解决方案1】:

    我在 Github 上得到了答案。我只需要更改我的解析器:

    https://github.com/liip/LiipImagineBundle/issues/203

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-08-01
      • 2023-03-19
      • 2023-03-21
      • 2023-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多