Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. function humanFileSize(bytes, si) {
  2. var thresh = si ? 1000 : 1024;
  3. if(bytes < thresh) return bytes + ' B';
  4. var units = si ? ['kB','MB','GB','TB','PB','EB','ZB','YB'] : ['KiB','MiB','GiB','TiB','PiB','EiB','ZiB','YiB'];
  5. var u = -1;
  6. do {
  7. bytes /= thresh;
  8. ++u;
  9. } while(bytes >= thresh);
  10. return bytes.toFixed(1)+' '+units[u];
  11. };
  12.  
  13. $getID3 = new getID3;
  14. $file = $getID3->analyze($filename);
  15. echo("Duration: ".$file['playtime_string'].
  16. " / Dimensions: ".$file['video']['resolution_x']." wide by ".$file['video']['resolution_y']." tall".
  17. " / Filesize: ".$file['filesize']." bytes<br />");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement