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

[eluser]Unknown[/eluser]
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?
#2

[eluser]Bramme[/eluser]
you'll have to do the calculations yourself...
Code:
$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