X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=DataObjects%2FImages.php;h=c23f56f7ddc3ba800f22a32fbcc75b32361f3330;hp=320d889a7746e91c5dfd50c2d1bcee8f45890ee1;hb=2ce8484aea363c14597504cbd4ba9c1779a64357;hpb=bd84525d2f282832376841ad6b828e1f1e513838 diff --git a/DataObjects/Images.php b/DataObjects/Images.php index 320d889a..c23f56f7 100644 --- a/DataObjects/Images.php +++ b/DataObjects/Images.php @@ -132,31 +132,7 @@ class Pman_Core_DataObjects_Images extends DB_DataObject } if($this->mimetype == 'application/pdf'){ - - require_once 'System.php'; - - $this->no_of_pages = 0; - - $pdfinfo = System::which('pdfinfo'); - - if (!empty($pdfinfo)) { - - $cmd = "{$pdfinfo} {$file}"; - - $ret = `$cmd`; - - $info = explode("\n", $ret); - - foreach ($info as $i){ - - if(preg_match('/^Pages:[\s]*([0-9]+)/', $i, $matches)){ - $this->no_of_pages = (empty($matches[1])) ? 0 : $matches[1]; - continue; - } - - } - } - + $this->no_of_pages = $this->getNumberOfPage($file); } $this->filesize = filesize($file);