This extension helps you resize and crop an image as the following :
- get the largest area from the original image that fit the desired cropping rectangle ratio.
- crop that area from the original image.
- resize it to fit the desired cropping rectangle width/height.
- save the cropped image in JPEG format with specified quality number.
- Yii 1.0 or above
- Extract the release file under
See the following code example:
Yii::import('application.extensions.imagecropper.ImageCropper'); $cropper=new ImageCroppe; //The following will create an JPEG image with height of 100 and width of 100 and 80 jpeg quality. $cropper->resize_and_crop($original_image_path, $dist_image_path, 100, 100, 80 );
Change Log ¶
February 14, 2010 ¶
- Initial release.