Beispiel #1
0
 public function crop_image($file, $size = '200')
 {
     $this->using('image');
     $img = new image();
     if ($img->load($file)) {
         $img->thumbnail($size);
         $img->save();
     }
 }
Beispiel #2
0
 /**
  * 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');
 }