free hit counter

Image Resize Component for CakePHP

image resize with aspect ratio in CakePHP

Installation

Place the above script in a file named ImgResizerComponent.php within your app/controllers/components/ directory. Next, simply add ‘ ImgResizer‘ to your controller’s component property.

image resize with aspect ratio in php

image resize with aspect ratio in php

 

 

 

 

 

 

 

ImgResizer Component Download Link 

Example

  1. $image = WWW_ROOT . ’img/myimage.png’;  
  2. $w=100;  
  3. $h=100;  
  4. $this->ImgResizer->set_image($w,$h,$image );  

Leave a Reply