Example #1
0
	/**
	 * @dataProvider dataResizeAndCrop
	 */
	public function testResizeAndCrop($actWidth, $actHeight, $maxWidth, $maxHeight, $eqWidth, $eqHeight)
	{
		$img = Image::fromBlank($actWidth, $actHeight);
		$img->resizeAndCrop($maxWidth, $maxHeight);

		$this->assertEquals(
			array('width' => $eqWidth, 'height' => $eqHeight),
			array('width' => $img->width, 'height' => $img->height),
			"::resizeAndCrop($maxWidth, $maxHeight) from ($actWidth, $actHeight)"
		);
	}
Example #2
0
	/**
	 * @return \Nella\Image
	 */
	public function toImage()
	{
		return \Nella\Image::fromFile($this->getStorageDir() . "/" . $this->getPath());
	}