public function crop_image($file, $size = '200') { $this->using('image'); $img = new image(); if ($img->load($file)) { $img->thumbnail($size); $img->save(); } }
/** * Unit test * @param string $file */ public static function run_test() { $img = new image(); $img->load('/tmp/test.jpg'); $img->resize(700); $img->watermark('/tmp/wm.png'); $img->resize(200); $img->save('/tmp/success.png'); }