Helmut Hummel wrote:
After edtiting the image with the image manipulation wizard and saving the content element, the aspect ratio is wrong in media view.
I can't reproduce that. Can you post your configuration here?
This is my current configuration in EXT:example/Configuration/TCA/Overrides/sys_file_reference.php
$allowedAspectRatios = [
'16:9' => [
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.16_9',
'value' => 16 / 9
],
'3:2' => [
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.3_2',
'value' => 3 / 2
],
'4:3' => [
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.4_3',
'value' => 4 / 3
],
'1:1' => [
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.1_1',
'value' => 1 / 1
],
'NaN' => [
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.free',
'value' => 0.0
],
];
$cropArea = [
'x' => 0.1,
'y' => 0.0,
'width' => 1.0,
'height' => 0.8,
];
$focusArea = [
'x' => 1 / 3,
'y' => 1 / 3,
'width' => 1 / 3,
'height' => 1 / 3,
];
$coverAreas = [
[
'x' => 0.05,
'y' => 0.85,
'width' => 0.9,
'height' => 0.1,
]
];
$GLOBALS['TCA']['sys_file_reference']['columns']['crop']['config'] = [
'type' => 'imageManipulation',
'cropVariants' => [
'desktop' => [
'title' => 'Desktop',
'allowedAspectRatios' => $allowedAspectRatios,
'cropArea' => $cropArea,
'focusArea' => $focusArea,
'coverAreas' => $coverAreas
],
'tablet' => [
'title' => 'Tablet',
'allowedAspectRatios' => $allowedAspectRatios,
'cropArea' => $cropArea,
'focusArea' => $focusArea,
'coverAreas' => $coverAreas
],
'mobile' => [
'title' => 'Mobile',
'allowedAspectRatios' => $allowedAspectRatios,
'cropArea' => $cropArea,
'focusArea' => $focusArea,
'coverAreas' => $coverAreas
],
],
];