PHPackages                             zero1/media-utils - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. zero1/media-utils

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

zero1/media-utils
=================

Magento 2 module

1.0.1(3mo ago)42181OSL-3.0PHP

Since Jan 5Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/zero1limited/magento2-media-utils)[ Packagist](https://packagist.org/packages/zero1/media-utils)[ RSS](/packages/zero1-media-utils/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

Media Utils
===========

[](#media-utils)

This module serves to add a few utility functions to the Magento CLI for working with your media assets.

- [Product Image Variation Report](#product-image-variation-report)
- [Product Image Cache Cleanup](#product-image-cache-cleanup)
- [Product Image Cleanup](#product-image-cleanup)

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

[](#installation)

```
composer require zero1/media-utils

```

Product Image Variation Report
------------------------------

[](#product-image-variation-report)

Magento provides a way for images to be declared in the theme xml, these declarations are named and specify how the source image should be altered. For example, setting the width to X and the height to Y. Magento is smart enough not to create a new image if the same image parameters are specified for multiple image variants. However this only works if the image parameters are exactly the same, it can be quite easy to specify an image 1px different and there will be another image generated.

This report displays two tables. First the image configurations that are declared, this includes:

- the themes they belong to
- the store IDs they are applicable for
- the name of the image configuration
- the parameters of the image

This can be useful to identify configurations that are similar can that can be update to make them the same, reducing the total number of image resize operations required. [![](docs/similar-image-variations.PNG)](docs/similar-image-variations.PNG)

Secondly how each of these variants map to a cache directory. This allows you to see which image declarations are the same.

```
php bin/magento zero1:media-utils:product-image-variation-report
```

Product Image Cache Cleanup
---------------------------

[](#product-image-cache-cleanup)

This command assesses all files within `catalog/product/cache` and removes all that aren't a valid variation.

```
php bin/magento zero1:media-utils:product-cache-clean [--dry-run]
```

Passing the `--dry-run` flag, stops the process from removing any images. [![](docs/image-cache-cleanup.PNG)](docs/image-cache-cleanup.PNG)

Product Image Cleanup
---------------------

[](#product-image-cleanup)

This command assesses all files within `catalog/product` (excluding `catalog/product/cache`) and removes all that aren't used.

```
php bin/magento zero1:media-utils:product-clean [--dry-run]
```

Passing the `--dry-run` flag, stops the process from removing any images. [![](docs/image-cleanup.PNG)](docs/image-cleanup.PNG)

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance78

Regular maintenance activity

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~1113 days

Total

2

Last Release

115d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b08c35b603becab270a53db6ec969f48be0c353a20ee2985bb1a8ec5a9b64e9?d=identicon)[zero1](/maintainers/zero1)

---

Top Contributors

[![adamzero1](https://avatars.githubusercontent.com/u/6369163?v=4)](https://github.com/adamzero1 "adamzero1 (3 commits)")[![bradley-zero1](https://avatars.githubusercontent.com/u/183477695?v=4)](https://github.com/bradley-zero1 "bradley-zero1 (1 commits)")

### Embed Badge

![Health badge](/badges/zero1-media-utils/health.svg)

```
[![Health](https://phpackages.com/badges/zero1-media-utils/health.svg)](https://phpackages.com/packages/zero1-media-utils)
```

###  Alternatives

[strictus/strictus

Strict Typing for local variables in PHP

1606.9k](/packages/strictus-strictus)[wodby/wordpress-composer

Project template for WordPress projects with composer

691.1k](/packages/wodby-wordpress-composer)[ollyxar/websockets-chat

Laravel WebSockets Chat

431.1k](/packages/ollyxar-websockets-chat)

PHPackages © 2026

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