/** * Does a file support UnserializePHPPowerPoint ? * * @param string $pFilename * @throws Exception * @return boolean */ public function fileSupportsUnserializePHPPowerPoint($pFilename = '') { // Check if file exists if (!file_exists($pFilename)) { throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); } // File exists, does it contain PHPPowerPoint.xml? return PHPPowerPoint_Shared_File::file_exists("zip://{$pFilename}#PHPPowerPoint.xml"); }
/** * Get image mime type * * @param string $pFile Filename * @return string Mime Type * @throws Exception */ private function _getImageMimeType($pFile = '') { if (PHPPowerPoint_Shared_File::file_exists($pFile)) { $image = getimagesize($pFile); return image_type_to_mime_type($image[2]); } else { throw new Exception("File {$pFile} does not exist"); } }