MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /home/cafsindia/lms_cafsinfotech_in/application/libraries/Resize_image.php
<?php


class resize_image
{
    private $CI;

    public function __construct()
    {
        $this->CI =& get_instance();
        $this->CI->load->library('image_lib');
    }

    public function resize_to_thumb($image_full_path, $image_resize_to) 
    {
       $configer = array(
                            'image_library'   => 'gd2',
                            'source_image'    => $image_full_path,
                            'create_thumb'    => FALSE,
                            'maintain_ratio'  => FALSE,
                            'width'           => 231,
                            'height'          => 130,
                            'new_image'       => $image_resize_to,
                        );
        $this->CI->image_lib->clear();
        $this->CI->image_lib->initialize($configer);
        if($this->CI->image_lib->resize())
        {
             return TRUE;
        }
        else
        {
            
            return FALSE;
        }

    }



    public function resize_to_small($image_full_path, $image_resize_to) 
    {
       $configer = array(
                            'image_library'   => 'gd2',
                            'source_image'    => $image_full_path,
                            'create_thumb'    => FALSE,
                            'maintain_ratio'  => TRUE,
                            'width'           => 670,
                            'height'          => 400,
                            'new_image'       => $image_resize_to,
                        );
        $this->CI->image_lib->clear();
        $this->CI->image_lib->initialize($configer);
        if($this->CI->image_lib->resize())
        {
             return TRUE;
        }
        else
        {
            
            return FALSE;
        }

    }



    public function resize_to_medium($image_full_path, $image_resize_to) 
    {
       $configer = array(
                            'image_library'   => 'gd2',
                            'source_image'    => $image_full_path,
                            'create_thumb'    => FALSE,
                            'maintain_ratio'  => TRUE,
                            'width'           => 750,
                            'height'          => 466,
                            'new_image'       => $image_resize_to,
                        );
        $this->CI->image_lib->clear();
        $this->CI->image_lib->initialize($configer);
        if($this->CI->image_lib->resize())
        {
             return TRUE;
        }
        else
        {
            
            return FALSE;
        }

    }


    

}