<? function resize_image($path, $path_image) { $CI = & get_instance(); $config = array(); $config['image_library'] = 'ImageMagick'; $config['source_image'] = $path; //full path $config['new_image'] = $path_image.'new_image.jpg'; $config['create_thumb'] = TRUE; // ставим флаг создания эскиза $config['maintain_ratio'] = TRUE; // сохранять пропорции $config['width'] = 200; // и задаем размеры $config['height'] = 200; $CI->load->library('image_lib'); $CI->image_lib->initialize($config); if ( ! $CI->image_lib->resize()) { echo $CI->image_lib->display_errors(); die(); } $CI->image_lib->clear(); }?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)