php - Image resize not working -
i using following code unable resize image $this->image_lib->resize()
returning true, don't know going wrong:
if(file_exists($_server['document_root']."/uploads/avatars/".str_replace('_','-',$image))) { $config['source_image'] = $_server['document_root']."/uploads/avatars/".str_replace('_','-',$image); } else if (!file_exists("./uploads/avatars/".$image) || $image=="") { $config['source_image'] = $_server['document_root'].'/uploads/avatars/photo.jpg'; } else { $config['source_image'] = $_server['document_root']."/uploads/avatars/".$image; } $config['image_library'] = 'gd2'; $config['create_thumb'] = true; $config['maintain_ratio'] = true; $config['dynamic_output'] = true; $config['width'] = $width; $config['height'] = $height; $this->load->library('image_lib', $config); $this->image_lib->resize();
try new_image tag:
$config['new_image'] = '/path/to/new_image.jpg';
Comments
Post a Comment