コード例 #1
0
ファイル: PsGifEncoder.php プロジェクト: ilivanoff/ps-sdk-dev
 /**
  * Метод добавляет картинку в анимацию
  */
 public function addImg($path, $delay = 40)
 {
     if ($path instanceof DirItem) {
         $path = $path->getAbsPath();
     }
     PsImg::assertIsImg($path);
     $this->IMAGES[$path] = $delay;
     unset($this->animation);
 }
コード例 #2
0
ファイル: SimpleImage.php プロジェクト: ilivanoff/www
 /** @return SimpleImage */
 public function load($path)
 {
     $this->close();
     $path = $path instanceof DirItem ? $path->getAbsPath() : $path;
     PsImg::assertIsImg($path);
     $this->path = $path;
     $this->type = PsImg::getType(array_get_value(2, getimagesize($path)));
     switch ($this->type) {
         case IMAGETYPE_JPEG:
             $this->image = imagecreatefromjpeg($path);
             break;
         case IMAGETYPE_GIF:
             $this->image = imagecreatefromgif($path);
             break;
         case IMAGETYPE_PNG:
             $this->image = imagecreatefrompng($path);
             break;
     }
     return $this;
 }
コード例 #3
0
ファイル: FILEAdapter.php プロジェクト: ilivanoff/www
 public function assertIsImg()
 {
     $this->assertIsValid();
     PsImg::assertIsImg($this->getTmpFilePath());
 }
コード例 #4
0
ファイル: PsImgTest.php プロジェクト: ilivanoff/www
 /**
  * @covers PsImg::assertIsImg
  */
 public function testAssertIsImg()
 {
     PsImg::assertIsImg(TestResources::imageGif());
     PsImg::assertIsImg(TestResources::imagePng());
     PsImg::assertIsImg(TestResources::imageJpg());
     try {
         PsImg::assertIsImg(TestResources::fakeimagePng());
         $this->brakeNoException();
     } catch (PException $ex) {
     }
 }
コード例 #5
0
ファイル: DirItem.php プロジェクト: ilivanoff/www
 public function assertIsImg($text = null)
 {
     return PsImg::assertIsImg($this->absPath, $text);
 }