loadFile() public method

Load an image
public loadFile ( string $filename )
$filename string Path to image file
Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 /**
  * @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);
 }
Esempio n. 6
0
 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);
 }