Jump to content


Heyder

Member Since 05 Jan 2019
Offline Last Active Jan 05 2019 07:53 AM
-----

Posts I've Made

In Topic: Is there any callback available when deleting an uploaded file (not 1 row data)?

05 January 2019 - 07:50 AM

I do not know whether it is right or not, but it worked for me.

Codeigniter/libraries/Grocery_Crud.php  line:1503

add line 

unlink("{$upload_info->upload_path}".'/thumb_directory/thumb-'."{$state_info->file_name}");

I have an original image example.jpg and in accordance with thumbnails thumb-example.jpg


In Topic: create 3 thumbnails from an upload

05 January 2019 - 06:13 AM

error load image 

 

$file_uploaded = $field_info->upload_path.'/'.$uploader_response[0]->name;
$thumbnail1 = $field_info->upload_path.'/thumb1-'.$uploader_response[0]->name;
$thumbnail2 = $field_info->upload_path.'/thumb2-'.$uploader_response[0]->name;
$thumbnail3 = $field_info->upload_path.'/thumb3-'.$uploader_response[0]->name;

$this->image_moo->load($file_uploaded)->resize(800)->save($file_uploaded,true);
$this->image_moo->load($thumbnail1)->resize_crop(150,200)->save($thumbnail1,true);
$this->image_moo->load($thumbnail2)->load_watermark("filename-medium.jpg")->watermark(5)->resize(400,400)->save($thumbnail2,true);
$this->image_moo->load($thumbnail3)->resize(1024)->save($thumbnail3,true);

 

change

 

 

$file_uploaded = $field_info->upload_path.'/'.$uploader_response[0]->name;
$thumbnail1 = $field_info->upload_path.'/thumb1-'.$uploader_response[0]->name;
$thumbnail2 = $field_info->upload_path.'/thumb2-'.$uploader_response[0]->name;
$thumbnail3 = $field_info->upload_path.'/thumb3-'.$uploader_response[0]->name;

$this->image_moo->load($file_uploaded)->resize(800)->save($file_uploaded,true);
$this->image_moo->load($file_uploaded)->resize_crop(150,200)->save($thumbnail1,true);

$this->image_moo->load($file_uploaded)->load_watermark("filename-medium.jpg")->watermark(5)->resize(400,400)->save($thumbnail2,true);

$this->image_moo->load($file_uploaded)->resize(1024)->save($thumbnail3,true);