PHPackages                             crocodile2u/imgproxy-php - 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. crocodile2u/imgproxy-php

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

crocodile2u/imgproxy-php
========================

URL generator for darthsim/imgproxy

v2.0.6(1y ago)39141.3k↓12.9%14[2 PRs](https://github.com/crocodile2u/imgproxy-php/pulls)MITPHPPHP &gt;=7.3

Since Mar 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/crocodile2u/imgproxy-php)[ Packagist](https://packagist.org/packages/crocodile2u/imgproxy-php)[ RSS](/packages/crocodile2u-imgproxy-php/feed)WikiDiscussions master Synced 1mo ago

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

URL generator for darthsim/imgproxy
===================================

[](#url-generator-for-darthsimimgproxy)

See .

> STARTING FROM v2.0 imgproxy-php supports advanced URL generation. See below.
> **imgproxy-php** v2.0 is fully backwards compatible with v1.0, you should not have any issues with upgrading.
> If those issues still occur with you, you're welcome to file a bug report, and even more welcome to create a pull request.

This is a small package which allows for generating URLs for your images that are resized by imgproxy:

```
$builder = new UrlBuilder("http://localhost:8080", "< your HEX key >", "< you HEX salt >");

// Generate imgproxy URL for an image, resizing to 300x200 with default settings (*)
$url = $builder->build("http://myimages.localhost/cats.jpg", 300, 200);

// By default, the URL is generated in basic mode
echo $url->toString();

// Customize URL params
$url->setFit("fill")
  ->setWidth(1200)
  ->setHeight(1200)
  ->setGravity("no")
  ->setEnlarge(true);

// switch to advanced URL mode with tons of extra features, superior to the basic mode:
$url->useAdvancedMode();

// set processing options:
$url->options()->withDpr(2)/* -> chain more with() calls -> ... */;

echo $url->toString();
```

(\*) default settings:

- Mode: basic (apparently, basci mode is deprecated by imgproxy and possibly will be removed in future release)
- Fit: *fit*
- Gravity: *sm* (smart)
- Enlarge: 0 (do not enlarge images)

Please refer to imgproxy docs for parameter descriptions and possible values.

Imgproxy PRO features
=====================

[](#imgproxy-pro-features)

Certain features of Imgproxy are only available in the PRO version. Please refer to the docs [https://docs.imgproxy.net/generating\_the\_url\_advanced](https://docs.imgproxy.net/generating_the_url_advanced) and make notice of the `PRO` label on certain processing options. **Using those options on a regular (non-PRO) instance of Imgproxy will result in "Invalid URL" response**.

Testing in "real life"
======================

[](#testing-in-real-life)

In the root folder you will find `docker-compose.yml` file which will start `imgproxy` instance on port 8080. There is also a composer script `generate` with parameters:

- base : string base URL
- key : string IMGPROXY\_KEY
- salt : string IMGPROXY\_SALT
- source : string source image URL
- width : int width
- height : int height
- advanced (no value required)

Once you started your local docker-compose stack with `docker-compose up`, you may call this script with the following command:

```
composer run-script generate -- \
  --base  \
  --source  \
  --key  \
  --salt
  --width  \
  --height  \
  --advanced

# example:
composer run-script generate -- \
  --base http://localhost:8080 \
  --source http://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Cailliau_Abramatic_Berners-Lee_10_years_WWW_consortium.png/330px-Cailliau_Abramatic_Berners-Lee_10_years_WWW_consortium.png \
  --key 943b421c9eb07c830af81030552c86009268de4e532ba2ee2eab8247c6da0881 \
  --salt 520f986b998545b4785e0defbc4f3c1203f22de2374a3d53cb7a7fe9fea309c5
```

Hear, the KEY &amp; SALT are valid for the imgproxy instance started by provided `docker-compose.yml`. You can also test URL generation for arbitrary custom imgproxy installation by providing relevant `base`, `key` &amp; `salt`. Happy testing!

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 51.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 ~159 days

Recently: every ~268 days

Total

14

Last Release

537d ago

Major Versions

v1.2.0 → v2.0-RC12021-09-10

PHP version history (2 changes)v1.1.2PHP &gt;=7.2

v2.0-RC1PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/842b8cd849df1fb1ce8258823b21ce1816ca52f026a68da26562d9d83854ca19?d=identicon)[crocodile2u](/maintainers/crocodile2u)

---

Top Contributors

[![crocodile2u](https://avatars.githubusercontent.com/u/1736820?v=4)](https://github.com/crocodile2u "crocodile2u (17 commits)")[![loco8878](https://avatars.githubusercontent.com/u/7300248?v=4)](https://github.com/loco8878 "loco8878 (4 commits)")[![peterjaap](https://avatars.githubusercontent.com/u/431360?v=4)](https://github.com/peterjaap "peterjaap (4 commits)")[![windstep](https://avatars.githubusercontent.com/u/51027899?v=4)](https://github.com/windstep "windstep (3 commits)")[![ricardogama](https://avatars.githubusercontent.com/u/8616978?v=4)](https://github.com/ricardogama "ricardogama (2 commits)")[![spantaleev](https://avatars.githubusercontent.com/u/388669?v=4)](https://github.com/spantaleev "spantaleev (2 commits)")[![adampatterson](https://avatars.githubusercontent.com/u/31537?v=4)](https://github.com/adampatterson "adampatterson (1 commits)")

---

Tags

urlgeneratorimgproxydarthsim

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/crocodile2u-imgproxy-php/health.svg)

```
[![Health](https://phpackages.com/badges/crocodile2u-imgproxy-php/health.svg)](https://phpackages.com/packages/crocodile2u-imgproxy-php)
```

###  Alternatives

[multiavatar/multiavatar-php

Multicultural Avatar Generator

653150.0k4](/packages/multiavatar-multiavatar-php)[jkphl/iconizr

A PHP command line tool for converting SVG images to a set of CSS icons (SVG &amp; PNG, single icons and / or CSS sprites) with support for image optimization and Sass output

4869.0k](/packages/jkphl-iconizr)[maximal/audio-waveform

Audio waveform generator on PHP with SoX

5257.9k](/packages/maximal-audio-waveform)[onliner/imgproxy-php

ImgProxy url builder for PHP

26186.9k4](/packages/onliner-imgproxy-php)[ambroisemaupate/intervention-request

A customizable Intervention Image wrapper to use image simple re-sampling features over urls and a configurable cache.

4242.4k2](/packages/ambroisemaupate-intervention-request)[standaniels/image-generator

A package to generate random images.

1696.6k1](/packages/standaniels-image-generator)

PHPackages © 2026

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