{"id":51040276,"url":"https://github.com/pixelbrackets/typo3-update-crop-variants","last_synced_at":"2026-06-22T10:02:42.329Z","repository":{"id":351322514,"uuid":"1210231650","full_name":"pixelbrackets/typo3-update-crop-variants","owner":"pixelbrackets","description":"Updates crop variants for image fields across the TYPO3 CMS","archived":false,"fork":false,"pushed_at":"2026-04-27T21:16:49.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-15T21:53:14.002Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pixelbrackets.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-14T07:59:26.000Z","updated_at":"2026-04-27T21:15:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pixelbrackets/typo3-update-crop-variants","commit_stats":null,"previous_names":["pixelbrackets/typo3-update-crop-variants"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pixelbrackets/typo3-update-crop-variants","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelbrackets%2Ftypo3-update-crop-variants","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelbrackets%2Ftypo3-update-crop-variants/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelbrackets%2Ftypo3-update-crop-variants/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelbrackets%2Ftypo3-update-crop-variants/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pixelbrackets","download_url":"https://codeload.github.com/pixelbrackets/typo3-update-crop-variants/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelbrackets%2Ftypo3-update-crop-variants/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34643624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-22T10:02:41.508Z","updated_at":"2026-06-22T10:02:42.318Z","avatar_url":"https://github.com/pixelbrackets.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TYPO3 Update Crop Variants\n\n[![Version](https://img.shields.io/packagist/v/pixelbrackets/typo3-update-crop-variants.svg?style=flat-square)](https://packagist.org/packages/pixelbrackets/typo3-update-crop-variants/)\n[![Made With](https://img.shields.io/badge/made_with-php-blue?style=flat-square)](https://gitlab.com/pixelbrackets/typo3-update-crop-variants#requirements)\n[![License](https://img.shields.io/badge/license-gpl--2.0--or--later-blue.svg?style=flat-square)](https://spdx.org/licenses/GPL-2.0-or-later.html)\n\nTYPO3 command to add missing crop variants and optionally regenerate changed ratios in file references.\n\n```\n$: vendor/bin/typo3 cleanup:updatecropvariants tt_content --dry-run\n\nAuto-detected 1 field(s) with crop variants: image\n\n=== Field: tt_content.image ===\n\nProcessing 8 file reference(s)…\n\nType: text (3 reference(s))\n\n  * desktop (16:9, 4:3)\n  * mobile (1:1)\n\nType: textmedia (5 reference(s))\n\n  * desktop (16:9, 3:2, free)\n  * mobile (3:4, 1:1)\n  * thumbnail (1:1)\n\nWould update: 4\nSkipped: 4\n```\n\n## Requirements\n\n- PHP \u003e= 8.1\n- TYPO3 12.4, 13.4, 14.0\n\n## Installation\n\nPackagist Entry https://packagist.org/packages/pixelbrackets/typo3-update-crop-variants/\n\n```bash\ncomposer require pixelbrackets/typo3-update-crop-variants\n```\n\n## Usage\n\nTYPO3 crop variants allow editors to define different image crops for different contexts\n(e.g., `desktop`, `mobile`).\nEach variant offers a list of allowed aspect ratios (e.g., `3:2`, `16:9`, `4:3`, free) to choose from.\nThe editor picks one ratio per variant in the backend,\nand the resulting crop coordinates are stored in the file reference.\nSee [TCA image manipulation](https://docs.typo3.org/permalink/t3tca:columns-imagemanipulation-introduction)\nfor configuration details.\n\nWhen new crop variants are added to TCA, or when aspect ratios are changed, all existing\nfile references with crops need to be updated by editors. This command automates that process.\n\nBy default only missing crop variants are added - existing editor crops are preserved.\n\nUse `--updateRatios` to also update variants where the stored ratio no longer matches the TCA\nratio. Only mismatched crops are overwritten with a centered default - crops that already match\nthe TCA ratio are preserved.\n\nThe command defaults to outputting a summary only. Add `-v` to see per-item details.\nUse `--dry-run` to preview changes without writing anything to the database.\n\n```bash\n# Scenario: Add new mobile crop variant to a specific field\nvendor/bin/typo3 cleanup:updatecropvariants tt_content image\n\n# Auto-detect and update all image fields in a table\nvendor/bin/typo3 cleanup:updatecropvariants tt_content\n\n# Scenario: Update desktop variant after changing ratio from 3:2 to 16:9\n# Note: variants configured as free ratio in TCA are always skipped\nvendor/bin/typo3 cleanup:updatecropvariants tt_content image --updateRatios\n\n# Auto-detect all image fields and update changed ratios\nvendor/bin/typo3 cleanup:updatecropvariants tt_content --updateRatios\n\n# Reset all crops to defaults (!), removing any existing crop adjustments\nvendor/bin/typo3 cleanup:updatecropvariants tt_content image --forceOverride\n\n# Preview changes without writing, show per-reference details\nvendor/bin/typo3 cleanup:updatecropvariants tt_content image --dry-run -v\n\n# Update crops in a third-party extension table\nvendor/bin/typo3 cleanup:updatecropvariants tx_news_domain_model_news\n```\n\nThe `cleanup:updatecropvariants` command and the `--updateRatios` option are safe to add to a\ndeployment script (e.g., a projects `composer.json` hook) or scheduler task - each run only\nchanges what does not yet match the TCA configuration.\n\nOnly the `--forceOverride` flag is destructive and not safe for unsupervised execution.\n\n## Source\n\nhttps://gitlab.com/pixelbrackets/typo3-update-crop-variants/\n\nMirror https://github.com/pixelbrackets/typo3-update-crop-variants/\n\n## License\n\nGNU General Public License version 2 or later\n\nThe GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html.\n\n## Author\n\nDan Kleine (\u003cmail@pixelbrackets.de\u003e / [@pixelbrackets](https://pixelbrackets.de))\nfor [XIMA](https://www.xima.de/)\n\n## Contribution\n\nThis script is Open Source, so please use, share, patch, extend or fork it.\n\nContributions are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelbrackets%2Ftypo3-update-crop-variants","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpixelbrackets%2Ftypo3-update-crop-variants","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelbrackets%2Ftypo3-update-crop-variants/lists"}