PHPackages                             thelia/image-factory-module - 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. thelia/image-factory-module

ActiveThelia-module[Image &amp; Media](/categories/media)

thelia/image-factory-module
===========================

0.4.3(9y ago)03004LGPL-3.0+PHP

Since Apr 14Pushed 9y ago4 watchersCompare

[ Source](https://github.com/thelia-modules/ImageFactory)[ Packagist](https://packagist.org/packages/thelia/image-factory-module)[ RSS](/packages/thelia-image-factory-module/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (1)Versions (14)Used By (0)

Image Factory
=============

[](#image-factory)

This module provides an alternative to managing images in Thelia.

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

[](#installation)

### Manually

[](#manually)

- Copy the module into `/local/modules/` directory and be sure that the name of the module is ImageFactory.
- Activate it in your thelia administration panel

### Composer

[](#composer)

Add it in your main thelia composer.json file

```
composer require thelia/image-factory-module:~0.4.0

```

Usage
-----

[](#usage)

With Smarty

```
{* With product id *}

  {image_factory attr=['class'=> 'example-1'] code='test' view="product" view_id="325" inner="?" limit=10}

{* With product sale element id *}

  {image_factory attr=['class'=> 'example-1'] code='test' view="product_sale_element" view_id="21" inner="?" limit=10}

{* With image id *}

  {image_factory attr=['class'=> 'example-2'] code='test' view="product" image_id="10,11,12,13,14" inner="?"}

{* With image file name *}

  {image_factory attr=['class'=> 'example-3'] code='test' file_name="sample-image-394.png,sample-image-396.png" inner="?"}

{* With force image not found *}

  {image_factory force_not_found=true code='test' file_name="an-image-which-does-not-exist"}

{* With an variable *}

{image_factory out="images" force_not_found=true code='test' file_name="an-image-which-does-not-exist"}

{$images|var_dump} {* $images is an collection of type ImageFactory\Response\FactoryResponseCollection *}
{$images[0]|var_dump} {* $images[0] is an object of type ImageFactory\Response\FactoryResponse *}

{* It's possibale to iterate on the collection *}

{foreach from=$images key=k item=image}
 {$image|var_dump}
{/foreach}

{* The object FactoryEntity implements the method __toString. This method returns the html code. *}

{foreach from=$images key=k item=image}
 {$image} {* Display the html code *}
{/foreach}
```

With PHP

```
    /** @var \ImageFactory\Handler\FactoryHandler $factoryHandler */
    $factoryHandler = $this->getContainer()->get('image_factory.factory_handler');

    $image = ProductImageQuery::create()->findOne();
    $factoryCode = 'test';

    $url = $factoryHandler->getUrl($factoryCode, null, 'path/your/image');
    $url = $factoryHandler->getUrl($factoryCode, $image);

    $uri = $factoryHandler->getUri($factoryCode, null, 'path/your/image');
    $uri = $factoryHandler->getUri($factoryCode, $image);
```

Commands
--------

[](#commands)

#### The command image-factory:generate-destination

[](#the-command-image-factorygenerate-destination)

For generate all images of a specific factory

```
    php Thelia image-factory:generate-destination product-high,product-medium,product-small
```

Or for all factories

```
    php Thelia image-factory:generate-destination "*"
```

With this command, the images already present on the destination paths will not be regenerated. It's possible to force the generation process by adding the option `--force`.

```
    php Thelia image-factory:generate-destination product-high,product-medium,product-small --force
```

#### The command image-factory:reload-factory

[](#the-command-image-factoryreload-factory)

For reload all factories in the cache

```
    php Thelia image-factory:reload-factory
```

#### Configure your factories on your database (table image\_factory)

[](#configure-your-factories-on-your-database-table-image_factory)

ColumnDescriptionTypecodeThe code of the factoryText (Example : "product-medium")priorityLoading priorityInteger (Example : 4, Default : 0)sourcesA list of sources pathText (Example : " my/path/1 | my/path/2 ")destinationA destination pathText (Example : "images/product/medium")just\_symlinkFor ignore the processing and create a symlink to the source file.Boolean (Default : 0)widthThe width of the destination imageInteger (Example : 400)heightThe height of the destination imageInteger (Example : 400)qualityThe quality of the destination image. From 1 to 100Integer (Example : 90)background\_colorThe color applied to empty image parts during processing. Use rgb or rrggbb color formatInteger (Example : "000000", Default : "FFFFFF")background\_opacityThe opacity applied to the background color. From 0 to 100Integer (Example : 90, Default: 100)resize\_modeIf 'exact\_ratio\_with\_crop', the image will have the exact specified width and height, and will be cropped if required. If the source image is smaller than the required width and/or height, you have to set allow\_zoom to true, otherwise the generated image will be smaller than required. If 'exact\_ratio\_with\_borders', the image will have the exact specified width and height, and some borders may be added. The border color is the one specified by 'background\_color'. If 'none' or missing, the image ratio is preserved, and depending od this ratio, may not have the exact width and height required.Text (Default : "exact\_ratio\_with\_borders")rotationThe rotation angle in degrees (positive or negative) applied to the image. From -180 to 180. The background color of the empty areas is the one specified by 'background\_color'Integer (Default : 0)persistPersist on destination path after the processingInteger (Default : 1)allow\_zoomIf true, the factory il allowed to resize an image to match the required width and height, causing, in most cases, a quality loss. If false, the image will never be zoomed.Integer (Default : 0)imagine\_library\_codeName of the graphic driver used by the Imagine library (see )Integer (Default : "gd", Possible : "gd, imagick, gmagick")#### Todo

[](#todo)

- The configuration interface on the back office

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 96.5% 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 ~13 days

Recently: every ~22 days

Total

13

Last Release

3518d ago

### Community

Maintainers

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

---

Top Contributors

[![gillesbourgeat](https://avatars.githubusercontent.com/u/7335734?v=4)](https://github.com/gillesbourgeat "gillesbourgeat (55 commits)")[![TomPradat](https://avatars.githubusercontent.com/u/16164512?v=4)](https://github.com/TomPradat "TomPradat (2 commits)")

### Embed Badge

![Health badge](/badges/thelia-image-factory-module/health.svg)

```
[![Health](https://phpackages.com/badges/thelia-image-factory-module/health.svg)](https://phpackages.com/packages/thelia-image-factory-module)
```

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)[humanmade/tachyon-plugin

Rewrites WordPress image URLs to use Tachyon

87338.5k2](/packages/humanmade-tachyon-plugin)

PHPackages © 2026

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