Extra Light PHP Framework

Image

Content

Load the library

$this->load_library('image');

Set

$this->image->set('./images/image.jpg');

Resize

$maintain_ratio = true; $this->image->resize(100, 100, $maintain_ratio);

Align

$on_x = 5; $on_y = 10; $this->image->align(100, 100, $on_x, $on_y);

Crop

$on_x = 'right'; // right, center, left $on_y = 'up'; // up, middle, down $this->image->crop(100, 100, $on_x, $on_y);

Mask

$path_to_mask = './images/mask.png'); $this->image->mask($path_to_mask);

Watermark

$path_to_watermark = './images/watermark.png'); $on_x = 'right'; // right, center, left $on_y = 'up'; // up, middle, down $this->image->mask($path_to_watermark, $on_x, $on_y);

Save

$path_to_new_file = './iamges/new_image.jpg'; $quality = 100; $this->image->save($path_to_new_file, $quality);