dev-master
9999999-devSmart cropping images with PHP
MIT
The Requires
- php >=5.3.0
- ext-imagick *
Wallogit.com
2017 © Pedro Peláez
Smart cropping images with PHP
Another quick project written as part of a larger one. This library takes an Imagick object and crops the image using a given cropping strategy., (*1)
CropBuddy modifies your Imagick objects in place. It can resize and/or crop images to given dimensions., (*2)
Included strategies are:, (*3)
<?php $strategy = new \Rych\CropBuddy\Strategy\EntropyStrategy(); $cb = new \Rych\CropBuddy\CropBuddy($myImagickObject, $strategy); // Resize the image to either a height or width of 150px // A 600x300 image will end up at 300x150 $cb->resize(150, 150); // Square the image to 150x150 $cb->crop(150, 150);
Composer:, (*4)
composer require rych/cropbuddy:dev-master@dev
Add more strategies and write unit tests., (*5)
Smart cropping images with PHP
MIT