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

AbandonedArchivedSymfony-bundle[Image &amp; Media](/categories/media)

sparwelt/imgix-bundle
=====================

Generate and transform urls and responsive images in Symfony and Twig

0.5.0(6y ago)14.5kMITPHPPHP &gt;=5.6.0

Since Jul 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/sparwelt/imgix-bundle)[ Packagist](https://packagist.org/packages/sparwelt/imgix-bundle)[ RSS](/packages/sparwelt-imgix-bundle/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (27)Used By (0)

[![Build Status](https://camo.githubusercontent.com/57577cdaded24a1ce253eddacd8b8580bc50b2f990b9351f1f81734f5eb4b52c/68747470733a2f2f7472617669732d63692e6f72672f7370617277656c742f696d6769782d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sparwelt/imgix-bundle)[![Coverage Status](https://camo.githubusercontent.com/948d32885d067545c2ce0b43c52d14390a73deda3ec6fe9d588b5fdca0aed343/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7370617277656c742f696d6769782d62756e646c652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/sparwelt/imgix-bundle?branch=master)

php5.6 + sf2php7.1 + sf2php5.6 + sf3php7.1 + sf3php7.1 + sf4[![Status](https://camo.githubusercontent.com/9dcd49d7ea7e8c6c0e7e427b5d9c36465e1ca6a66678e6476512f2ee69644804/68747470733a2f2f7472617669732d6d61747269782d6261646765732e6865726f6b756170702e636f6d2f7265706f732f7370617277656c742f696d6769782d62756e646c652f6272616e636865732f6d61737465722f31)](https://travis-ci.org/sparwelt/imgix-bundle)[![Status](https://camo.githubusercontent.com/e6211a0b62a004e2ecf8827b0cae6e764473d0e095cc1cf05e3aa49390f9dcb3/68747470733a2f2f7472617669732d6d61747269782d6261646765732e6865726f6b756170702e636f6d2f7265706f732f7370617277656c742f696d6769782d62756e646c652f6272616e636865732f6d61737465722f32)](https://travis-ci.org/sparwelt/imgix-bundle)[![Status](https://camo.githubusercontent.com/5427dad1d315d689cfd58ec0ab8bee0ae9145e0e84495127f489f2a5c6e622e5/68747470733a2f2f7472617669732d6d61747269782d6261646765732e6865726f6b756170702e636f6d2f7265706f732f7370617277656c742f696d6769782d62756e646c652f6272616e636865732f6d61737465722f33)](https://travis-ci.org/sparwelt/imgix-bundle)[![Status](https://camo.githubusercontent.com/9063780901ce55713b0c861c636f3b46ee4b6954d892da6df78396c3771e149b/68747470733a2f2f7472617669732d6d61747269782d6261646765732e6865726f6b756170702e636f6d2f7265706f732f7370617277656c742f696d6769782d62756e646c652f6272616e636865732f6d61737465722f34)](https://travis-ci.org/sparwelt/imgix-bundle)[![Status](https://camo.githubusercontent.com/1adb220dbe79d67e4dd2223241dd53d1ff718318256784ef6454490c11a33210/68747470733a2f2f7472617669732d6d61747269782d6261646765732e6865726f6b756170702e636f6d2f7265706f732f7370617277656c742f696d6769782d62756e646c652f6272616e636865732f6d61737465722f35)](https://travis-ci.org/sparwelt/imgix-bundle)Imgix Bundle for Symfony
========================

[](#imgix-bundle-for-symfony)

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

[](#installation)

```
composer require sparwelt/imgix-bundle
```

Basic configuration
-------------------

[](#basic-configuration)

```
sparwelt_imgix:
  cdn_configurations:
    my_cdn:
        cdn_domains: ['my.imgix.net']
        sign_key: '12345'

  image_filters:
    my_basic_filter:
        src: {w: 30, h: 60}
```

Basic usage
-----------

[](#basic-usage)

```
{# url generation #}
{{ imgix_url('/dir/test.png', {w: 100, h: 200}) }}
{# "https://my.imgix.net/dir/test.png?w=100&h=200" #}

{# image generation #}
{{ imgix_image('/dir/test.png', {src: {w: 100, h: 200}}) }};
{#  #}

{# html conversion #}
{{ imgix_html('', {src: {w: 100, h:  200}}) }}
{#  #}
```

### Responsive usage

[](#responsive-usage)

```
{# image generation #}
{{ imgix_image('/dir/test.png', {
            src: {h: 150, w: 300},
            srcset: {
                100w: {h: 300, w: 600},
                500w: {h: 600, w: 900},
            },
            sizes: '(min-width: 900px) 1000px, (max-width: 900px)'
}) }}
{#  #}

{# image generation #}

{#  #}
```

### Lazyloading

[](#lazyloading)

```
{{ imgix_image('/dir/test.png', {
    'src': {h: 30, w: 60},
    'srcset': 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==',
    'data-srcset': {
        '100w': {'h': 60, 'w': 120}
        '500w': {'h': 90, 'w': 180},
    },
    'data-sizes': 'auto',
    'class': 'lazyload',
}) }}
{#
#}
```

### Named filters

[](#named-filters)

Instead of repeating filters at every usage, named filters can be configured once and called by name:

```
sparwelt_imgix:
  image_filters:
    my_basic_filter:
        src: {w: 30, h: 60}
    my_blur_lazyload_filter:
        src: {w: 30, h: 60}
        data-src: {h: 30, w: 60, blur: 1000}
        data-srcset:
            100w: {h: 60, w: 120}
            500w: {h: 90, w: 180}
        data-sizes: 'auto'
        class: 'lazyload'
```

```
{{ imgix_image('dir/test.png', 'my_basic_filter') }}
{#  #}

{{ imgix_image('dir/test.png', 'my_blur_lazyload_filter') }}
{#
#}

{{ imgix_url('dir/test.png', 'my_basic_filter.src') }}
{# https://test.imgix.net/test.png?h=30&w=60 #}

{{ imgix_url('dir/test.png', 'my_basic_filter.src', {q: 75}) }}
{# https://test.imgix.net/test.png?h=30&w=60&q=75 #}

{{ imgix_attr('dir/test.png', 'my_blur_lazyload_filter.data-srcset') }}
{# https://test.imgix.net/dir/test.png?h=60&w=120 100w, https://test.imgix.net/dir/test.png?h=90&w=180 500w #}

{{ imgix_html($html, 'my_blur_lazyload_filter') }}
{# ... replaces all images with responsive ones #}
```

### Multiple cdn configurations

[](#multiple-cdn-configurations)

The image path will be evaluate against the configurations, from top to bottom, until a suitable match is found. Multiple domains can be specified for the same configuration (domain sharding).

```
sparwelt_imgix:
  cdn_configurations:
        # matches images with source domain 'mysite.com' (including subdomains)
        # AND path beginning with 'uploads/' OR 'media/'
        # Relative urls won't match
        source_domains_and_pattern:
            cdn_domains: ['my-cdn-1.imgix.net']
            source_domains: ['mysite.com']
            path_patterns: ['^[/]uploads/', '^[/]media/']

        # matches images with source domain exactly 'www3.mysite.com' OR 'www4.mysite.com'
        # Relative urls won't match
        source_sub_domain:
            cdn_domains: ['my-cdn-2.imgix.net']
            source_domains: ['www3.mysite.com', 'www4.mysite.com']

        # matches images with source domain 'mysite.com' (including subdomains)
        # Relative urls won't match
        source_domains:
            cdn_domains: ['my-cdn-3.imgix.net']
            source_domains: ['mysite.com']

        # matches images with source domain 'mysite.com' (including subdomains)
        # AND relative urls (because of the 'null')
        source_domains_and_null:
            cdn_domains: ['my-cdn-4.imgix.net']
            source_domains: ['mysite.com', null]

        # matches relative urls only, where path begins with 'uploads/'.
        # Absolute urls won't match.
        pattern:
            cdn_domains: ['my-cdn-5.imgix.net']
            path_patterns: ['^[/]pattern/']

        # matches relative urls only, where path begins with 'sign-key/'.
        # appends sign-key to the generated url (recommended)
        sign_key:
            cdn_domains: ['my-cdn-6.imgix.net']
            path_patterns: ['[^]/sign-key/']
            sign_key: '12345'

        # matches relative urls only, where path begins with 'shard-crc/'.
        # Will choose the cdn domains by the hash of the path (recommended)
        shard_crc:
            cdn_domains: ['my-cdn-7.imgix.net', 'my-cdn-8.imgix.net']
            path_patterns: ['^[/]shard-crc/']
            shard_strategy: 'crc' #default

        # matches relative urls only, where path begins with 'shard-cycle/'.
        # Will rotate between the 2 cdn domains (increase costs)
        shard_cycle:
            cdn_domains: ['my-cdn-9.imgix.net', 'my-cdn-10.imgix.net']
            path_patterns: ['^[/]shard-cycle/']
            shard_strategy: 'cycle'

        # default parameters can be added, useful for cache bursting or automatic formatting
        default_parameters:
            cdn_domains: ['my-cdn-11.imgix.net']
            path_patterns: ['^[/]shard-cycle/']
            default_query_params:
              cb: '1234'
              auto: 'quality'

        # disable parameters generation
        # (useful for development/testing environments)
        bypass_dev:
            cdn_domains: ['my-dev-domain.local']
            source_domains: ['my-dev-domain.local']
            generate_filter_params: false,
            use_ssl: false

        # matches all relative urls
        my_default:
            cdn_domains: ['my-cdn-12.imgix.net']
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~22 days

Recently: every ~106 days

Total

24

Last Release

2386d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/06d2f80d221762b9ad79bdbb54d1d1cc216408fbb012e8b553838f6f4d106481?d=identicon)[federico.infanti](/maintainers/federico.infanti)

---

Top Contributors

[![finfa](https://avatars.githubusercontent.com/u/4535128?v=4)](https://github.com/finfa "finfa (1 commits)")[![martianlife](https://avatars.githubusercontent.com/u/44425873?v=4)](https://github.com/martianlife "martianlife (1 commits)")

### Embed Badge

![Health badge](/badges/sparwelt-imgix-bundle/health.svg)

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

###  Alternatives

[goat1000/svggraph

Generates SVG graphs

133890.0k3](/packages/goat1000-svggraph)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

12644.1k2](/packages/gravatarphp-gravatar)

PHPackages © 2026

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