mrcnpdlk / image-web-tool
Image Web Manipulator
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=7.0
- ext-imagick: *
- hassankhan/config: ~0.11.2
- imagine/imagine: ~0.7.1
- mrcnpdlk/pfc-adapter: ~0.1.0
- roave/security-advisories: dev-master
- slim/slim: ~3.9.2
This package is not auto-updated.
Last update: 2024-12-09 22:10:49 UTC
README
Simple image web tool manipulation package - other than all.
Instalation
The best way is cloning the repo with specific branch name. Stable releases are sown here.
git clone -b {STABLE_VERSION} https://github.com/mrcnpdlk/image-web-tool.git
Configuration
In folder config copy file config.json.dist
and rename to config.json
.
Edit file and set or delete options:
storage
- path to the folder with picturesfont
- path to the ttf file with font. Used as font on placeholders files.debug
- if TRUE no placeholder, but exception stack is shown.
Default font BlowBrush is included to the project.
Caching
For better performance for each request cache is used. REDIS if enabled. If not FILES is used.
Request url schema
Example
http://example.com/iwt/v1/{params}/{fileName}
params
and fileName
are passed to the api.php file.
Request Options (params
)
Nginx Configuration
server {
listen 127.0.0.1:9081 default_server;
root API_DIR_LOCATION;
index api.php;
server_name _;
location / {
try_files $uri $uri/ /api.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}
server {
## LISTEN
listen 81;
## SERVER
server_name example.com;
root ROOT_DIR;
index index.php index.html index.htm index.nginx-debian.html;
location /iwt/v1 {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
rewrite ^/iwt/v1/?(.*) /$1 break;
access_log /var/log/nginx/iwt-access.log;
error_log /var/log/nginx/iwt-error.log;
proxy_pass http://127.0.0.1:9081;
proxy_redirect off;
}
Examples
/h_100/demo.jpg
Height is set. Default FIT crop mode is enabled.
/h_200,e_b,eo_5/demo.jpg
Blur effect.
/h_200,e_b,eo_5/demo.jpg
Colorization effect with pink color.
/h_200,e_n/demo.jpg
Negative effect.
/h_200,q_2/demo.jpg
Less quality.
/h_200,w_200,c_fill/demo.jpg
FILL mode.
/h_200,w_200,c_fit/demo.jpg
FIT mode.
/h_200,w_200,c_fit-margin/demo.jpg
FIT MARGIN mode.
/h_200,w_200,r_20/demo.jpg
ROTATE mode.
/w_200,h_100/demo.jpg
File not found. Placeholder is shown.
/w_200,h_100/demo.jpg
Placeholder is shown.