PHPackages                             mouf/utils.graphics.image-preset-displayer - 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. mouf/utils.graphics.image-preset-displayer

ActiveMouf-library[Image &amp; Media](/categories/media)

mouf/utils.graphics.image-preset-displayer
==========================================

Images handler that will generate image thumbs and serve them when displayed (like the drupal image styles services)

v3.0.0(11y ago)017.7kMITPHPPHP &gt;=5.3.0

Since Apr 17Pushed 8y agoCompare

[ Source](https://github.com/thecodingmachine/utils.graphics.image-preset-displayer)[ Packagist](https://packagist.org/packages/mouf/utils.graphics.image-preset-displayer)[ Docs](https://github.com/thecodingmachine/utils.graphics.image-preset-displayer)[ RSS](/packages/mouf-utilsgraphicsimage-preset-displayer/feed)WikiDiscussions 3.0 Synced 1mo ago

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

Graphics image preset displayer
===============================

[](#graphics-image-preset-displayer)

What is this package
--------------------

[](#what-is-this-package)

This package is used to resize/modify images dynamically on a website. It requires [Mouf](http://mouf-php.com) and Apache as a web-server.

How does it work?
-----------------

[](#how-does-it-work)

You store the images to be resized/transformed in a directory. For instance: `images/original`. You would normally access those images like this: `http://[myserver]/[myapp]/images/original/test.png`. Instead, using this package, you can access `http://[myserver]/[myapp]/images/small/test.png`.

If the `test.png` image does not exist in the `small` directory, it will be automatically resized, and stored in that directory (thanks to a `.htaccess` file stored in the `small` directory). Once the image has been generated, the image will be served statically. Therefore, the cost of resizing the image is only paid once, the first time the image is accessed.

This package is very similar to the way the *image\_cache* module works in Drupal.

How to use it
-------------

[](#how-to-use-it)

First, start by creating an instance of the `StaticImageDisplayer` class.

The most important properties are:

- *initialImageFilter*: this is a pointer to an object representing the source image.
- *imageSource*: this is a pointer to an object representing the transformed image.
- *savePath*: the directory where the resized images will be saved.
- *basePath*: the directory where the original images are stored.

[![sample StaticImageDisplayer instance](doc/images/StaticImageDisplayer.png)](doc/images/StaticImageDisplayer.png)

**Compulsory**The *initialImageFilter* property must be filled with an instance of `MoufImageFromFile`. For your convenience, you might name this instance `sourceImage`. The `path` property of the `sourceImage` should remain empty. It will be filled on runtime, when an image is requested.

[![sourceImage instance](doc/images/sourceImage.png)](doc/images/sourceImage.png)

Finally, the most important part. The *imageSource* property points to an instance of a class implementing the `MoufImageInterface`. In our case, we are looking to reduce the image size. We will therefore use the `MoufImageResize` class that resizes an image. Here, we could put any valid transformation provided by the *mouf.image* package.

[![MoufImageResize](doc/images/MoufImageResize.png)](doc/images/MoufImageResize.png)

Everything is set up. We just need one additional thing. We need to write the `.htaccess` that will automatically call the `StaticImageDisplayer` if an image is not found. Hopefully, the `StaticImageDisplayer` class provides a utility function for this, directly accessible from the Mouf UI.

In your `StaticImageDisplayer` instance, just click on the "Generate .htaccess" button.

[![Generate .htaccess](doc/images/generateHtAccess.png)](doc/images/generateHtAccess.png)

The .htaccess should be generated. You are now ready to test image resizing. Put an image in your `basePath` folder and try to access it from the `savePath` URL. You should see the image resized.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.7% 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 ~524 days

Total

3

Last Release

3001d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1104771?v=4)[mouf](/maintainers/mouf)[@Mouf](https://github.com/Mouf)

---

Top Contributors

[![nguyenk](https://avatars.githubusercontent.com/u/2227554?v=4)](https://github.com/nguyenk "nguyenk (11 commits)")[![moufmouf](https://avatars.githubusercontent.com/u/1290952?v=4)](https://github.com/moufmouf "moufmouf (5 commits)")[![lenafaure](https://avatars.githubusercontent.com/u/7765656?v=4)](https://github.com/lenafaure "lenafaure (1 commits)")

---

Tags

moufimage cache

### Embed Badge

![Health badge](/badges/mouf-utilsgraphicsimage-preset-displayer/health.svg)

```
[![Health](https://phpackages.com/badges/mouf-utilsgraphicsimage-preset-displayer/health.svg)](https://phpackages.com/packages/mouf-utilsgraphicsimage-preset-displayer)
```

###  Alternatives

[liip/imagine-bundle

This bundle provides an image manipulation abstraction toolkit for Symfony-based projects.

1.7k38.3M217](/packages/liip-imagine-bundle)[contao/imagine-svg

Contao Imagine SVG library

863.0M15](/packages/contao-imagine-svg)[rokka/imagine-vips

libvips adapter for imagine

43564.1k5](/packages/rokka-imagine-vips)[orchestra/imagine

Imagine (Wrapper) Component for Laravel

70207.0k3](/packages/orchestra-imagine)[media-alchemyst/media-alchemyst

An Object Oriented wrapper for easy multimedia conversion, based on Imagine, FFMpeg, SwfTools, Unoconv and other libs

65216.4k1](/packages/media-alchemyst-media-alchemyst)[mouf/mouf

The Mouf PHP framework: an open-source PHP framework providing an easy way to download, install, use and reuse components, with a graphical user interface.

55146.0k17](/packages/mouf-mouf)

PHPackages © 2026

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