Location: PHPKode > projects > mediaIndex > classes/group.images.php
<?php
/**
 * $Id: group.images.php,v 1.7 2004/11/26 20:39:10 openface Exp $      
 *
 *               _ _        _         _                 
 *  _ __  ___ __| (_)__ _  (_)_ _  __| |_____ _____ _ _ 
 * | '  \/ -_) _` | / _` | | | ' \/ _` / -_) \ / -_) '_|
 * |_|_|_\___\__,_|_\__,_| |_|_||_\__,_\___/_\_\___|_|  
 *                                                     
 *     Standalone Indexer Script for Media Files
 *        jason hines, <hide@address.com>
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Library General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
 * General Public License for more details.
 */

/**
 * Group class
 *
 * @version     $Revision: 1.7 $
 * @package     mediaIndexer
 * @subpackage  groups  
 * @author      jason hines, <hide@address.com>
 */

class imagesGroup extends defaultGroup {

    public $groupName = "Images";

    function printInfo(file $file) {
        include_once(_BASEPATH . '/lib/getid3/getid3.php');
        $getID3 = new getID3;
        try {
          $raw = $getID3->analyze(_MEDIAPATH . $file->path);
          $info = array();
          $info['width'] = $raw['video']['resolution_x'];
          $info['height'] = $raw['video']['resolution_y'] + 16;
          $info['mime_type'] = $raw['mime_type'];
        } catch (Exception $e) {
          $info = array();
        }
        print "<table class=\"info\">\n";
        print "<tr><td>Width:</td><td>{$info['width']}</td></tr>\n";
        print "<tr><td>Height:</td><td>{$info['height']}</td></tr>\n";
        print "<tr><td>MimeType:</td><td>{$info['mime_type']}</td></tr>\n";
        print "</table>\n";
    }
}

?>
Return current item: mediaIndex