1
This commit is contained in:
67
vendor/topthink/think-image/tests/CropTest.php
vendored
Normal file
67
vendor/topthink/think-image/tests/CropTest.php
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2015 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yunwuxin <448901948@qq.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace tests;
|
||||
|
||||
use think\Image;
|
||||
|
||||
class CropTest extends TestCase
|
||||
{
|
||||
public function testJpeg()
|
||||
{
|
||||
$pathname = TEST_PATH . 'tmp/crop.jpg';
|
||||
$image = Image::open($this->getJpeg());
|
||||
|
||||
$image->crop(200, 200, 100, 100, 300, 300)->save($pathname);
|
||||
|
||||
$this->assertEquals(300, $image->width());
|
||||
$this->assertEquals(300, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
}
|
||||
|
||||
public function testPng()
|
||||
{
|
||||
$pathname = TEST_PATH . 'tmp/crop.png';
|
||||
$image = Image::open($this->getPng());
|
||||
|
||||
$image->crop(200, 200, 100, 100, 300, 300)->save($pathname);
|
||||
|
||||
$this->assertEquals(300, $image->width());
|
||||
$this->assertEquals(300, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
}
|
||||
|
||||
public function testGif()
|
||||
{
|
||||
$pathname = TEST_PATH . 'tmp/crop.gif';
|
||||
$image = Image::open($this->getGif());
|
||||
|
||||
$image->crop(200, 200, 100, 100, 300, 300)->save($pathname);
|
||||
|
||||
$this->assertEquals(300, $image->width());
|
||||
$this->assertEquals(300, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
}
|
||||
}
|
||||
43
vendor/topthink/think-image/tests/FlipTest.php
vendored
Normal file
43
vendor/topthink/think-image/tests/FlipTest.php
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2015 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yunwuxin <448901948@qq.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace tests;
|
||||
|
||||
use think\Image;
|
||||
|
||||
class FlipTest extends TestCase
|
||||
{
|
||||
public function testJpeg()
|
||||
{
|
||||
$pathname = TEST_PATH . 'tmp/flip.jpg';
|
||||
$image = Image::open($this->getJpeg());
|
||||
$image->flip()->save($pathname);
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
}
|
||||
|
||||
|
||||
public function testGif()
|
||||
{
|
||||
$pathname = TEST_PATH . 'tmp/flip.gif';
|
||||
$image = Image::open($this->getGif());
|
||||
$image->flip(Image::FLIP_Y)->save($pathname);
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
}
|
||||
}
|
||||
60
vendor/topthink/think-image/tests/InfoTest.php
vendored
Normal file
60
vendor/topthink/think-image/tests/InfoTest.php
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2015 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yunwuxin <448901948@qq.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace tests;
|
||||
|
||||
use think\Image;
|
||||
|
||||
class InfoTest extends TestCase
|
||||
{
|
||||
|
||||
public function testOpen()
|
||||
{
|
||||
$this->setExpectedException("\\think\\image\\Exception");
|
||||
Image::open('');
|
||||
}
|
||||
|
||||
public function testIllegal()
|
||||
{
|
||||
$this->setExpectedException("\\think\\image\\Exception", 'Illegal image file');
|
||||
Image::open(TEST_PATH . 'images/test.bmp');
|
||||
}
|
||||
|
||||
public function testJpeg()
|
||||
{
|
||||
$image = Image::open($this->getJpeg());
|
||||
$this->assertEquals(800, $image->width());
|
||||
$this->assertEquals(600, $image->height());
|
||||
$this->assertEquals('jpeg', $image->type());
|
||||
$this->assertEquals('image/jpeg', $image->mime());
|
||||
$this->assertEquals([800, 600], $image->size());
|
||||
}
|
||||
|
||||
|
||||
public function testPng()
|
||||
{
|
||||
$image = Image::open($this->getPng());
|
||||
$this->assertEquals(800, $image->width());
|
||||
$this->assertEquals(600, $image->height());
|
||||
$this->assertEquals('png', $image->type());
|
||||
$this->assertEquals('image/png', $image->mime());
|
||||
$this->assertEquals([800, 600], $image->size());
|
||||
}
|
||||
|
||||
public function testGif()
|
||||
{
|
||||
$image = Image::open($this->getGif());
|
||||
$this->assertEquals(380, $image->width());
|
||||
$this->assertEquals(216, $image->height());
|
||||
$this->assertEquals('gif', $image->type());
|
||||
$this->assertEquals('image/gif', $image->mime());
|
||||
$this->assertEquals([380, 216], $image->size());
|
||||
}
|
||||
}
|
||||
42
vendor/topthink/think-image/tests/RotateTest.php
vendored
Normal file
42
vendor/topthink/think-image/tests/RotateTest.php
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2015 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yunwuxin <448901948@qq.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace tests;
|
||||
|
||||
use think\Image;
|
||||
|
||||
class RotateTest extends TestCase
|
||||
{
|
||||
public function testJpeg()
|
||||
{
|
||||
$pathname = TEST_PATH . 'tmp/rotate.jpg';
|
||||
$image = Image::open($this->getJpeg());
|
||||
$image->rotate(90)->save($pathname);
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
}
|
||||
|
||||
public function testGif()
|
||||
{
|
||||
$pathname = TEST_PATH . 'tmp/rotate.gif';
|
||||
$image = Image::open($this->getGif());
|
||||
$image->rotate(90)->save($pathname);
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
}
|
||||
}
|
||||
33
vendor/topthink/think-image/tests/TestCase.php
vendored
Normal file
33
vendor/topthink/think-image/tests/TestCase.php
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2015 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yunwuxin <448901948@qq.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace tests;
|
||||
|
||||
use think\File;
|
||||
|
||||
abstract class TestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
protected function getJpeg()
|
||||
{
|
||||
return new File(TEST_PATH . 'images/test.jpg');
|
||||
}
|
||||
|
||||
protected function getPng()
|
||||
{
|
||||
return new File(TEST_PATH . 'images/test.png');
|
||||
}
|
||||
|
||||
protected function getGif()
|
||||
{
|
||||
return new File(TEST_PATH . 'images/test.gif');
|
||||
}
|
||||
}
|
||||
58
vendor/topthink/think-image/tests/TextTest.php
vendored
Normal file
58
vendor/topthink/think-image/tests/TextTest.php
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2015 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yunwuxin <448901948@qq.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace tests;
|
||||
|
||||
use think\Image;
|
||||
|
||||
class TextTest extends TestCase
|
||||
{
|
||||
public function testJpeg()
|
||||
{
|
||||
$pathname = TEST_PATH . 'tmp/text.jpg';
|
||||
$image = Image::open($this->getJpeg());
|
||||
|
||||
$image->text('test', TEST_PATH . 'images/test.ttf', 12)->save($pathname);
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
}
|
||||
|
||||
public function testPng()
|
||||
{
|
||||
$pathname = TEST_PATH . 'tmp/text.png';
|
||||
$image = Image::open($this->getPng());
|
||||
|
||||
$image->text('test', TEST_PATH . 'images/test.ttf', 12)->save($pathname);
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
}
|
||||
|
||||
public function testGif()
|
||||
{
|
||||
$pathname = TEST_PATH . 'tmp/text.gif';
|
||||
$image = Image::open($this->getGif());
|
||||
|
||||
$image->text('test', TEST_PATH . 'images/test.ttf', 12)->save($pathname);
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
}
|
||||
}
|
||||
284
vendor/topthink/think-image/tests/ThumbTest.php
vendored
Normal file
284
vendor/topthink/think-image/tests/ThumbTest.php
vendored
Normal file
@@ -0,0 +1,284 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2015 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yunwuxin <448901948@qq.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace tests;
|
||||
|
||||
use think\Image;
|
||||
|
||||
class ThumbTest extends TestCase
|
||||
{
|
||||
public function testJpeg()
|
||||
{
|
||||
$pathname = TEST_PATH . 'tmp/thumb.jpg';
|
||||
|
||||
//1
|
||||
$image = Image::open($this->getJpeg());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_CENTER)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(200, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
|
||||
//2
|
||||
$image = Image::open($this->getJpeg());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_SCALING)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(150, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
|
||||
//3
|
||||
$image = Image::open($this->getJpeg());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_FILLED)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(200, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
|
||||
//4
|
||||
$image = Image::open($this->getJpeg());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_NORTHWEST)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(200, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
|
||||
//5
|
||||
$image = Image::open($this->getJpeg());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_SOUTHEAST)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(200, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
|
||||
//6
|
||||
$image = Image::open($this->getJpeg());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_FIXED)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(200, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
}
|
||||
|
||||
|
||||
public function testPng()
|
||||
{
|
||||
$pathname = TEST_PATH . 'tmp/thumb.png';
|
||||
|
||||
//1
|
||||
$image = Image::open($this->getPng());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_CENTER)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(200, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
|
||||
//2
|
||||
$image = Image::open($this->getPng());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_SCALING)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(150, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
|
||||
//3
|
||||
$image = Image::open($this->getPng());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_FILLED)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(200, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
|
||||
//4
|
||||
$image = Image::open($this->getPng());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_NORTHWEST)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(200, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
|
||||
//5
|
||||
$image = Image::open($this->getPng());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_SOUTHEAST)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(200, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
|
||||
//6
|
||||
$image = Image::open($this->getPng());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_FIXED)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(200, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
}
|
||||
|
||||
public function testGif()
|
||||
{
|
||||
$pathname = TEST_PATH . 'tmp/thumb.gif';
|
||||
|
||||
//1
|
||||
$image = Image::open($this->getGif());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_CENTER)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(200, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
|
||||
//2
|
||||
$image = Image::open($this->getGif());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_SCALING)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(113, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
|
||||
//3
|
||||
$image = Image::open($this->getGif());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_FILLED)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(200, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
|
||||
//4
|
||||
$image = Image::open($this->getGif());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_NORTHWEST)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(200, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
|
||||
//5
|
||||
$image = Image::open($this->getGif());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_SOUTHEAST)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(200, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
|
||||
//6
|
||||
$image = Image::open($this->getGif());
|
||||
|
||||
$image->thumb(200, 200, Image::THUMB_FIXED)->save($pathname);
|
||||
|
||||
$this->assertEquals(200, $image->width());
|
||||
$this->assertEquals(200, $image->height());
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
}
|
||||
}
|
||||
58
vendor/topthink/think-image/tests/WaterTest.php
vendored
Normal file
58
vendor/topthink/think-image/tests/WaterTest.php
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2015 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yunwuxin <448901948@qq.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace tests;
|
||||
|
||||
use think\Image;
|
||||
|
||||
class WaterTest extends TestCase
|
||||
{
|
||||
public function testJpeg()
|
||||
{
|
||||
$pathname = TEST_PATH . 'tmp/water.jpg';
|
||||
$image = Image::open($this->getJpeg());
|
||||
|
||||
$image->water(TEST_PATH . 'images/test.gif')->save($pathname);
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
}
|
||||
|
||||
public function testPng()
|
||||
{
|
||||
$pathname = TEST_PATH . 'tmp/water.png';
|
||||
$image = Image::open($this->getPng());
|
||||
|
||||
$image->water(TEST_PATH . 'images/test.gif')->save($pathname);
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
}
|
||||
|
||||
public function testGif()
|
||||
{
|
||||
$pathname = TEST_PATH . 'tmp/water.gif';
|
||||
$image = Image::open($this->getGif());
|
||||
|
||||
$image->water(TEST_PATH . 'images/test.jpg')->save($pathname);
|
||||
|
||||
$file = new \SplFileInfo($pathname);
|
||||
|
||||
$this->assertTrue($file->isFile());
|
||||
|
||||
@unlink($pathname);
|
||||
}
|
||||
}
|
||||
15
vendor/topthink/think-image/tests/autoload.php
vendored
Normal file
15
vendor/topthink/think-image/tests/autoload.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2015 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yunwuxin <448901948@qq.com>
|
||||
// +----------------------------------------------------------------------
|
||||
define('TEST_PATH', __DIR__ . '/');
|
||||
// 加载框架基础文件
|
||||
require __DIR__ . '/../thinkphp/base.php';
|
||||
\think\Loader::addNamespace('tests', TEST_PATH);
|
||||
\think\Loader::addNamespace('think', __DIR__ . '/../src/');
|
||||
0
vendor/topthink/think-image/tests/images/test.bmp
vendored
Normal file
0
vendor/topthink/think-image/tests/images/test.bmp
vendored
Normal file
BIN
vendor/topthink/think-image/tests/images/test.gif
vendored
Normal file
BIN
vendor/topthink/think-image/tests/images/test.gif
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 233 KiB |
BIN
vendor/topthink/think-image/tests/images/test.jpg
vendored
Normal file
BIN
vendor/topthink/think-image/tests/images/test.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.0 KiB |
BIN
vendor/topthink/think-image/tests/images/test.png
vendored
Normal file
BIN
vendor/topthink/think-image/tests/images/test.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 105 KiB |
BIN
vendor/topthink/think-image/tests/images/test.ttf
vendored
Normal file
BIN
vendor/topthink/think-image/tests/images/test.ttf
vendored
Normal file
Binary file not shown.
2
vendor/topthink/think-image/tests/tmp/.gitignore
vendored
Normal file
2
vendor/topthink/think-image/tests/tmp/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
Reference in New Issue
Block a user