tv2regionerne/statamic-image-cropper
A Statamic addon that brings visual image cropping to the control panel, letting editors crop, resize, and set focal points on assets so images look right across responsive layouts and templates.
composer require tv2regionerne/statamic-image-cropper. Statamic auto-discovers the service provider; no manual registration is normally required. If the package ships a config file, publish it with php artisan vendor:publish --tag=statamic-image-cropper-config and review container/aspect-ratio options. Clear caches afterwards: php please cache:clear and php artisan view:clear.vendor/tv2regionerne/statamic-image-cropper/src to confirm the exact fieldtype handle (likely image_cropper) and the shape of saved data—typically an asset reference plus crop coordinates. Check the Vue component under resources/js if the CP behavior is unclear.hero_image:
type: image_cropper
display: Hero Image
container: assets
aspect_ratio: 16/9
Editors select an asset and crop it in the control panel. In Antlers, use the field’s asset and its crop data with Glide—e.g., {{ hero_image:url }} with width, height, and fit="crop" parameters, or the package’s provided tag/modifier. Confirm the exact Antlers syntax in the README; the key is that the crop rectangle is available so the front-end crop matches the editorial preview.
hero_image, card_image, thumbnail_image, etc., each with a fixed aspect ratio and container. This keeps the editorial UI simple and prevents accidental mismatched crops.hero_image_alt as a separate text field; the cropper owns visual crop, not accessibility text. Output <img src="{{ hero_image:url ... }}" alt="{{ hero_image_alt }}">.srcset tag. Example pattern:<img
src="{{ hero_image:url width="1200" height="675" fit="crop" }}"
srcset="
{{ hero_image:url width="600" height="338" fit="crop" }} 600w,
{{ hero_image:url width="1200" height="675" fit="crop" }} 1200w
"
alt="{{ hero_image_alt }}">
hero_crop, card_crop) pointing at the same asset container, or a Replicator/Grid with a crop preset selector if the package supports configurable presets. Avoid storing raw crop JSON in a text field—you lose validation and CP UX.{{ if hero_image }}{{ ... }}{{ else }}<div class="placeholder"></div>{{ /if }}.storage/statamic/glide (or your configured cache) when debugging.fit="crop" dimensions must agree. Cropping to 16:9 but requesting 1200×800 without fit="crop" will distort or letterbox the image. Centralize dimensions in a config or partial.Log::debug() in the fieldtype’s preProcess/process methods (if you fork) or use Statamic’s debug tools. The fieldtype class and Vue component are under vendor/tv2regionerne/statamic-image-cropper/src and resources/js.How can I help you explore Laravel packages today?