跳到内容

方向过滤器

编辑此页

自动旋转

内置的 auto_rotate 过滤器执行方向变换(包括旋转图像)。此过滤器不公开任何选项来配置其行为。

配置示例

1
2
3
4
5
6
7
8
9
10
11
# app/config/config.yml

liip_imagine:
    filter_sets:

        # name our filter set "my_auto_rotate_filter"
        my_auto_rotate_filter:
            filters:

                # use the "auto_rotate" filter
                auto_rotate: ~

提示

应尽早调用此过滤器以获得最佳效果。

注意

此过滤器需要安装 exif 扩展才能工作。

旋转

内置的 rotate 过滤器执行方向变换(特别是图像旋转)。此过滤器公开了 旋转选项,可用于配置其行为。

配置示例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# app/config/config.yml

liip_imagine:
    filter_sets:

        # name our filter set "my_rotate_filter"
        my_rotate_filter:
            filters:

                # use the "rotate" filter
                rotate:

                    # set the degree to rotate the image
                    angle: 90

旋转选项

degree: float
设置定义图像旋转角度的“旋转角度”。 必须为正数。

翻转

内置的 flip 过滤器执行方向变换(特别是图像翻转)。此过滤器公开了 翻转选项,可用于配置其行为。

配置示例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# app/config/config.yml

liip_imagine:
    filter_sets:

        # name our filter set "my_flip_filter"
        my_flip_filter:
            filters:

                # use the "flip" filter
                flip:

                    # set the axis to flip on
                    axis: x

翻转选项

axis: string
设置“翻转轴”,该轴定义在哪个轴上翻转图像。有效值:xhorizontalyvertical
本作品,包括代码示例,根据 Creative Commons BY-SA 3.0 许可协议获得许可。
目录
    版本