/** * Open a new image resource from image file * * @param string $path * @return \Intervention\Image\Image * @static */ public static function open($path) { return \Intervention\Image\Image::open($path); }
public function testOpenImage() { $img = new Image(); $img->open('public/test.jpg'); $this->assertInternalType('resource', $img->resource); $this->assertInternalType('int', $img->width); $this->assertInternalType('int', $img->height); $this->assertEquals($img->width, 800); $this->assertEquals($img->height, 600); $this->assertEquals($img->dirname, 'public'); $this->assertEquals($img->basename, 'test.jpg'); $this->assertEquals($img->extension, 'jpg'); $this->assertEquals($img->filename, 'test'); $this->assertEquals($img->mime, 'image/jpeg'); }
public function setImage($image) { $this->image->open($image); return $this; }