Example #1
0
 public function testCheckFormat()
 {
     $gd = new Gd();
     $this->assertEquals('png', $gd->checkFormat('png'));
     $this->assertEquals('jpeg', $gd->checkFormat('jpeg'));
     $this->assertEquals('gif', $gd->checkFormat('gif'));
     $this->assertEquals('jpeg', $gd->checkFormat('toto'));
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function getBase64($format = 'png')
 {
     $this->create($this->width, $this->height);
     $code = $this->newCode($this->chars, $this->length);
     $this->addFilters(array(new Background($this->backgroundColor), new Border($this->borderColor), new Strip($this->fontColor), new Text($code, $this->fontSize, $this->fonts, $this->fontColor)));
     if ($this->grayscale) {
         $this->addFilter(new GrayScale());
     }
     return parent::getBase64($format);
 }