Download the PHP package pixelbrackets/typo3-update-crop-variants without Composer
On this page you can find all versions of the php package pixelbrackets/typo3-update-crop-variants. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pixelbrackets/typo3-update-crop-variants
More information about pixelbrackets/typo3-update-crop-variants
Files in pixelbrackets/typo3-update-crop-variants
Package typo3-update-crop-variants
Short Description TYPO3 command to add missing crop variants and optionally regenerate changed ratios in file references
License GPL-2.0-or-later
Informations about the package typo3-update-crop-variants
TYPO3 Update Crop Variants
TYPO3 command to add missing crop variants and optionally regenerate changed ratios in file references.
Requirements
- PHP >= 8.1
- TYPO3 12.4, 13.4, 14.0
Installation
Packagist Entry https://packagist.org/packages/pixelbrackets/typo3-update-crop-variants/
Usage
TYPO3 crop variants allow editors to define different image crops for different contexts
(e.g., desktop, mobile).
Each variant offers a list of allowed aspect ratios (e.g., 3:2, 16:9, 4:3, free) to choose from.
The editor picks one ratio per variant in the backend,
and the resulting crop coordinates are stored in the file reference.
See TCA image manipulation
for configuration details.
When new crop variants are added to TCA, or when aspect ratios are changed, all existing file references with crops need to be updated by editors. This command automates that process.
By default only missing crop variants are added - existing editor crops are preserved.
Use --updateRatios to also update variants where the stored ratio no longer matches the TCA
ratio. Only mismatched crops are overwritten with a centered default - crops that already match
the TCA ratio are preserved.
The command defaults to outputting a summary only. Add -v to see per-item details.
Use --dry-run to preview changes without writing anything to the database.
The cleanup:updatecropvariants command and the --updateRatios option are safe to add to a
deployment script (e.g., a projects composer.json hook) or scheduler task - each run only
changes what does not yet match the TCA configuration.
Only the --forceOverride flag is destructive and not safe for unsupervised execution.
Related
Updating crop variants does not remove processed image files from the filesystem which had been generated under the old crop configuration. They stay orphaned. To avoid purging the complete processed images directory, you may use the package derhansen/processed-images-cleaner to purge selected stale processed image files:
Source
https://gitlab.com/pixelbrackets/typo3-update-crop-variants/
Mirror https://github.com/pixelbrackets/typo3-update-crop-variants/
License
GNU General Public License version 2 or later
The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html.
Author
Dan Kleine (@pixelbrackets) for XIMA
Contribution
This script is Open Source, so please use, share, patch, extend or fork it.
Contributions are welcome!