imagecropper

Image Cropper extension
2 followers

This extension helps you resize and crop an image as the following :

  1. get the largest area from the original image that fit the desired cropping rectangle ratio.
  2. crop that area from the original image.
  3. resize it to fit the desired cropping rectangle width/height.
  4. save the cropped image in JPEG format with specified quality number.

Documentation

Requirements

  • Yii 1.0 or above

Installation

  • Extract the release file under protected/extensions

Usage

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.

Total 1 comment

#13065 report it
Dimanus at 2013/05/01 04:31am
Mistake found
$cropper =new ImageCropper; //with r

Leave a comment

Please to leave your comment.

Create extension
  • License: New BSD License
  • Developed by: phiras
  • Category: Others
  • Votes: +2
  • Downloaded: 704 times
  • Created on: Feb 14, 2010
  • Last updated: Feb 14, 2010