Esempio n. 1
0
 function getMetadata()
 {
     $this->metadata = parent::getMetadata();
     $getid3 = new getid3();
     $getid3->encoding = 'UTF-8';
     try {
         $getid3->Analyze($this->filepath);
         $id3 = $getid3->info;
     } catch (Exception $e) {
         echo 'An error occured: ' . $e->message;
     }
     if (is_array($id3)) {
         if (isset($id3['video'])) {
             $v = $id3['video'];
             if ($v['dataformat']) {
                 $this->metadata['dataformat'] = $v['dataformat'];
             }
             if ($v['frame_rate']) {
                 $this->metadata['frame_rate'] = $v['frame_rate'];
             }
             if ($v['resolution_x']) {
                 $this->metadata['width'] = $v['resolution_x'];
             }
             if ($v['resolution_y']) {
                 $this->metadata['height'] = $v['resolution_y'];
             }
         }
     }
     return $this->metadata;
 }
Esempio n. 2
0
 function getMetadata()
 {
     $this->metadata = parent::getMetadata();
     $this->getIptc();
     $this->getExif();
     $size = getimagesize($this->filepath);
     $this->metadata['width'] = $size[0];
     $this->metadata['height'] = $size[1];
     return $this->metadata;
 }
Esempio n. 3
0
 function getMetadata()
 {
     $this->metadata = parent::getMetadata();
     $getid3 = new getid3();
     $getid3->encoding = 'UTF-8';
     try {
         $getid3->Analyze($this->filepath);
         $id3 = $getid3->info;
     } catch (Exception $e) {
         echo 'An error occured: ' . $e->message;
     }
     if (is_array($id3)) {
         if (isset($id3['comments']) && isset($id3['playtime_seconds']) && isset($id3['bitrate']) && isset($id3['audio'])) {
             $this->metadata['duration'] = $id3['playtime_seconds'];
             $this->metadata['bitrate'] = $id3['bitrate'];
             $this->metadata['channels'] = $id3['audio']['channels'];
             $this->metadata['samplingrate'] = $id3['audio']['sample_rate'];
             $this->metadata['audio_title'] = $id3['comments']['title'][0];
             $this->metadata['audio_artist'] = $id3['comments']['artist'][0];
             if (isset($id3['comments']['comment'])) {
                 $this->metadata['audio_comment'] = $id3['comments']['comment'][0];
             }
             if (isset($id3['comments']['album'])) {
                 $this->metadata['audio_album'] = $id3['comments']['album'][0];
             }
             if (isset($id3['comments']['year'])) {
                 $this->metadata['audio_year'] = $id3['comments']['year'][0];
             }
             if (isset($id3['comments']['encoded_by'])) {
                 $this->metadata['audio_encoded_by'] = $id3['comments']['encoded_by'][0];
             }
             if (isset($id3['comments']['track'])) {
                 $this->metadata['audio_track'] = $id3['comments']['track'][0];
             }
             if (isset($id3['comments']['genre'])) {
                 $this->metadata['audio_genre'] = $id3['comments']['genre'][0];
             }
             if (isset($id3['comments']['totaltracks'])) {
                 $this->metadata['audio_totaltracks'] = $id3['comments']['totaltracks'][0];
             }
         }
     }
     return $this->metadata;
 }
Esempio n. 4
0
 function getMetadata()
 {
     $this->metadata = parent::getMetadata();
     return $this->metadata;
 }