You can use the Image Manipulating library in conjunction with File Uploading library.
Using File Uploading library, you can:
- make sure that uploaded files have exact size that you want:
And you can use Image Manipulating library to resize uploaded image if needed, so comlete solution would look like:
$fileInfo = $this->upload->data();
if( $fileInfo['width'] == 600 && $fileInfo['height'] == 300 ) {
// do something
} else {
// initiialize library
$this->image_lib->resize();
}
You can read more about these libraries here:
http://ellislab.com/codeigniter/user-guide/libraries/image_lib.html
http://ellislab.com/codeigniter/user-guide/libraries/file_uploading.html