Skip to content

aivazoff/image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Image Resize and Crop

Example

if($normalize = !$cropMode) {
    $cropMode = Image::RESIZE_MODE_NORMALIZE;
}

$image = new ImageFromFile($imagePath);

if(!$w) {
    $image->resizeByHeight($h, $normalize);
} else if(!$h) {
    $image->resizeByWidth($w, $normalize);
} else {
    $image->resize($w, $h, $cropMode);
}

$image->output();