alishahidi / image-rend-php
Image library php
v1.2.0
2023-01-11 09:21 UTC
Requires
- intervention/image: ^2.7
- ramsey/uuid: ^4.7
- symfony/filesystem: ^6.2
README
TABLE OF CONTENTS
What is this
method chain php library for easily manage your image from input or file
Usage
require package from composer
composer require alishahidi/image-rend-php
Methods
make
Note
create image instance
argvs
- name => post input name or file path
- directory => root directory for save image
- dateFormat => save image in dateFormat like Y/M/D
use
use Alishahidi\ImageRendPhp\ImageRend; $imageManager = new ImageRend(); $imageManager->make('image.jpg', 'images/', true);
resize
Note
resize image
argvs
- width
- height
use
$imageManager->resize(250, 340);
fit
Note
fit image size
argvs
- width
- height
use
$imageManager->fit(250, 340);
watermark
Note
add watermark to image
argvs
- path of watermark image
- width
- height
- pos:’bottom-right’
- x:20
- y:20
use
$imageManager->watermark("watermark.jpg", 200, 300);
text
Note
add text watermark
argvs
- text
- x:20
- y:20
- fontFile:’fonts/Roboto-Regular.ttf’
- size:24
- color:#ffffff
- pos:’bottom-right’
- angle:0
use
$imageManager->text("alishahidinet.ir");
save
Note
save image instance
argvs
- name:”
- quality:42
- format:jpg
- unique:false
use
$imageManager->save();