CodeIgniter Forums
Thumnail/blur image - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Thumnail/blur image (/showthread.php?tid=64348)



Thumnail/blur image - Chandini - 02-10-2016

Hi To all
.. I am Convert the Base64 encoded string into image .It is done. after that Image Stored In server ... After Converting the image .. I want To create the blur image And Thumbnail for that Server Path Image.. And that blue /thumnail Images Stored in to server again .. I am Wring The Code . but its Not Working .. Please Check My Code .. And give Your Valuable Suggestions Thanks


$image_string = $this->post('image_string');
$image_name = date('d-m-yh:iConfused').'.jpg';
header('Content-type : bitmap; charset=utf8');
$decoded_string_image = base64_decode($image_string);
$path1 = FCPATH.'assets/chat_posts/'.$image_name;
$file1 = fopen($path1,'wb');
$is_written = fwrite($file1, $decoded_string_image);
fclose($file);
if($is_written>0)
{
$source_path = base_url().'assets/chat_posts/'.$image_name;
$target_path = FCPATH.'assets/localposts_string_check/'.$image_name;

$this->load->library('image_lib');
$config['image_library'] = 'gd2';
$config['source_image'] = $source_path;
$config['create_thumb'] = TRUE;
$config['maintian_ratio'] = TRUE;
$config['width'] = 100;
$config['height'] = 100;
$config['new_image'] = $target_path;
$this->load->library('image_lib', $config);
$this->image_lib->resize();


}