Example #1
0
 public function testDefinirImagem()
 {
     $imagemBase64 = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSgBBwcHCggKEwoKEygaFhooKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKP/AABEIAQQBBAMBEQACEQEDEQH/xAGiAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgsQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+gEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoLEQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APqE9aAFzQAZoAAcgEHNABmgBc0AN60AGKADpQDFB4oACaAD60AFACUAG7mgBu+gB+aAEzQAhegBpegBGfau5uFHJJ6UAMhuY5gWhkSRc4JRgwz+FAEgbPFADs0AGaADPvQAZoAQ80ALQAooEH0oAXtQB8s/txf8yV/2+/8AtCgZ9SmgAoAKAFoAO9AC0AIRQAUAGKAE6UCFHSgYdaAEoAO1ADMndzQIQ8H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9Hu7D/hHft6z3Hnhvt3lbflVcY8ts/dqJS5gO2H7WOP+ZL/APKr/wDaakBw/azx/wAyX/5Vf/tNAC/8Naf9SV/5Vf8A7TQB5Z8cPi1/wtH+xf8AiS/2V/Zvn/8AL35/meZ5f+wuMeX75z7UAf/Z';
     $imagem = new \Domain\Entity\Imagem();
     $resposta = Formulario::setImagem($imagem, $imagemBase64);
     print_r($imagem);
     print_r($resposta);
     if (file_exists($resposta->getArquivoTemporario())) {
         unlink($resposta->getArquivoTemporario());
     }
 }
Example #2
0
 /**
  * Extrai a imagem do sistema codificado com Base64. Caso seja como imagem
  * estarĂ¡ pronto para inserir na tag img.
  *
  * @param \Domain\Entity\Imagem $imagem Imagem
  * @param boolean $comPrefixo Se pronto para imagem
  * @return string
  */
 public static function getImagemBase64($imagem, $comPrefixo = false, $tipo = 'image/webp')
 {
     $aplicativo = Aplicativo::getInstance();
     $retorno = null;
     try {
         if (!is_null($imagem) && !is_null($imagem->getFile()) && !is_null($imagem->getFile()->getBytes())) {
             $retorno = Formulario::getImagemBase64ComPrefixo($imagem->getFile()->getBytes(), $imagem->getMimeType(), $comPrefixo, $tipo);
         }
     } catch (\MongoGridFSException $ex) {
         $aplicativo->getLog()->error($ex->getLine() . ' - ' . $ex->getFile() . ': ' . $ex->getMessage());
     }
     return $retorno;
 }