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

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

spescina/imgproxy
=================

An image proxy for Laravel

2.1.6(11y ago)201.3k2[5 issues](https://github.com/spescina/imgproxy/issues)MITPHPPHP &gt;=5.3.0

Since Apr 10Pushed 11y ago1 watchersCompare

[ Source](https://github.com/spescina/imgproxy)[ Packagist](https://packagist.org/packages/spescina/imgproxy)[ RSS](/packages/spescina-imgproxy/feed)WikiDiscussions master Synced 3d ago

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

[![Build Status](https://camo.githubusercontent.com/0cb4ea6243797e60291c544da631033fac2ca3ded5c4770e335188baa34f3b98/68747470733a2f2f7472617669732d63692e6f72672f7370657363696e612f696d6770726f78792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/spescina/imgproxy?branch=master)[![Coverage Status](https://camo.githubusercontent.com/090657dc47e8e5c7501a07c6068dd64f617a194ddf1cf3f528c5d8e0c5f70b9d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7370657363696e612f696d6770726f78792f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/spescina/imgproxy?branch=master)

ImageProxy
==========

[](#imageproxy)

Laravel 4 package for image cropping and resizing on the fly. It uses Timthumb under the hood.

Install &amp;&amp; Usage
------------------------

[](#install--usage)

Add in `composer.json`

```
"require": {
    "spescina/imgproxy": "2.x"
}

```

Run `composer update`

Add the service provider in the `app/config/app.php` file

```
"Spescina\Imgproxy\ImgproxyServiceProvider"

```

Publish the package assets running `php artisan asset:publish spescina/imgproxy`

Publish the package config running `php artisan config:publish spescina/imgproxy`

ImageProxy is configured to use Apache by default. If you are using nginx, add the following to your site configuration file:

```
rewrite ^/packages/spescina/imgproxy/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/(.*) /packages/spescina/imgproxy/timthumb.php?w=$1&h=$2&zc=$3&q=$4&src=$5;

```

Use the package facade to generate the resource url

```
ImgProxy::link("path/to/image.jpg", 100, 80)

```

This will generate a link like this

```
http://www.yourdomain.com/packages/spescina/imgproxy/100/80/path/to/image.jpg

```

that generates an image with dimensions 100 x 80 using the original `image.jpg` stored in the `public/path/to` folder.

Parameters
----------

[](#parameters)

The `link` function accepts 5 paramaters

- **image path**
- **width**
- **height**
- **quality** - optional \[0..100\] - Default: 90
- **zoom/crop** - optional \[0,1,2,3\] - Default: 1

### Zoom/Crop

[](#zoomcrop)

These are the supported values

- 0 - Resize to Fit specified dimensions (no cropping)
- **1** - Crop and resize to best fit the dimensions (default)
- **2** - Resize proportionally to fit entire image into specified dimensions, and add borders if required
- **3** - Resize proportionally adjusting size of scaled image so there are no borders gaps

Config
------

[](#config)

### Package config

[](#package-config)

After publishing the package config file it's possible to change the package behaviour in the `app/config/packages/spescina/imgproxy/config.php` file.

These are the current options:

- **rewrite** - Default: `true` - If `false` querystring uri are generated instead of pretty ones

### Timthumb config

[](#timthumb-config)

It's possible to edit timthumb config in the `public/packages/spescina/imgproxy/timthumb-config.php` file.

These, at the moment, are the default values

```
define ("DEBUG_ON", false);

define ("DEBUG_LEVEL", 3);

define ("FILE_CACHE_MAX_FILE_AGE", 86400);

define ("FILE_CACHE_SUFFIX", ".imgproxy.cache");

define ("FILE_CACHE_PREFIX", "");

define ("FILE_CACHE_DIRECTORY", "../../../../app/storage/cache/imgproxy");

define ("NOT_FOUND_IMAGE", "./nophoto.gif");

define ("ERROR_IMAGE", "./nophoto.gif");

define ("PNG_IS_TRANSPARENT", FALSE);

define ("DEFAULT_Q", 90);

```

Full nginx example for Laravel Forge
------------------------------------

[](#full-nginx-example-for-laravel-forge)

```
server {
    rewrite_log on;

    listen 80;
    server_name my_site.com;
    root /home/forge/my_site.com/public;

    auth_basic "Restricted";
    auth_basic_user_file /home/forge/my_site.com/public/.htpasswd;

    # FORGE SSL (DO NOT REMOVE!)
    # ssl on;
    # ssl_certificate;
    # ssl_certificate_key;

    index index.html index.htm index.php;

    charset utf-8;

    location / {
        rewrite ^/packages/spescina/imgproxy/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/(.*) /packages/spescina/imgproxy/timthumb.php?w=$1&h=$2&zc=$3&q=$4&src=$5;
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/my_site.com-error.log error;

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }
}

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 91.2% 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 ~15 days

Recently: every ~45 days

Total

13

Last Release

4231d ago

Major Versions

1.0.2 → 2.0.02014-04-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/1da812cfabeba8d2a2a658ffa61204f0e5ccbb70dc3b81fc6cebf0eb28f8f73f?d=identicon)[simonpex](/maintainers/simonpex)

---

Top Contributors

[![spescina](https://avatars.githubusercontent.com/u/1956604?v=4)](https://github.com/spescina "spescina (52 commits)")[![benallfree](https://avatars.githubusercontent.com/u/1068356?v=4)](https://github.com/benallfree "benallfree (5 commits)")

---

Tags

laravelproxyimagecropResizer

### Embed Badge

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

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

###  Alternatives

[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M102](/packages/intervention-image-laravel)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[ctessier/nova-advanced-image-field

An advanced image field for Nova with cropping and resizing.

103548.4k1](/packages/ctessier-nova-advanced-image-field)[reliqarts/laravel-guided-image

Simplified and ready image manipulation for Laravel via intervention image.

351.4k](/packages/reliqarts-laravel-guided-image)[ayvazyan10/nova-imagic

Imagic is a Laravel Nova field package that allows for image manipulation capabilities, such as cropping, resizing, quality adjustment, and WebP conversion. It utilizes the powerful Intervention Image class for image manipulation.

144.3k1](/packages/ayvazyan10-nova-imagic)

PHPackages © 2026

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