spescina/imgproxy
Larablocks Analysis
spescina/imgproxy works with Laravel 4 (latest release 2.1.6, Oct 14, 2014), which reached end of life: no more fixes, even for security.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 4, past end of life
- No release in the last 12 months (last: Oct 14, 2014)
- 2 downloads a month (needs 10,000)
- 20 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Oct 14, 2014.
- No releases in the last 12 months.
- First released: Apr 10, 2014.
- Monthly downloads: 2.
- 5 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.
| Install | |
|---|---|
composer require spescina/imgproxy |
|
| Latest Version: | 2.1.6 |
| PHP: | >=5.3.0 |
| Laravel: | 4 |
| License: | MIT |
| Last Updated: | Oct 14, 2014 |
| Links: | GitHub · Packagist |
ImageProxy
Laravel 4 package for image cropping and resizing on the fly. It uses Timthumb under the hood.
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
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
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
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- Iffalsequerystring uri are generated instead of pretty ones
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
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;
}
}
Alternatives to spescina/imgproxy
On-the-fly image renditions for Laravel: presets, signed URLs and responsive var...
An advanced image field for Nova with cropping and resizing.
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 2.1.6 | >=5.3.0 | 4.x | MIT | |
| 2.1.5 | >=5.3.0 | 4.x | MIT | |
| 2.1.4 | >=5.3.0 | 4.x | MIT | |
| 2.1.3 | >=5.3.0 | 4.x | MIT | |
| 2.1.2 | >=5.3.0 | 4.x | MIT | |
| 2.1.1 | >=5.3.0 | 4.x | MIT | |
| 2.1.0 | >=5.3.0 | 4.x | MIT | |
| 2.0.2 | >=5.3.0 | 4.x | MIT | |
| 2.0.1 | >=5.3.0 | 4.x | MIT | |
| 2.0.0 | >=5.3.0 | 4.1.* | MIT | |
| 1.0.2 | >=5.3.0 | 4.1.* | MIT | |
| 1.0.1 | >=5.3.0 | 4.1.* | ||
| 1.0.0 | >=5.3.0 | 4.1.* |
