note 47785 added to function.getimagesize
| From: | sixzero4athotmaildotcom at osu1 dot php dot net | Date: | Tue, 30 Nov 2004 04:33:07 +0000 |
| Subject: | note 47785 added to function.getimagesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81173@lists.php.net to get a copy of this message | ||
This is just to add to the comment by robertks at hotmail dot com on
05-Mar-2003 12:12 regarding trying to derive the dimensions of a video file. The package referenced
(http://www.getid3.org/) had been updated, and below is a script I use to get the size. You can get
many other attributes of media files as well.
<?php
// include getID3() library (can be in a different directory if full path is specified)
include_once('getid3.php');
// Initialize getID3 engine
$getID3 = new getID3;
// File to get info from
$file_location = './your/path/to/file.mov';
// Get information from the file
$fileinfo = $getID3->analyze($file_location);
getid3_lib::CopyTagsToComments($fileinfo);
// Output results
if (!empty($fileinfo['video']['resolution_x'])) { echo '<p> video
width: '.$fileinfo['video']['resolution_x'].'</p>'; }
if (!empty($fileinfo['video']['resolution_y'])) { echo '<p> video
height: '.$fileinfo['video']['resolution_y'].'</p>'; }
?>
Hope that helps others looking for a function similar to getimagesize() for a video or media file.
----
Manual Page -- http://www.php.net/manual/en/function.getimagesize.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47785
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47785&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47785&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47785&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47785&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47785&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47785&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47785&report=yes
Search -- http://master.php.net/manage/user-notes.php