BTW, I need a little help:
I’m using jcrop to send the coordinates to crop the image. It works fine. The problem is that after cropping it I need to resize it to 150, 150.
He is my crop_thumbnail function:
function crop_thumbnail($id_artists) {
$this->load->library('image_moo');
$this->image_moo
->load($this->input->post('filetocrop'))
->crop($this->input->post('x'), $this->input->post('y'), $this->input->post('x2'), $this->input->post('y2'))
->save_pa("", "_thumb", TRUE);
if ($this->image_moo->errors)
print $this->image_moo->display_errors();
}
If I use:
$this->image_moo
->load($this->input->post('filetocrop'))
->crop($this->input->post('x'), $this->input->post('y'), $this->input->post('x2'), $this->input->post('y2'))
->resize(150,150),
->save_pa("", "_thumb", TRUE)
It resizes the orignal image, not the crop.
My idea was to load another instance of image moo and then resize the new thumb file, but since I’m using save_pa and appending ‘_thumb’ to the file, how to retrieve the new thumb file name before resizing it? Is there any easy way to get the new thumb file name? Or I would need a regex to take the extension out then add_thumb to the name and concatenate with the extension again?
Thanks