PHPackages                             tomatom/picture-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. [Framework](/categories/framework)
4. /
5. tomatom/picture-bundle

ActiveSymfony-bundle[Framework](/categories/framework)

tomatom/picture-bundle
======================

Symfony bundle

1.4(8y ago)048GPLV2PHPPHP &gt;=5.5.9

Since Oct 25Pushed 8y ago2 watchersCompare

[ Source](https://github.com/TomAtomCZ/PictureBundle)[ Packagist](https://packagist.org/packages/tomatom/picture-bundle)[ RSS](/packages/tomatom-picture-bundle/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

TomAtom/PictureBundle
=====================

[](#tomatompicturebundle)

[![picture](picture-light.png)](picture-light.png)

### Symfony Bundle for easy &lt;picture&gt;s :)

[](#symfony-bundle-for-easy-pictures-)

> define breakpoints and use your assets as picture sources, without annoying image conversions and long code blocks

#### Dependencies:

[](#dependencies)

- `vipsthumbnail` from [libvips](https://jcupitt.github.io/libvips/)
- `symfony/framework-standard-edition ">=2.8|~3.3"`

### Installation:

[](#installation)

- you need `vipsthumbnail` !, (install by `sudo apt install libvips-tools`, or you can [compile your own or download here](https://jcupitt.github.io/libvips/))
- create project with Symfony framework
- composer require tomatom/picture-bundle "1.4"
- add bundle to **AppKernel.php:**

```
new TomAtom\PictureBundle\TomAtomPictureBundle(),
```

- update db schema, install assets and clear cache ... and **it's done!**
- **optionally** add parameters to **parameters.yml(.dist)** (define your own breakpoints etc.):

```
# these are defaults
parameters:
    tt_picture_breakpoints: [575, 768, 991, 1199, 1690, 1920]
    tt_picture_converted_dir: '%kernel.project_dir%/web/tt_picture'
    tt_picture_jpeg_quality: 65
```

### Usage:

[](#usage)

- in template, call (jpg, png and gif are supported):

```
{# as function #}
{{ picture(asset('path/to/asset.jpg')) }}

{# as filter #}
{{ asset('path/to/asset.jpg') | picture }}
```

> **&lt;picture&gt;** is generated and image is converted on first render

- you can define custom breakpoints and/or jpeg quality for each image, when needed:

```
{# as function with custom breakpoints defined per image #}
{{ picture(asset('path/to/asset.jpg'), [300, 600, 1200]) }}

{# as function with custom jpeg quality defined per image #}
{{ picture(asset('path/to/asset.jpg'), null, 99) }}

{# as filter with custom breakpoints defined per image #}
{{ asset('path/to/asset.jpg') | picture([300, 600, 1200]) }}

{# as filter with custom jpeg quality defined per image #}
{{ asset('path/to/asset.jpg') | picture(null, 99) }}

{# use with SonataMedia images #}
{{ mediaUrl(entity.media, 'reference') | picture }}
```

- you can retrieve converted images in PHP code too (in case you need to serve images from API, etc.), like this:

```
// asset url - same as in Twig template
$originalAssetUrl = $this->container->get('assets.packages')->getUrl('bundles/app/images/test.jpg');
// get PictureHelper from container
$pictureHelper = $this->container->get('tomatom_picture.util.picture_helper');

// get array of all converted images for asset
$allConveretedImages = $pictureHelper->getAllConverted($originalAssetUrl);

// or specific image for breakpoint
$convertedAssetUrl = $pictureHelper->getAssetUrl($originalAssetUrl, 1920);
$convertedFilePath = $pictureHelper->getFilePath($originalAssetUrl, 1920);

// convert images if not exists and get array of converted images (for global breakpoints)
$allConveretedImages = $pictureHelper->convert($originalAssetUrl);
// convert images if not exists and get array of converted images (custom breakpoints and jpeg quality)
$allConveretedImages = $pictureHelper->convert($originalAssetUrl, [300, 600, 900], 70);
```

### Todo:

[](#todo)

- jpeg quality as param
- jpeg quality as param in template
- breakpoints as param in template
- cmd for batch converting
- converting of images other than assets (like from 'web/uploads', etc)
- helper for retrieving converted images in controller / cmd / service..
- helper for SonataMedia image path

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

5

Last Release

3115d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/417ce6e6aa29246d9cd7d2f20689f767f12c9ecae53306089f8781f7fb6376b0?d=identicon)[b3da](/maintainers/b3da)

---

Top Contributors

[![b3da-cz](https://avatars.githubusercontent.com/u/16703735?v=4)](https://github.com/b3da-cz "b3da-cz (12 commits)")

---

Tags

image-bundlesymfony-imagesymfony picturepicture bundlesymfony srcsetsrcset bundle

### Embed Badge

![Health badge](/badges/tomatom-picture-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tomatom-picture-bundle/health.svg)](https://phpackages.com/packages/tomatom-picture-bundle)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/storefront

Storefront for Shopware

684.2M148](/packages/shopware-storefront)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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