示例#1
0
 function test_isURL()
 {
     $this->assertTrue(Utils::isURL('http://some.com/path.html'));
     $this->assertTrue(Utils::isURL('https://some.com/path.html'));
     $this->assertFalse(Utils::isURL('ftp://some.com/path.html'));
     $this->assertFalse(Utils::isURL('/some.com/path.html'));
     $this->assertFalse(Utils::isURL('some.com/path.html'));
     $this->assertFalse(Utils::isURL('http_path.html'));
 }
示例#2
0
 public function image($uri, $x = '0%', $y = '0%', $w = '100%', $h = '100%')
 {
     if (Utils::isURL($uri)) {
         list($image, $extension) = $this->loadFromURL($uri);
         //$this->transform(Utils::nameFromURL($uri), $extension, WideImage::loadFromString($image), $x, $y, $w, $h) :
     } else {
         $imageName = $this->imageName($uri);
         $this->transform($imageName['name'], $imageName['extension'], WideImage::loadFromString($this->fs->read($uri)), $x, $y, $w, $h);
     }
 }