alishahidi/image-rend-php

v1.2.0 2023-01-11 09:21 UTC

This package is auto-updated.

Last update: 2024-11-11 13:10:27 UTC


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

  1. name => post input name or file path
  2. directory => root directory for save image
  3. 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

  1. width
  2. height

use

$imageManager->resize(250, 340);

fit

Note

fit image size

argvs

  1. width
  2. height

use

$imageManager->fit(250, 340);

watermark

Note

add watermark to image

argvs

  1. path of watermark image
  2. width
  3. height
  4. pos:’bottom-right’
  5. x:20
  6. y:20

use

$imageManager->watermark("watermark.jpg", 200, 300);

text

Note

add text watermark

argvs

  1. text
  2. x:20
  3. y:20
  4. fontFile:’fonts/Roboto-Regular.ttf’
  5. size:24
  6. color:#ffffff
  7. pos:’bottom-right’
  8. angle:0

use

$imageManager->text("alishahidinet.ir");

save

Note

save image instance

argvs

  1. name:”
  2. quality:42
  3. format:jpg
  4. unique:false

use

$imageManager->save();