public static function openPdf($file)
 {
     if (!ImageServer::isEnabledPdf()) {
         return null;
     }
     $im = new Imagick($file . '[0]');
     $im->setImageFormat("png");
     $str = $im->getImageBlob();
     $im2 = imagecreatefromstring($str);
     return $im2;
 }
Exemplo n.º 2
0
 function isValidForThumb()
 {
     if ($this->isImage() || $this->isPdf() && ImageServer::isEnabledPdf()) {
         return true;
     }
     return false;
 }