Yii 1.1: imagecropper

Image Cropper extension
3 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 2 comments

#17894 report it
Delphine at 2014/08/07 09:59am
Too light

This documentation is too light for newbies, like me..

Don't know if we can pass coordonates : x, y.

For me : Crop means a part of picture (X, Y required) Resize means keeping the entier image but, reducing its size (width, height)

Can't find, if we can "crop"..

#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
  • Yii Version: 1.1
  • License: New BSD License
  • Developed by: phiras
  • Category: Others
  • Votes: +2
  • Downloaded: 827 times
  • Created on: Feb 14, 2010
  • Last updated: Feb 14, 2010