/** * Метод добавляет картинку в анимацию */ public function addImg($path, $delay = 40) { if ($path instanceof DirItem) { $path = $path->getAbsPath(); } PsImg::assertIsImg($path); $this->IMAGES[$path] = $delay; unset($this->animation); }
/** @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; }
public function assertIsImg() { $this->assertIsValid(); PsImg::assertIsImg($this->getTmpFilePath()); }
/** * @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) { } }
public function assertIsImg($text = null) { return PsImg::assertIsImg($this->absPath, $text); }