Please note that this documentation is for the most recent version of this extension. It may not be relevant for older versions. Related documentation can be found in the documentation directory of the extension.
How can I, as an integrator, change the aspect ratios for image cropping in TYPO3?
Short answer
Yes — you can. In TYPO3 12/13 you can adjust crop aspect ratios per page/site/language tree via Page TSconfig (recommended when it should vary per branch) and globally via a TCA override in PHP.
Page TSconfig (recommended when it should vary per page/tree)
Enter the following under the root page (or any page where you want to override it).
# tt_content.image: override the default variant
TCEFORM.tt_content.image.config.cropVariants.default {
allowedAspectRatios {
# Disable free cropping
NaN {
title = Free
value = 0.0
disabled = 1
}
# Your custom ratios
ratio_16_9 {
title = 16:9
value = 1.7777777778
}
ratio_4_3 {
title = 4:3
value = 1.3333333333
}
ratio_1_1 {
title = 1:1
value = 1.0
}
}
# Optional: set a default selection
selectedRatio = ratio_16_9
}
Multiple variants (e.g. "desktop", "mobile")
TCEFORM.tt_content.image.config.cropVariants {
desktop {
title = Desktop
allowedAspectRatios {
ratio_16_9.title = 16:9
ratio_16_9.value = 1.7777777778
ratio_3_2.title = 3:2
ratio_3_2.value = 1.5
NaN.disabled = 1
}
selectedRatio = ratio_16_9
}
mobile {
title = Mobile
allowedAspectRatios {
ratio_4_5.title = 4:5
ratio_4_5.value = 0.8
ratio_1_1.title = 1:1
ratio_1_1.value = 1.0
NaN.disabled = 1
}
selectedRatio = ratio_4_5
}
}
Note:
The target is always the
field tt_content.image(or your FAL field). Internally this affects sys_file_reference.crop for the given relation. You disable “free” cropping via the fixed keyNaN(disabled = 1).
Global via TCA override (if it should apply everywhere)
EXT:my_site/Configuration/TCA/Overrides/sys_file_reference.php (or targeted to specific tt_content fields):
$GLOBALS['TCA']['tt_content']['columns']['image']['config']['cropVariants']['default'] = [
'title' => 'Default',
'allowedAspectRatios' => [
'ratio_16_9' => ['title' => '16:9', 'value' => 1.7777777778],
'ratio_4_3' => ['title' => '4:3', 'value' => 1.3333333333],
'ratio_1_1' => ['title' => '1:1', 'value' => 1.0],
'NaN' => ['title' => 'Free', 'value' => 0.0, 'disabled' => true],
],
'selectedRatio' => 'ratio_16_9',
];
Common pitfalls
- Key names: Use your own keys like
ratio_16_9instead ofjust16_9. NaNis the fixed key for “free” cropping.- Address the correct target field in Page TSconfig:
TCEFORM.tt_content.image.config.cropVariants...(do not usesys_file_referencein Page TSconfig). - Clear caches after changes (system caches and reload the backend).
Benefits
- Consistent image presentation across the site or per channel (desktop/mobile)
- Better editorial guidance and faster cropping workflows
- Reduced errors by disabling undesired free-cropping if needed
Conclusion
Use Page TSconfig for per-branch flexibility and a global TCA override for system-wide defaults. This keeps your image crops consistent, controlled, and fast to manage.
