public function testGetExt() { $this->assertEquals('php', File::getExt(__FILE__)); }
/** * 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]); }