Search
 
SCRIPT & CODE EXAMPLE
 

PHP

creating thumbnail in codeigniter

public function do_resize()
{
    $filename = $this->input->post('new_val');
    $source_path = $_SERVER['DOCUMENT_ROOT'] . '/uploads/avatar/tmp/' . $filename;
    $target_path = $_SERVER['DOCUMENT_ROOT'] . '/uploads/avatar/';
    $config_manip = array(
        'image_library' => 'gd2',
        'source_image' => $source_path,
        'new_image' => $target_path,
        'maintain_ratio' => TRUE,
        'create_thumb' => TRUE,
        'thumb_marker' => '_thumb',
        'width' => 150,
        'height' => 150
    );
    $this->load->library('image_lib', $config_manip);
    if (!$this->image_lib->resize()) {
        echo $this->image_lib->display_errors();
    }
    // clear //
    $this->image_lib->clear();
}
Comment

Thumbnail in Codeigniter

public function do_resize()
{
    $filename = $this->input->post('new_val');
    $source_path = $_SERVER['DOCUMENT_ROOT'] . '/uploads/avatar/tmp/' . $filename;
    $target_path = $_SERVER['DOCUMENT_ROOT'] . '/uploads/avatar/';
    $config_manip = array(
        'image_library' => 'gd2',
        'source_image' => $source_path,
        'new_image' => $target_path,
        'maintain_ratio' => TRUE,
        'create_thumb' => TRUE,
        'thumb_marker' => '_thumb',
        'width' => 150,
        'height' => 150
    );
    $this->load->library('image_lib', $config_manip);
    if (!$this->image_lib->resize()) {
        echo $this->image_lib->display_errors();
    }
    // clear //
    $this->image_lib->clear();
}
Comment

PREVIOUS NEXT
Code Example
Php :: wordpress php query randomise 
Php :: ternary operator for three conditions in php 
Php :: the uploaded file exceeds the upload_max_filesize in laravel 
Php :: migration rename column laravel 
Php :: insertgetid laravel 8 
Php :: laravel faker seeder 
Php :: arrow function in php 
Php :: php group multidimensional array by value 
Php :: laravel command parameter optional 
Php :: php string to uppercase 
Php :: php server function 
Php :: create migration with model laravel 8 
Php :: php take picture with mobile camera 
Php :: compare php date with mysql date 
Php :: getting input value in session variable in php 
Php :: blade if array key exists 
Php :: what is the difference between static and dynamic websites? 
Php :: how to pass bearer token in swagger in laravel 
Php :: request file create cammand laravel 
Php :: tableau aléatoire php 
Php :: laravel web php request to redirect to another page 
Php :: laravel multiple group by 
Php :: array to string using php method 
Php :: php foreach alternative syntax 
Php :: string match in php 
Php :: array of dates laravel 
Php :: php unserialize array 
Php :: laravel collection pipe 
Php :: php full form 
Php :: laravel target is not instantiable while building 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =