Code: Select all
$image = new Imagick('origional.jpg');
$image->stripImage();
$image->setImageCompression(imagick::COMPRESSION_JPEG);
if($image->getImageHeight() <= $image->getImageWidth()) {
$image->resizeImage(800,0, imagick::FILTER_POINT, 1);
} else {
$image->resizeImage(0,800, imagick::FILTER_POINT, 1);
}
$image->setImageCompressionQuality(70);
$image->writeImage('large.jpg');
if($image->getImageHeight() <= $image->getImageWidth()) {
$image->resizeImage(190,0, imagick::FILTER_POINT, 1);
} else {
$image->resizeImage(0,190, imagick::FILTER_POINT, 1);
}
$image->setImageCompressionQuality(70);
$image->writeImage('thumb.jpg');
$image->destroy();
Code: Select all
$image = new Imagick();
$image->setSize(800, 532);
$image->readImage('origional.jpg');