use mime_content_type instead of getID3 + use proper MP4 mimetype
This commit is contained in:
@@ -30,13 +30,11 @@ class MP3FileHandler extends DataHandlerExtension {
|
||||
* @return Image|null
|
||||
*/
|
||||
protected function create_image_from_data($filename, $metadata) {
|
||||
global $config;
|
||||
|
||||
$image = new Image();
|
||||
|
||||
// FIXME: need more flash format specs :|
|
||||
$image->width = 0;
|
||||
$image->height = 0;
|
||||
//NOTE: No need to set width/height as we don't use it.
|
||||
$image->width = 1;
|
||||
$image->height = 1;
|
||||
|
||||
$image->filesize = $metadata['size'];
|
||||
$image->hash = $metadata['hash'];
|
||||
@@ -66,15 +64,15 @@ class MP3FileHandler extends DataHandlerExtension {
|
||||
* @return bool
|
||||
*/
|
||||
protected function check_contents($file) {
|
||||
$success = FALSE;
|
||||
|
||||
if (file_exists($file)) {
|
||||
require_once('lib/getid3/getid3/getid3.php');
|
||||
$getID3 = new getID3;
|
||||
$ThisFileInfo = $getID3->analyze($file, TRUE);
|
||||
if (isset($ThisFileInfo['fileformat']) && $ThisFileInfo['fileformat'] == "mp3") {
|
||||
return TRUE;
|
||||
}
|
||||
$mimeType = mime_content_type($file);
|
||||
|
||||
$success = ($mimeType == 'audio/mpeg');
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
return $success;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user