PHPackages                             pixelbrackets/typo3-update-crop-variants - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. pixelbrackets/typo3-update-crop-variants

ActiveTypo3-cms-extension[CLI &amp; Console](/categories/cli)

pixelbrackets/typo3-update-crop-variants
========================================

TYPO3 command to add missing crop variants and optionally regenerate changed ratios in file references

1.3.0(1mo ago)0471↑100%GPL-2.0-or-laterPHPPHP &gt;=8.1CI passing

Since Apr 14Pushed 1mo agoCompare

[ Source](https://github.com/pixelbrackets/typo3-update-crop-variants)[ Packagist](https://packagist.org/packages/pixelbrackets/typo3-update-crop-variants)[ RSS](/packages/pixelbrackets-typo3-update-crop-variants/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (5)Versions (7)Used By (0)

TYPO3 Update Crop Variants
==========================

[](#typo3-update-crop-variants)

[![Version](https://camo.githubusercontent.com/7069b12782c28c72a6ee9829015efe6ac9faf60b7e50c6af3bf8a0a4b2b97918/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706978656c627261636b6574732f7479706f332d7570646174652d63726f702d76617269616e74732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pixelbrackets/typo3-update-crop-variants/)[![Made With](https://camo.githubusercontent.com/f6c764778c46107383a50b589db66c3cdd5827e7414d138214e41a57ac94df33/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d6164655f776974682d7068702d626c75653f7374796c653d666c61742d737175617265)](https://gitlab.com/pixelbrackets/typo3-update-crop-variants#requirements)[![License](https://camo.githubusercontent.com/4daac00aaa49d8045d90fc294ffbcc993557bc747e009ca9b1e0bb5271dafa7d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d67706c2d2d322e302d2d6f722d2d6c617465722d626c75652e7376673f7374796c653d666c61742d737175617265)](https://spdx.org/licenses/GPL-2.0-or-later.html)

TYPO3 command to add missing crop variants and optionally regenerate changed ratios in file references.

```
$: vendor/bin/typo3 cleanup:updatecropvariants tt_content --dry-run

Auto-detected 1 field(s) with crop variants: image

=== Field: tt_content.image ===

Processing 8 file reference(s)…

Type: text (3 reference(s))

  * desktop (16:9, 4:3)
  * mobile (1:1)

Type: textmedia (5 reference(s))

  * desktop (16:9, 3:2, free)
  * mobile (3:4, 1:1)
  * thumbnail (1:1)

Would update: 4
Skipped: 4

```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- TYPO3 12.4, 13.4, 14.0

Installation
------------

[](#installation)

Packagist Entry

```
composer require pixelbrackets/typo3-update-crop-variants
```

Usage
-----

[](#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](https://docs.typo3.org/permalink/t3tca:columns-imagemanipulation-introduction)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.

```
# Scenario: Add new mobile crop variant to a specific field
vendor/bin/typo3 cleanup:updatecropvariants tt_content image

# Auto-detect and update all image fields in a table
vendor/bin/typo3 cleanup:updatecropvariants tt_content

# Scenario: Update desktop variant after changing ratio from 3:2 to 16:9
# Note: variants configured as free ratio in TCA are always skipped
vendor/bin/typo3 cleanup:updatecropvariants tt_content image --updateRatios

# Auto-detect all image fields and update changed ratios
vendor/bin/typo3 cleanup:updatecropvariants tt_content --updateRatios

# Reset all crops to defaults (!), removing any existing crop adjustments
vendor/bin/typo3 cleanup:updatecropvariants tt_content image --forceOverride

# Preview changes without writing, show per-reference details
vendor/bin/typo3 cleanup:updatecropvariants tt_content image --dry-run -v

# Update crops in a third-party extension table
vendor/bin/typo3 cleanup:updatecropvariants tx_news_domain_model_news
```

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.

Source
------

[](#source)

Mirror

License
-------

[](#license)

GNU General Public License version 2 or later

The GNU General Public License can be found at .

Author
------

[](#author)

Dan Kleine ( / [@pixelbrackets](https://pixelbrackets.de)) for [XIMA](https://www.xima.de/)

Contribution
------------

[](#contribution)

This script is Open Source, so please use, share, patch, extend or fork it.

Contributions are welcome!

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance91

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

5

Last Release

43d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ca67c6c7d79cf33bb5688dcbf217ad52309a52580b6a490aae8445f446178a3?d=identicon)[pixelbrackets](/maintainers/pixelbrackets)

---

Top Contributors

[![pixelbrackets](https://avatars.githubusercontent.com/u/1592995?v=4)](https://github.com/pixelbrackets "pixelbrackets (6 commits)")

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/pixelbrackets-typo3-update-crop-variants/health.svg)

```
[![Health](https://phpackages.com/badges/pixelbrackets-typo3-update-crop-variants/health.svg)](https://phpackages.com/packages/pixelbrackets-typo3-update-crop-variants)
```

###  Alternatives

[helhum/typo3-console

A reliable and powerful command line interface for TYPO3 CMS

2959.3M237](/packages/helhum-typo3-console)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k44](/packages/friendsoftypo3-content-blocks)[wazum/sluggi

TYPO3 extension for URL slug management with inline editing, auto-sync, locking, access control, and redirects

41515.2k](/packages/wazum-sluggi)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

611.0M6](/packages/netresearch-rte-ckeditor-image)[b13/make

Kickstarter CLI tool for various TYPO3 functionalities

48267.9k1](/packages/b13-make)[b13/assetcollector

Asset collector - Add CSS and SVG files and strings as inline style tag/inline svg to the html code.

10123.2k](/packages/b13-assetcollector)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
