Welcome Guest, Not a member yet? Register   Sign In
Resize image only when it is too big

I want to resize image only when it is to big, and leave it unchanged, when width and height are proper. How can I do this using CI Image library?

you'll have to do the calculations yourself...
$image_url = '/myimage.jpg';
$max_size = 500px;

list($width, $height, $t, $i) = getimagesize($image_url);
if($width > $max_size || $height > $max_size) {
    // use image lib

Theme © iAndrew 2016 - Forum software by © MyBB