
Details
Image manipulation PHP script suits for modern ecommerce, creative and more websites to manipulate images with following features
- Resize and crop
- Watermarking
- Various image sizes and ratio
- Progressive JPEG
- Configurable image quality for each size
- Based on Queue Process
System Requirements:
- ubuntu 14.04
- ImageMagick-7.0.4
- Jpegtran 1.4.2
- PHP >= 5.4
- Supervisor
- Redis
Benefits:
- It handle loads because it's queue based background image manipulation
- Highly scalable
- Clean Code
- Watermarking and Positioning
Installation Instructions:
Installation ImageMagick:
- sudo apt-get update
- sudo apt-get install build-essential checkinstall libx11-dev libxext-dev zlib1g-dev libpng12-dev libjpeg-dev libfreetype6-dev libxml2-dev
- sudo apt-get build-dep imagemagick
- cd /tmp/
- tar -xzvf ImageMagick-7.0.4-5.tar.gz
- cd ImageMagick-7.0.4-5/
- sudo ./configure
- sudo checkinstall
- sudo ldconfig /usr/local/lib
Jpeg tran for Progressive JPEG (Installation)
- sudo apt-get install libjpeg-turbo-progs
Application Setup
- Check out the code
- Do composer install with following command
composer install
- Rename src/PckImageProcessor/Config/config.sample.php to config.php and update configuration of s3 and image sizes and if needed then give watermark image absolute path.
Then setup supervisor to watch deamon process example configuration as follows
[program:image-worker]
process_name=%(programname)s%(process_num)02d
command=php app.php image:process
autostart=true
autorestart=true
user=www-data
numprocs=5
redirect_stderr=true
stdout_logfile=/var/log/image-worker.log
- it use redis as queue so that you must give credentials to config.php file
- Whenever image has been uploaded then need to push the data to redis as follows
$redis->lPush('IMAGE-PROCESS', '{"filename": "purple_sunset-wallpaper-960x600.jpg", "folder":"image-processor-demo/sample"}');
- Any help feel free to add support comment here.
Version History
Released On: November 20, 2017
Question or Comment