smarter-solutions/ez-image-crop

这是一个改进eZ Publish中图像裁剪的工具

安装: 72

依赖项: 0

建议者: 0

安全性: 0

星标: 2

关注者: 5

分支: 1

开放问题: 1

类型:symfony-bundle

v2.0 2016-12-21 23:27 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:52:56 UTC


README

这是一个改进eZ Publish中图像裁剪的工具

安装包

composer require smarter-solutions/ez-image-crop "~1.0"

注册包

// ezpublish/EzPublishKernel.php

class EzPublishKernel extends Kernel
{
    ...
    public function registerBundles()
    {
        ...
        $bundles = array(
            ...
            new SmarterSolutions\EzComponents\EzImageCropBundle\EzImageCropBundle()
            ...
        );
        ...
    }
}

定义过滤器

# ezpublish/config/ezpublish.yaml

ezpublish:
    imagemagick:
        filters:
            gravity/center: '-gravity Center'
...

创建图像别名

# ezpublish/config/ezpublish.yaml

ezpublish:
    system:
        frontend:
            image_variations:
                first_alias:
                    reference: null
                    filters:
                        - { name: gravity/center, params: [200, 75] }
...