首页 > 解决方案 > cropVariants 的 imageManipulation 中的奇怪行为

问题描述

作为源文件,我有一个方形图像(500x500)。一旦我使用cropArea,预览显示整个区域已被选中(500x500px)

'cropVariants' => [
        'default' => [
            'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_wizards.xlf:imwizard.crop_variant.default',
            'allowedAspectRatios' => [
                '1:1' => [
                    'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.1_1',
                    'value' => 1.0
                ]
            ],
            'selectedRatio' => '1:1',
            'cropArea' => [
                'x' => 0.0,
                'y' => 0.0,
                'width' => 1.0,
                'height' => 1.0,
            ],
        ],
    ],

在此处输入图像描述

但是在数据库中,存储了以下数据(sys_file_reference):(问题y坐标)

{"default":{"cropArea":{"height":1,"width":1,"x":0,"y":-0.002},"selectedRatio":"1:1","focusArea" :无效的}}

在流体中,这是我的代码:

<f:image src="{item.image.0.reference.uid}" alt="{item.image.0.reference.description}" treatIdAsReference="1" />

因此,图像以 500 x 499 像素的流体渲染。(缺少 1 个像素) 在此处输入图像描述

知道如何调整行为吗?这样y坐标也设置为0并呈现整个选择?

标签: image-processingtypo3cropfluidtypo3-9.x

解决方案


推荐阅读