0

using ImageMagic the cropping can be done easily with below code , but it's impossible to install ImageMagic in the hosting server.so is there any way to do this with only php? need to crop jpg images not png. and how to stop reducing the quality og the image?

$image = new Imagick($inFile);
list($width, $height) = getimagesize($inFile);
$image->cropImage($width,$height-60, -60,0);
$image->writeImage($outFile);

1 Answers1

0

Here is some alternatives for cropping images:

Use composer package intervention\image:

https://packagist.org/packages/intervention/image

Use image manipulation as a service by cloudinary (it's powerful and free/cheap simple image manipulation and storage on cloud):

http://cloudinary.com

Imam Assidiqqi
  • 516
  • 4
  • 20