PHPackages                             bravo3/image-manager - 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. [Image &amp; Media](/categories/media)
4. /
5. bravo3/image-manager

ActiveLibrary[Image &amp; Media](/categories/media)

bravo3/image-manager
====================

A PHP 5.4 library to control dynamic image assets in a cloud environment

1.2.6(10y ago)158.1k6[1 issues](https://github.com/bravo3/image-manager/issues)MITPHPPHP &gt;=5.4.0

Since Apr 22Pushed 10y ago8 watchersCompare

[ Source](https://github.com/bravo3/image-manager)[ Packagist](https://packagist.org/packages/bravo3/image-manager)[ RSS](/packages/bravo3-image-manager/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (5)Dependencies (7)Versions (24)Used By (0)

Image Manager
=============

[](#image-manager)

A PHP 5.4 image manager intended for cloud use. This image manager is designed to be low-level and work with 'keys' - not directly attach to an entity.

Features
--------

[](#features)

- Easily push and pull images to any remote filesystem (eg Amazon S3)
- Request an image with specific dimensions - allow the manager to transparently create &amp; store this variation
- Request that an image dimension exists (will be created if it doesn't), allowing for the storage device to be used as a CDN end-point
- Use a caching service to maintain a knowledge base of image dimensions available to improve performance
- Load &amp; save images from memory or a file
- Convert image format &amp; quality with ease
- Customisable encoders
- GD and Imagick support
- PDF support (via Imagick)

Examples
--------

[](#examples)

### Storing an image

[](#storing-an-image)

```
// Use the local filesystem as a fake remote (replace with S3, etc)
$im = new ImageManager(new Filesystem(new LocalAdapter('/tmp/images')));

// Load local "image.png" and give it a key of 'content_123_image_1' (using the filename is suitable too)
$image = $im->loadFromFile('image.png', 'content_123_image_1');

// Save it on the remote
$im->push($image);

```

### Retrieving an image

[](#retrieving-an-image)

```
$image = new Image('content_123_image_1');
$im->pull($image);

// Save to local filesystem
$im->save($image, '/tmp/image.png');

// Output to client
echo $image->getData();

```

### Retrieving an automatic variation

[](#retrieving-an-automatic-variation)

```
// Define a dimension that the image will fit in a height of 200px
$dimensions = new ImageDimensions(null, 200);

// Create a specification for a JPEG format, quality 75% and use the above dimensions
$image = new ImageVariation('content_123_image_1', ImageFormat::JPEG(), 75, $dimensions);

// Automatically create the variation when we pull
$im->pull($image);

if (!$im->isPersistent()) {
    // Make sure our new variation exists on the remote
    $im->push($image);
}

echo $image->getData();

```

### Create a variation manually

[](#create-a-variation-manually)

```
$source = $im->loadFromFile('image.png', 'content_123_image_1');
$resized = $im->createVariation($source, ImageFormat::JPEG(), 90, new ImageDimensions(100, 100));
$im->push($resized);

```

### Check if a variation exists

[](#check-if-a-variation-exists)

```
$image = new ImageVariation('content_123_image_1', ImageFormat::JPEG(), 75, $dimensions);

if (!$im->exists($image)) {
    $im->pull($image);  // Creates the variation
    $im->push($image);  // Save it on the remote
}

echo '';

```

Caching
-------

[](#caching)

Because remote storage services have a moderate degree of lag while talking to, it's probably not appropriate to do "exists" checks on every image variation during page generation. To avoid this you can either pre-render the image and assume it will exist, or using a quick caching mechanic to store an inventory of all images available.

Your caching mechanic MUST be persistent - if a cache key is lost the image manager will assume the remote file does not exist. Using a database or disk backed key/value storage is recommended (eg Redis).

To use caching, just include a \\Bravo3\\Cache\\PoolInterface implementation in the ImageManager's constructor.

Encoders
--------

[](#encoders)

By default the image manager will use the InterventionEncoder (@see ), which supports base image formats. You can switch this for the ImagickEncoder which also allows for PDF documents to be used as an input.

To *add* support for native Imagick, but use Intervention where possible (thus giving you PDF support):

```
$im = new ImageManager(...);
$im->addEncoder(new ImagickEncoder());

```

To use only the Imagick encoder:

```
$im = new ImageManager($filesystem, $cache_pool, [new ImagickEncoder()]);

```

Future Considerations
---------------------

[](#future-considerations)

- Allow for image manipulations (eg add text, rotate, etc)
- Allow for customisable variation naming schemes

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~38 days

Total

22

Last Release

3809d ago

Major Versions

0.0.2-beta → 1.0.02014-04-24

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/347611?v=4)[Jordon](/maintainers/jordonsc)[@jordonsc](https://github.com/jordonsc)

---

Top Contributors

[![purinda](https://avatars.githubusercontent.com/u/3181510?v=4)](https://github.com/purinda "purinda (26 commits)")[![jordonsc](https://avatars.githubusercontent.com/u/347611?v=4)](https://github.com/jordonsc "jordonsc (21 commits)")[![jordonscnlm](https://avatars.githubusercontent.com/u/6201504?v=4)](https://github.com/jordonscnlm "jordonscnlm (10 commits)")[![trq](https://avatars.githubusercontent.com/u/32683?v=4)](https://github.com/trq "trq (7 commits)")[![nedimdzendzo](https://avatars.githubusercontent.com/u/4539532?v=4)](https://github.com/nedimdzendzo "nedimdzendzo (4 commits)")[![rickymcalister](https://avatars.githubusercontent.com/u/393500?v=4)](https://github.com/rickymcalister "rickymcalister (1 commits)")

---

Tags

awsimageazuregoogle cloud

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bravo3-image-manager/health.svg)

```
[![Health](https://phpackages.com/badges/bravo3-image-manager/health.svg)](https://phpackages.com/packages/bravo3-image-manager)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M733](/packages/sylius-sylius)[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k14](/packages/tempest-framework)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M415](/packages/drupal-core-recommended)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k40](/packages/civicrm-civicrm-core)

PHPackages © 2026

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