I want to accomplish this in CodeIgniter specifically.
The PHP application that I am coding allows the user to upload either a jpg or an animated gif. In the next step, I want to allow the user to use jCrop to crop thumbnails of different sizes. This will require me to convert a new copy of the animated gif to jpg. My code works fine with uploaded jpg images, but it creates a broken image for gif files. Am I trying to do this?
My code is:
$config['image_library'] = 'ImageMagick';
$config['library_path'] = '/usr/bin';
$config['source_image'] = $this->config->item('upload_dir_path') . $file_path . 'original.' . $file_ext;
chmod($config['source_image'], 0777);
$config['new_image'] = $this->config->item('upload_dir_path') . $file_path . 'crop-me.jpg';
$this->image_lib->initialize($config);
$this->image_lib->resize();
Chris source
share