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.
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.
Mistake found
$cropper =new ImageCropper; //with r
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"..
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.