public function testAutoOrient() { $excepted = Helper::getExpected(__FUNCTION__ . '.jpg'); $actual = Helper::getActual(__FUNCTION__ . '.jpg'); $original = Helper::getOrig('butterfly.jpg'); $img = new Image(); $img->loadFile($original)->autoOrient()->saveAs($actual); Helper::isFileEq($actual, $excepted); }
public function testBorderColorSize() { $excepted = Helper::getExpected(__FUNCTION__ . '.png'); $actual = Helper::getActual(__FUNCTION__ . '.png'); $original = Helper::getOrig('butterfly.jpg'); $img = new Image(); $img->loadFile($original)->addFilter('border', array('color' => 'ff0', 'size' => '5'))->saveAs($actual); Helper::isFileEq($actual, $excepted); }
public function testWatermark() { $excepted = Helper::getExpected(__FUNCTION__ . '.png'); $actual = Helper::getActual(__FUNCTION__ . '.png'); $original = Helper::getOrig('butterfly.jpg'); $overlay = Helper::getOrig('overlay.png'); $img = new Image(); $img->loadFile($original)->overlay($overlay)->saveAs($actual); Helper::isFileEq($actual, $excepted); }
public function testFlipRorateRevert275White() { $excepted = Helper::getExpected(__FUNCTION__ . '.png'); $actual = Helper::getActual(__FUNCTION__ . '.png'); $original = Helper::getOrig('butterfly.jpg'); $img = new Image(); $img->loadFile($original)->addFilter('rotate', -275, array(255, 255, 255, 127))->saveAs($actual); Helper::isFileEq($actual, $excepted); }
/** * @expectedException \JBZoo\Image\Exception */ public function testConvertToUndefindPath() { $original = Helper::getOrig('butterfly.jpg'); $actual = Helper::getActual('qwerty/' . __FUNCTION__ . '.png'); $img = new Image(); $img->loadFile($original)->saveAs($actual); }
public function testBestFitNoChange() { $excepted = Helper::getExpected(__FUNCTION__ . '.png'); $actual = Helper::getActual(__FUNCTION__ . '.png'); $original = Helper::getOrig('butterfly.jpg'); $img = new Image(); $img->loadFile($original)->bestFit(10000, 10000)->saveAs($actual); Helper::isFileEq($actual, $excepted); }