コード例 #1
0
ファイル: Sound.php プロジェクト: Cryde/sydney-core
 /**
  * Returns the information we could find on the file
  * @return Array
  */
 public function getFileinfo()
 {
     $toret = parent::getFileinfo();
     // get the ID3 data if it is an MP3
     if ($this->extension == 'MP3') {
         if (function_exists('id3_get_tag')) {
             try {
                 $id3sata = id3_get_tag($this->fullpath);
                 foreach ($id3sata as $key => $val) {
                     if ($key == 'genre') {
                         $toret['mp3.' . $key] = id3_get_genre_name($val);
                     } else {
                         $toret['mp3.' . $key] = $val;
                     }
                 }
             } catch (Exception $e) {
             }
         }
     }
     return $toret;
 }
コード例 #2
0
ファイル: Video.php プロジェクト: Cryde/sydney-core
 /**
  * Returns the information we could find on the file
  * @return Array
  */
 public function getFileinfo()
 {
     if ($this->fileinfos == null) {
         $toret = parent::getFileinfo();
         // get the exif data
         try {
             /*
             $cls=new ReflectionClass('ffmpeg_movie');
             print '<xmp>';
             foreach($cls->getMethods() as $n) print '$toret[\'video.'.$n->name.'\'] = $movie->'.$n->name."();\n";
             print '</xmp>';
             */
             $movie = new ffmpeg_movie($this->fullpath, false);
             $toret['video.duration'] = $movie->getduration();
             $toret['video.framecount'] = $movie->getframecount();
             $toret['video.framerate'] = $movie->getframerate();
             $toret['video.filename'] = $movie->getfilename();
             $toret['video.comment'] = $movie->getcomment();
             $toret['video.title'] = $movie->gettitle();
             $toret['video.author'] = $movie->getauthor();
             $toret['video.artist'] = $movie->getartist();
             $toret['video.copyright'] = $movie->getcopyright();
             $toret['video.album'] = $movie->getalbum();
             $toret['video.genre'] = $movie->getgenre();
             $toret['video.year'] = $movie->getyear();
             $toret['video.tracknumber'] = $movie->gettracknumber();
             $toret['video.framewidth'] = $movie->getframewidth();
             $toret['video.frameheight'] = $movie->getframeheight();
             $toret['video.framenumber'] = $movie->getframenumber();
             $toret['video.pixelformat'] = $movie->getpixelformat();
             $toret['video.bitrate'] = $movie->getbitrate();
             $toret['video.hasaudio'] = $movie->hasaudio();
             $toret['video.hasvideo'] = $movie->hasvideo();
             $toret['video.videocodec'] = $movie->getvideocodec();
             $toret['video.audiocodec'] = $movie->getaudiocodec();
             $toret['video.videostreamid'] = $movie->getvideostreamid();
             $toret['video.audiostreamid'] = $movie->getaudiostreamid();
             $toret['video.audiochannels'] = $movie->getaudiochannels();
             $toret['video.audiosamplerate'] = $movie->getaudiosamplerate();
             $toret['video.audiobitrate'] = $movie->getaudiobitrate();
             $toret['video.videobitrate'] = $movie->getvideobitrate();
             $toret['video.pixelaspectratio'] = $movie->getpixelaspectratio();
             foreach ($toret as $k => $v) {
                 if ($v == '') {
                     unset($toret[$k]);
                 }
             }
             //$frm = $movie->getFrame(1);
         } catch (Exception $e) {
         }
         $this->fileinfos = $toret;
         return $this->fileinfos;
     } else {
         return $this->fileinfos;
     }
 }
コード例 #3
0
ファイル: Image.php プロジェクト: Cryde/sydney-core
 /**
  * Returns the information we could find on the file
  * @return Array
  */
 public function getFileinfo()
 {
     $toret = parent::getFileinfo();
     // add the image size to the array
     $is = $this->getSize();
     $toret['img.width'] = $is[0];
     $toret['img.height'] = $is[1];
     // get the exif data
     try {
         $ft = @exif_imagetype($this->fullpath);
         if ($ft != IMAGETYPE_GIF && $ft != IMAGETYPE_PNG) {
             try {
                 ini_set("display_errors", 0);
                 $exifh = exif_read_data($this->fullpath);
                 if ($exifh) {
                     $exif = exif_read_data($this->fullpath, 0, true);
                     foreach ($exif as $key => $section) {
                         foreach ($section as $name => $val) {
                             $toret['img.' . $key . '.' . $name] = $val;
                         }
                     }
                     unset($toret['img.EXIF.MakerNote']);
                     unset($toret['img.EXIF.UserComment']);
                 }
             } catch (Exception $e) {
             }
         }
     } catch (Exception $e) {
     }
     return $toret;
 }