PHPackages                             alengo/sulu-media-extra-bundle - 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. alengo/sulu-media-extra-bundle

ActiveSymfony-bundle

alengo/sulu-media-extra-bundle
==============================

Media utilities for Sulu CMS — @2x crop sync, format generation, media rename command

1.0.2(yesterday)08↑1775%MITPHPPHP ^8.2

Since Apr 6Pushed yesterdayCompare

[ Source](https://github.com/alengodev/SuluMediaExtraBundle)[ Packagist](https://packagist.org/packages/alengo/sulu-media-extra-bundle)[ Docs](https://github.com/alengodev/SuluMediaExtraBundle)[ RSS](/packages/alengo-sulu-media-extra-bundle/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

SuluMediaExtraBundle
====================

[](#sulumediaextrabundle)

Media utilities for [Sulu CMS](https://sulu.io/) 3.x — `@2x` crop synchronization, image format generation, and media rename command.

Features
--------

[](#features)

- **`@2x` crop sync** — automatically mirrors crop settings from `800x@2x` to `800x` on every crop save
- **Image format generation** — generates `image-formats.xml` entries from a simple YAML list (including `@2x` variants)
- **Format options duplicate** — backfills existing `@2x` crop entries to their base format keys
- **Media rename** — renames a media file in storage and database with dry-run support

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

[](#requirements)

- PHP 8.2+
- Sulu CMS ~3.0
- Symfony 7.x

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

[](#installation)

```
composer require alengo/sulu-media-extra-bundle
```

Register the bundle in `config/bundles.php`:

```
Alengo\SuluMediaExtraBundle\AlengoMediaExtraBundle::class => ['all' => true],
```

No further configuration required — all services are auto-registered.

@2x Crop Sync
-------------

[](#2x-crop-sync)

`MediaCropModifiedSubscriber` listens to `MediaCropModifiedEvent`. Whenever a crop is saved for a format key containing `@2x` (e.g. `800x@2x`), the same crop coordinates are automatically written to the base key (`800x`).

This ensures that `@1x` and `@2x` formats always use identical crop regions without manual duplication.

Commands
--------

[](#commands)

### `alengo:media:image-formats:generate`

[](#alengomediaimage-formatsgenerate)

Generates `image-formats.xml` entries from a YAML source file. Each format produces two XML entries — the base format (marked `internal="true"`) and the `@2x` variant.

```
bin/adminconsole alengo:media:image-formats:generate
bin/adminconsole alengo:media:image-formats:generate --source=config/app/image-formats.yaml --target=config/image-formats.xml
```

**Source YAML format:**

```
# config/app/image-formats.yaml
image_formats:
    - 400x300
    - 800x
    - x600
```

**Generated XML output** (appended to existing `image-formats.xml`):

```

```

OptionDefaultDescription`--source` / `-s``config/app/image-formats.yaml`Source YAML file (relative to project root)`--target` / `-t``config/image-formats.xml`Target XML file (relative to project root)---

### `alengo:media:image-format-options:duplicate`

[](#alengomediaimage-format-optionsduplicate)

Backfills existing `@2x` crop entries (`me_format_options`) to their base format keys. Useful after adding the bundle to a project that already has saved crops.

```
bin/adminconsole alengo:media:image-format-options:duplicate
bin/adminconsole alengo:media:image-format-options:duplicate --source=config/app/image-formats.yaml
```

OptionDefaultDescription`--source` / `-s``config/app/image-formats.yaml`YAML file listing the format keys to process---

### `alengo:media:rename`

[](#alengomediarename)

Renames a media file — updates the display name in the database, moves the file in storage, and increments the subVersion to invalidate format caches.

```
bin/adminconsole alengo:media:rename
bin/adminconsole alengo:media:rename 42 "new-filename" --locale=de --dry-run
```

Argument / OptionDescription`mediaId`ID of the media to rename`newName`New base filename (extension is preserved from original)`--locale` / `-l`Locale for filename normalization (default: `en`)`--dry-run`Preview changes without writing anything

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance100

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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 ~0 days

Total

3

Last Release

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a3bea97975bdeddcfa5b76c222740e703e4ff5f9bbf5f6d5d75e8827e0a48ac?d=identicon)[alengodev](/maintainers/alengodev)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/alengo-sulu-media-extra-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/alengo-sulu-media-extra-bundle/health.svg)](https://phpackages.com/packages/alengo-sulu-media-extra-bundle)
```

###  Alternatives

[sulu/skeleton

Project template for starting your new project based on the Sulu content management system

29733.3k](/packages/sulu-skeleton)[sulu/article-bundle

Bundle for managing localized content-rich entities like blog-posts in the Sulu content management system

66409.6k2](/packages/sulu-article-bundle)[sulu/headless-bundle

Bundle that provides controllers and services for using Sulu as headless content management system

55133.7k2](/packages/sulu-headless-bundle)[sulu/form-bundle

Bundle for creating forms in Sulu.

87287.3k7](/packages/sulu-form-bundle)[sulu/content-bundle

Experimental content implementation for sulu.

17112.3k1](/packages/sulu-content-bundle)[sulu/theme-bundle

The Sulu Bundle which provides theming functionality.

23300.4k1](/packages/sulu-theme-bundle)

PHPackages © 2026

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