1

我按照此链接http://symfony.com/doc/master/bundles/LiipImagineBundle/index.html上的说明成功安装了 liipImagine

但是当我在我的树枝文件中使用下面的代码时:

{{ad.artwork.pictures|first.path|imagine_filter('home_thumb')}}

我得到以下网址:http://localhost:8000/media/cache/resolve/home_thumb/70869c5748a21e8e734c4c85e5c18ec6bfa9b196.jpeg

我认为 liipImagine 将图像保存(缓存)在我的服务器上的 media/cache/resolve/home_thumb 文件夹中,但它没有这样做。

下面,我的配置:

liip_imagine:

# http://symfony.com/doc/master/bundles/LiipImagineBundle/cache-resolvers.html
# 
resolvers:
    default:
        web_path:
            # %kernel.root_dir%/../web
            web_root: %kernel.root_dir%/../../web
            # media/cache
            cache_prefix: media/cache

loaders:
    default:
        filesystem:
            # %kernel.root_dir%/../web/
            data_root: %kernel.root_dir%/../../web/

driver:               gd
cache:                default
data_loader:          default
default_image:        null
controller:
    filter_action:         liip_imagine.controller:filterAction
    filter_runtime_action: liip_imagine.controller:filterRuntimeAction
filter_sets:

    # Prototype
    home_thumb:
        quality:              100
        jpeg_quality:         ~
        png_compression_level:  ~
        png_compression_filter: ~
        animated:             false
        format:               ~
        cache:                ~
        data_loader:          ~
        default_image:        null
        filters:

            # Prototype
            thumbnail:        { size: [120, 90], mode: outbound }

如果我做错了什么,有人可以解释一下吗?

编辑帖子:当我运行 CLI 时,我得到以下信息:

C:\xampp\htdocs\myproject>php app/console liip:imagine:cache:resolve uploads/media/70869c5748a21e8e734c4c85e5c18ec6bfa9b196.jpg --filters=home_thumb

[Liip\ImagineBundle\Exception\Binary\Loader\NotLoadableException]
Source image not found in "C:\xampp\htdocs\myproject\app/../web/uploads/media/70869c5748a21e8e734c4c85e5c18ec6bfa9b196.jpg"

我真的很感谢你的建议。

4

0 回答 0