how to check width and height of image before resize |
[eluser]Tống Kiện Phi[/eluser]
In the example Image Manipulation Class i saw this code: Code: $config['image_library'] = 'gd2'; Now, i want to check size image if width more than 150px it's must resize, on the contrary not resize
[eluser]NotDior[/eluser]
http://php.net/getimagesize - Would be your best bet.
[eluser]memVN[/eluser]
Ok When you was uploaded success - function upload will return an array as $upload = $this->upload->data(); In array $upload you has key $upload['width']; So in order to check width before resize you can do like if($upload['width'] > 150) { //Do resize } |
Welcome Guest, Not a member yet? Register Sign In |