How can you put all that in one callback after upload function?
Note that you will have different upload buttons, one for each pic (as each goes to a column in the table of the database)
This does not work. Using two different callback after upload functions, it will endup resizing the thumb to the size of the pic. If I put all the commands in one function, the result is the opposite. the pic is resized to the size of the thumb
$crud->set_field_upload('thumb_a','assets/uploads/thumbs');
$crud->callback_after_upload(array($this,'resizethumb'));
$crud->set_field_upload('pic1','assets/uploads/pics');
$crud->callback_after_upload(array($this,'resizepic'));
$output = $crud->render();
$this->_example_output($output);
}
function resizethumb($uploader_response,$field_info, $files_to_upload)
{
//Is only one file uploaded so it ok to use it with $uploader_response[0].
$thumb_uploaded = $field_info->upload_path.'/'.$uploader_response[0]->name;
$this->image_moo->load($thumb_uploaded)->resize(100,100)->save($thumb_uploaded,true);
return true;
}
function resizepic($uploader_response,$field_info, $files_to_upload)
{
$pic_uploaded = $field_info->upload_path.'/'.$uploader_response[0]->name;
$this->image_moo->load($pic_uploaded)->resize(630,400)->save($pic_uploaded,true);
return true;
}