Example #1
0
File: IM.php Project: joeymetal/v1
 /**
  * Image_Transform_Driver_IM::_get_image_details()
  *
  * @param string $image the path and name of the image file
  * @return none
  */
 function _get_image_details($image)
 {
     $retval = Image_Transform::_get_image_details($image);
     if (PEAR::isError($retval)) {
         unset($retval);
         if (!System::which(IMAGE_TRANSFORM_IM_PATH . 'identify' . (OS_WINDOWS ? '.exe' : ''))) {
             $this->isError(PEAR::raiseError('Couldn\'t find "identify" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED));
         }
         $cmd = $this->_prepare_cmd(IMAGE_TRANSFORM_IM_PATH, 'identify', '-format %w:%h:%m ' . escapeshellarg($image));
         exec($cmd, $res, $exit);
         if ($exit == 0) {
             $data = explode(':', $res[0]);
             $this->img_x = $data[0];
             $this->img_y = $data[1];
             $this->type = strtolower($data[2]);
             $retval = true;
         } else {
             return PEAR::raiseError("Cannot fetch image or images details.", true);
         }
     }
     return $retval;
 }