Ejemplo n.º 1
0
 public function testGetExt()
 {
     $this->assertEquals('php', File::getExt(__FILE__));
 }
Ejemplo n.º 2
0
 /**
  * Add watermark to image.
  *
  * @param string $path Path to image file.
  */
 public function add($path)
 {
     if (!($image = $this->path->path($path))) {
         throw new \InvalidArgumentException("Image \"{$path}\" doesn't exists");
     }
     $img = $this->getResource($image);
     $img = $this->addWatermark($img);
     $ext = File::getExt($image);
     $func = 'image' . ($ext == 'jpg' ? 'jpeg' : $ext);
     return call_user_func_array($func, [$img, $image, 100]);
 }