/ Published in: PHP

If the optional parameter $crop is set to TRUE the image will be zoomed and cropped to specific size ($new_size). Else, the image will be resized to size, keeping aspect ratio and using $new_size as max size.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function image_resize($input_file, $output_file, $new_size=75, $crop=true) { return false; } } } } } else { return false; } if ($original) { } else { return false; } if($crop == true) { } else { } if($crop == true) { } else { $ofx = $ofy = 0; } if($crop == true) { } else { } } else { if($crop == true) { } else { } } imagecopyresampled($small, $original, $ofx, $ofy, 0, 0, $smallwidth, $smallheight, $width, $height); } else { } return true; } } else { return false; } } }
Comments
