~ubuntu-branches/ubuntu/hardy/gallery2/hardy-security

« back to all changes in this revision

Viewing changes to modules/getid3/classes/Getid3Helper.class

  • Committer: Bazaar Package Importer
  • Author(s): Michael C. Schultheiss
  • Date: 2006-04-16 16:42:35 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060416164235-8uy0u4bfjdxpge2o
Tags: 2.1.1-1
* New upstream release (Closes: #362936)
  + Bugfixes for Postgres7 (Closes: #359000, #362152)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/*
 
3
 * $RCSfile: Getid3Helper.class,v $
 
4
 *
 
5
 * Gallery - a web based photo album viewer and editor
 
6
 * Copyright (C) 2000-2006 Bharat Mediratta
 
7
 *
 
8
 * This program is free software; you can redistribute it and/or modify
 
9
 * it under the terms of the GNU General Public License as published by
 
10
 * the Free Software Foundation; either version 2 of the License, or (at
 
11
 * your option) any later version.
 
12
 *
 
13
 * This program is distributed in the hope that it will be useful, but
 
14
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
16
 * General Public License for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU General Public License
 
19
 * along with this program; if not, write to the Free Software
 
20
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.
 
21
 */
 
22
/**
 
23
 * @version $Revision: 1.4 $ $Date: 2006/02/15 04:40:32 $
 
24
 * @package Getid3
 
25
 * @author Don Willingham <donwillingham@users.sf.net>
 
26
 */
 
27
 
 
28
/**
 
29
 * Summary Getid3 setting
 
30
 */
 
31
define('GETID3_SUMMARY', 1);
 
32
 
 
33
/**
 
34
 * Detailed Getid3 setting
 
35
 */
 
36
define('GETID3_DETAILED', 2);
 
37
 
 
38
/**
 
39
 * Import mp3 title into item title
 
40
 */
 
41
define('GETID3_MP3_TITLE', 1);
 
42
 
 
43
/**
 
44
 * A helper class for the Getid3 module.
 
45
 *
 
46
 * @package Getid3
 
47
 * @subpackage Classes
 
48
 */
 
49
class Getid3Helper {
 
50
 
 
51
    /**
 
52
     * Reset the given view mode back to its default settings
 
53
     *
 
54
     * @param int the view mode
 
55
     * @return object GalleryStatus a status code
 
56
     * @static
 
57
     */
 
58
    function setDefaultProperties($viewMode) {
 
59
        switch($viewMode) {
 
60
        case GETID3_SUMMARY:
 
61
            /*
 
62
             * This is an initial install. Make sure that we have some
 
63
             * reasonable defaults.
 
64
             */
 
65
            $properties[] = 'Artist';
 
66
            $properties[] = 'Album';
 
67
            $properties[] = 'Track';
 
68
            $properties[] = 'Title';
 
69
            $properties[] = 'DateTime';
 
70
            break;
 
71
 
 
72
        case GETID3_DETAILED:
 
73
            $properties[] = 'Artist';
 
74
            $properties[] = 'Album';
 
75
            $properties[] = 'Track';
 
76
            $properties[] = 'Title';
 
77
            $properties[] = 'Genre';
 
78
            $properties[] = 'Year';
 
79
            $properties[] = 'DateTime';
 
80
            $properties[] = 'AudioBitRate';
 
81
            $properties[] = 'AudioBitRateMode';
 
82
            $properties[] = 'AudioChannels';
 
83
            $properties[] = 'AudioCodec';
 
84
            $properties[] = 'ChannelMode';
 
85
            $properties[] = 'VideoBitRate';
 
86
            $properties[] = 'VideoBitRateMode';
 
87
            $properties[] = 'VideoCodec';
 
88
            break;
 
89
 
 
90
        default:
 
91
            return GalleryStatus::error(ERROR_BAD_PARAMETER, __FILE__, __LINE__);
 
92
        }
 
93
 
 
94
        $ret = Getid3Helper::setProperties($viewMode, $properties);
 
95
        if ($ret) {
 
96
            return $ret->wrap(__FILE__, __LINE__);
 
97
        }
 
98
 
 
99
        return null;
 
100
    }
 
101
 
 
102
    /**
 
103
     * Return the raw data as returned by Getid3
 
104
     *
 
105
     * @param string the path to the file
 
106
     * @param reference to an array where to store the results
 
107
     *        as returned by getid3()
 
108
     */
 
109
    function _fetchRawGetid3Data($path, &$rawGetid3Data) {
 
110
        global $gallery;
 
111
        GalleryCoreApi::requireOnce('modules/getid3/lib/getid3/getid3.inc');
 
112
 
 
113
        $platform =& $gallery->getPlatform();
 
114
        if (!$platform->file_exists($path)) {
 
115
            $rawGetid3Data = null;
 
116
            return;
 
117
        }
 
118
 
 
119
        $getID3 = new getID3;
 
120
        $rawGetid3Data = $getID3->analyze($path);
 
121
    }
 
122
 
 
123
    function getId3ArchiveRecurse($results, $fileArray, $nameprefix='') {
 
124
        foreach(array_keys($fileArray) as $filename) {
 
125
            /* Only prepend a non-empty nameprefix and '/' to filename */
 
126
            if ($nameprefix == '') {
 
127
                $prefixedname = $filename;
 
128
            } else {
 
129
                $prefixedname = $nameprefix.'/'.$filename;
 
130
            }
 
131
            if (is_array($fileArray[$filename])) {
 
132
                $results = Getid3Helper::getId3ArchiveRecurse(
 
133
                               $results, $fileArray[$filename], $prefixedname);
 
134
            } else {
 
135
                if (($nameprefix == '') || ($filename != 0) || ($fileArray[$filename] != 0)) {
 
136
                    $results[] = array('name' => $prefixedname, 'size' => $fileArray[$filename]);
 
137
                }
 
138
            }
 
139
        }
 
140
        return ($results);
 
141
    }
 
142
 
 
143
    function getId3ArchiveTar($fileDetails) {
 
144
        $results = array();
 
145
        foreach (array_keys($fileDetails) as $filename) {
 
146
            if (is_array($fileDetails[$filename])) {
 
147
                $results[] = array('name' => $filename,
 
148
                                   'size' => $fileDetails[$filename]['size']);
 
149
            }
 
150
        }
 
151
        return ($results);
 
152
    }
 
153
 
 
154
    function getId3ArchiveData($path, $viewMode) {
 
155
        Getid3Helper::_fetchRawGetid3Data($path, $rawGetid3Data);
 
156
        $fileArray = null;
 
157
        if (isset($rawGetid3Data['zip']['files'])) {
 
158
            /* We must recurse through files array */
 
159
            return(array(null,
 
160
                 Getid3Helper::getId3ArchiveRecurse(array(), $rawGetid3Data['zip']['files'])));
 
161
        }
 
162
        if (isset($rawGetid3Data['iso']['files'])) {
 
163
            /* Recurse through files like zip */
 
164
            return(array(null,
 
165
                Getid3Helper::getId3ArchiveRecurse(array(), $rawGetid3Data['iso']['files'])));
 
166
        }
 
167
        if (isset($rawGetid3Data['tar']['file_details'])) {
 
168
            /* getid3's tar output allows us to simply look, and not have to recurse */
 
169
            return(array(null,
 
170
                 Getid3Helper::getId3ArchiveTar($rawGetid3Data['tar']['file_details'])));
 
171
        }
 
172
        if (isset($rawGetid3Data['gzip']['member_header']['1']['tar']['file_details'])) {
 
173
            /* tar-gzip is like tar, just buried a little deeper */
 
174
            return(array(null, Getid3Helper::getId3ArchiveTar(
 
175
               $rawGetid3Data['gzip']['member_header']['1']['tar']['file_details'])));
 
176
        }
 
177
        /* File probably isn't an archive */
 
178
        return (array(null, null));
 
179
    }
 
180
 
 
181
    /**
 
182
     * Return the Getid3 data for a specific view and file
 
183
     *
 
184
     * @param string the path to the file
 
185
     * @param int the view mode
 
186
     * @return array object GalleryStatus a status code
 
187
     *               array title/value pairs
 
188
     * @static
 
189
     */
 
190
    function getId3Data($path, $viewMode) {
 
191
        Getid3Helper::_fetchRawGetid3Data($path, $rawGetid3Data);
 
192
        $getid3Keys = Getid3Helper::getGetid3Keys();
 
193
        $results = array();
 
194
 
 
195
        list ($ret, $properties) = Getid3Helper::getProperties($viewMode);
 
196
        if ($ret) {
 
197
            return array($ret->wrap(__FILE__, __LINE__), null);
 
198
        }
 
199
 
 
200
        $errors = Getid3Helper::_getValue($rawGetid3Data, explode('.', 'error.0'));
 
201
        if (isset($errors) && strlen($errors)) {
 
202
                /* If there was an error, return nothing */
 
203
                return array(null, array());
 
204
        }
 
205
        foreach ($properties as $property) {
 
206
            $title = $getid3Keys[$property][0];
 
207
            for ($i = 1; $i < count($getid3Keys[$property]); $i++) {
 
208
                $value = Getid3Helper::_getValue(
 
209
                    $rawGetid3Data, explode('.', $getid3Keys[$property][$i]));
 
210
                if (isset($value)) {
 
211
                    $value = Getid3Helper::postProcessValue($property, $value);
 
212
                    $results[] = array('title' => $title, 'value' => $value);
 
213
                    break;
 
214
                }
 
215
            }
 
216
        }
 
217
 
 
218
        return array(null, $results);
 
219
    }
 
220
 
 
221
    /**
 
222
     * Return the timestamp of a time string in Day of week, Month, Day, Hour, Minute, Second,
 
223
     * Year format.
 
224
     *
 
225
     * @param string time string
 
226
     * @return int an unix timestamp, null if not parsed
 
227
     */
 
228
    function getTimeDowMDHMSY($value) {
 
229
        /* Match "WED DEC 21 19:19:17 2005" format produced by a Canon SD400 */
 
230
        if (preg_match('#(\w+)\ +(\w+)\ +(\d+)\ +(\d+):(\d+):(\d+)\ +(\d+)#', $value, $m)) {
 
231
            $month = 0;
 
232
            switch($m[2]) {
 
233
            case 'JAN': $month =  1; break;
 
234
            case 'FEB': $month =  2; break;
 
235
            case 'MAR': $month =  3; break;
 
236
            case 'APR': $month =  4; break;
 
237
            case 'MAY': $month =  5; break;
 
238
            case 'JUN': $month =  6; break;
 
239
            case 'JUL': $month =  7; break;
 
240
            case 'AUG': $month =  8; break;
 
241
            case 'SEP': $month =  9; break;
 
242
            case 'OCT': $month = 10; break;
 
243
            case 'NOV': $month = 11; break;
 
244
            case 'DEC': $month = 12; break;
 
245
            default: return null;
 
246
            }
 
247
            $time = mktime((int)$m[4], (int)$m[5], (int)$m[6],
 
248
                       $month,     (int)$m[3], (int)$m[7]);
 
249
            return $time;
 
250
        }
 
251
        return null;
 
252
    }
 
253
 
 
254
    /**
 
255
     * Return the timestamp of a time string in Year, Month, Day, Hour, Minute, Second
 
256
     * format.
 
257
     *
 
258
     * @param string time string
 
259
     * @return int an unix timestamp, null if not parsed
 
260
     */
 
261
    function getTimeYMDHMS($value) {
 
262
        /*
 
263
         * Match "2000:05:28 21:18:18" format produced by a
 
264
         *  TOSHIBA DIGITAL CAMERA PDRM70 VERSION 1.07
 
265
         */
 
266
        if (preg_match('#(\d+):(\d+):(\d+)\ +(\d+):(\d+):(\d+)#', $value, $m)) {
 
267
            $time = mktime((int)$m[4], (int)$m[5], (int)$m[6],
 
268
                           (int)$m[2], (int)$m[3], (int)$m[1]);
 
269
            return $time;
 
270
        }
 
271
        return null;
 
272
    }
 
273
 
 
274
    /**
 
275
     * Return the timestamp of a time string already a time stamp.
 
276
     *
 
277
     * @param string time string
 
278
     * @return int an unix timestamp, null if not parsed
 
279
     */
 
280
    function getTimeInt($value) {
 
281
        if (preg_match('/^\d+$/', $value)) {
 
282
            $time = intval($value);
 
283
            /* Adjust time by time zone offset */
 
284
            /* Get difference to UTC in seconds, then add to time */
 
285
            $utcdiff = date('Z', $time);
 
286
            $time = $time + $utcdiff;
 
287
            return $time;
 
288
        }
 
289
        return null;
 
290
    }
 
291
 
 
292
 
 
293
    /**
 
294
     * Sometimes the values that are returned aren't quite as we'd like to
 
295
     * present them, so do a little post processing on the text
 
296
     *
 
297
     * @param string the property name (eg "ShutterSpeedValue")
 
298
     * @param string the value (eg "25/10000 sec")
 
299
     * @return string the result (eg "1/400 sec")
 
300
     * @TODO(donw) Implement postProcessValue
 
301
     */
 
302
    function postProcessValue($property, $value) {
 
303
        global $gallery;
 
304
        switch ($property) {
 
305
        case 'DateTime':
 
306
            /* If it is already a timestamp, as a string */
 
307
            $tmp = Getid3Helper::getTimeInt($value);
 
308
            if (isset($tmp)) {
 
309
                $time = $tmp;
 
310
            } else {
 
311
                $tmp = Getid3Helper::getTimeDowMDHMSY($value);
 
312
                if (isset($tmp)) {
 
313
                    $time = $tmp;
 
314
                } else {
 
315
                    $tmp = Getid3Helper::getTimeYMDHMS($value);
 
316
                    if (isset($tmp)) {
 
317
                        $time = $tmp;
 
318
                    } else {
 
319
                        /* If we couldn't turn it into a timestamp, *
 
320
                         * then just use the original value         */
 
321
                        return ($value);
 
322
                    }
 
323
                }
 
324
            }
 
325
 
 
326
            list ($ret, $format) =
 
327
                GalleryCoreApi::getPluginParameter('module', 'core', 'format.datetime');
 
328
            if ($ret || empty($format)) {
 
329
                $format = '$x $X';
 
330
            }
 
331
            $platform =& $gallery->getPlatform();
 
332
            $value = $platform->strftime($format, $time);
 
333
            break;
 
334
        }
 
335
        return ($value);
 
336
    }
 
337
 
 
338
    /**
 
339
     * Return the timestamp when the item was taken, as recorded in exif, id3, or other meta tag
 
340
     *
 
341
     * @param string the path to the file
 
342
     * @return int an unix timestamp
 
343
     */
 
344
    function getOriginationTimestamp($path) {
 
345
        $rawGetid3Data = array();
 
346
        Getid3Helper::_fetchRawGetid3Data($path, $rawGetid3Data);
 
347
        foreach (
 
348
            array('riff.AVI .hdrl.IDIT.0.data',
 
349
                  'riff.AVI .INFO.IDIT.0.data',
 
350
                  'quicktime.moov.subatoms.0.creation_time_unix',
 
351
                  'quicktime.moov.subatoms.0.subatoms.1.subatoms.0.subatoms.0.creation_time_unix')
 
352
                 as $tag) {
 
353
            $value = Getid3Helper::_getValue($rawGetid3Data, explode('.', $tag));
 
354
            if (isset($value)) {
 
355
                $tmp = Getid3Helper::getTimeInt($value);
 
356
                if (isset($tmp)) {
 
357
                    return ($tmp);
 
358
                }
 
359
                $tmp = Getid3Helper::getTimeDowMDHMSY($value);
 
360
                if (isset($tmp)) {
 
361
                    return ($tmp);
 
362
                }
 
363
                $tmp = Getid3Helper::getTimeYMDHMS($value);
 
364
                if (isset($tmp)) {
 
365
                   return ($tmp);
 
366
                }
 
367
            }
 
368
        }
 
369
        return null;
 
370
    }
 
371
 
 
372
 
 
373
    /**
 
374
     * Retrieve a single value by path from a nested associative array.
 
375
     * The data source is an array like this:
 
376
     *
 
377
     * foo =>
 
378
     *   bar => (a => 1, b => 2, c => 3)
 
379
     *   baz => (d => 4, e => 5, f => 6)
 
380
     *
 
381
     * the key path is an array like this:
 
382
     *
 
383
     * (foo, bar, d)
 
384
     *
 
385
     * the resulting value would be "4"
 
386
     *
 
387
     * @param array the data source
 
388
     * @param array the key path
 
389
     * @return array object GalleryStatus a status code
 
390
     *               string value
 
391
     * @static
 
392
     */
 
393
    function _getValue(&$source, $keyPath) {
 
394
        $key = array_shift($keyPath);
 
395
        if (!isset($source[$key])) {
 
396
            return null;
 
397
        }
 
398
 
 
399
        if (empty($keyPath)) {
 
400
            return is_string($source[$key]) ? str_replace("\0", '', $source[$key]) : $source[$key];
 
401
        } else {
 
402
            return Getid3Helper::_getValue($source[$key], $keyPath);
 
403
        }
 
404
    }
 
405
 
 
406
    /**
 
407
     * Return the target properties for the given view mode
 
408
     *
 
409
     * @param int the view mode (GETID3_SUMMARY, etc)
 
410
     * @return array object GalleryStatus a status code
 
411
     *               array logical exif property names
 
412
     * @static
 
413
     */
 
414
    function getProperties($viewMode) {
 
415
        global $gallery;
 
416
 
 
417
        $query = '
 
418
        SELECT
 
419
          [Getid3PropsMap::property], [Getid3PropsMap::viewMode], [Getid3PropsMap::sequence]
 
420
        FROM
 
421
          [Getid3PropsMap]
 
422
        WHERE
 
423
          [Getid3PropsMap::viewMode] = ?
 
424
        ORDER BY
 
425
          [Getid3PropsMap::sequence] ASC';
 
426
        list ($ret, $searchResults) = $gallery->search($query, array($viewMode));
 
427
        if ($ret) {
 
428
            return array($ret->wrap(__FILE__, __LINE__), null);
 
429
        }
 
430
 
 
431
        $data = array();
 
432
        while ($result = $searchResults->nextResult()) {
 
433
            $data[] = $result[0];
 
434
        }
 
435
 
 
436
        return array(null, $data);
 
437
    }
 
438
 
 
439
    /**
 
440
     * Set the target properties for the given view mode
 
441
     *
 
442
     * @param int the view mode (GETID3_SUMMARY, etc)
 
443
     * @param array logical property key/value pairs
 
444
     * @return object GalleryStatus a status code
 
445
     * @static
 
446
     */
 
447
    function setProperties($viewMode, $properties) {
 
448
 
 
449
        /* Remove all old map entries */
 
450
        $ret = GalleryCoreApi::removeMapEntry('Getid3PropsMap', array('viewMode' => $viewMode));
 
451
        if ($ret) {
 
452
            return $ret->wrap(__FILE__, __LINE__);
 
453
        }
 
454
 
 
455
        for ($i = 0; $i < sizeof($properties); $i++) {
 
456
            $ret = GalleryCoreApi::addMapEntry(
 
457
                'Getid3PropsMap',
 
458
                array('property' => $properties[$i],
 
459
                      'viewMode' => $viewMode,
 
460
                      'sequence' => $i));
 
461
            if ($ret) {
 
462
                return $ret->wrap(__FILE__, __LINE__);
 
463
            }
 
464
        }
 
465
 
 
466
        return null;
 
467
    }
 
468
 
 
469
 
 
470
    /**
 
471
     * Return the Getid3 keys that we know about (from Getid3).
 
472
     *
 
473
     * The resulting array is of the form:
 
474
     *
 
475
     *   logical getid3 property => (physical getid3 property, internationalized title, group)
 
476
     *   logical getid3 property => (physical getid3 property, internationalized title, group)
 
477
     *
 
478
     * The logical getid3 properties are unique and have some correlation to the
 
479
     * physical property, but have been changed for our convenience.  The physical
 
480
     * getid3 property is the actual getid3 property name (as reported by Getid3).  The group
 
481
     * is an internationalized name of a group like "General Properties", etc.
 
482
     *
 
483
     * @return array getID3() keys
 
484
     * @static
 
485
     */
 
486
    function getGetid3Keys() {
 
487
        global $gallery;
 
488
        static $data;
 
489
 
 
490
        if (!empty($data)) {
 
491
            return $data;
 
492
        }
 
493
 
 
494
        /* Must haves */
 
495
        $data['Album'] =
 
496
            array($gallery->i18n('Album'),
 
497
                                   'tags.vorbiscomment.album.0',
 
498
                                   'tags.id3v1.album.0',
 
499
                                   'id3v1.album',
 
500
                                   'id3v1.comments.album.0',
 
501
                                   'tags_html.id3v1.album.0');
 
502
        $data['Artist'] =
 
503
            array($gallery->i18n('Artist'),
 
504
                                   'tags.vorbiscomment.artist.0',
 
505
                                   'comments.artist.0',
 
506
                                   'tags.id3v1.artist.0',
 
507
                                   'id3v1.artist',
 
508
                                   'id3v1.comments.artist.0',
 
509
                                   'tags_html.id3v1.artist.0');
 
510
        $data['AudioBitRate'] =
 
511
            array($gallery->i18n('Audio Bit Rate'),
 
512
                                   'audio.bitrate',
 
513
                                   'audio.streams.0.bitrate',
 
514
                                   'mpeg.audio.bitrate',
 
515
                                   'bitrate');
 
516
        $data['AudioBitRateMode'] =
 
517
            array($gallery->i18n('Audio Bit Rate Mode'),
 
518
                                   'audio.bitrate_mode',
 
519
                                   'audio.streams.0.bitrate_mode',
 
520
                                   'mpeg.audio.bitrate_mode');
 
521
        $data['AudioChannels'] =
 
522
            array($gallery->i18n('Audio Channels'),
 
523
                                   'audio.channels',
 
524
                                   'audio.streams.0.channels',
 
525
                                   'mpeg.audio.channels');
 
526
        $data['AudioCodec'] =
 
527
            array($gallery->i18n('Audio Codec'),
 
528
                                   'audio.codec');
 
529
 
 
530
        $data['ChannelMode'] =
 
531
            array($gallery->i18n('Channel Mode'),
 
532
                                   'mpeg.audio.channelmode',
 
533
                                   'audio.channelmode',
 
534
                                   'audio.streams.0.channelmode');
 
535
        $data['AudioSampleRate'] =
 
536
            array($gallery->i18n('Audio Sample Rate'),
 
537
                                   'audio.sample_rate');
 
538
        $data['Copyright'] =
 
539
            array($gallery->i18n('Copyright'),
 
540
                                   'comments.copyright',
 
541
                                   'tags.quicktime.copyright');
 
542
        $data['DateTime'] =
 
543
            array($gallery->i18n('Date/Time'),
 
544
                  'riff.AVI .hdrl.IDIT.0.data',
 
545
                  'riff.AVI .INFO.IDIT.0.data',
 
546
                  'quicktime.moov.subatoms.0.creation_time_unix',
 
547
                  'quicktime.moov.subatoms.0.subatoms.1.subatoms.0.subatoms.0.creation_time_unix');
 
548
        $data['Genre'] =
 
549
            array($gallery->i18n('Genre'),
 
550
                                   'tags.vorbiscomment.genre.0',
 
551
                                   'comments.genre.0',
 
552
                                   'tags.id3v1.genre.0',
 
553
                                   'id3v1.genre',
 
554
                                   'id3v1.comments.genre',
 
555
                                   'tags_html.id3v1.genre.0');
 
556
        $data['PlaytimeSeconds'] =
 
557
            array($gallery->i18n('Playtime (Seconds)'),
 
558
                                   'playtime_seconds');
 
559
        $data['PlaytimeString'] =
 
560
            array($gallery->i18n('Playtime'),
 
561
                                   'playtime_string');
 
562
        $data['Title'] =
 
563
            array($gallery->i18n('Title'),
 
564
                                   'tags.vorbiscomment.title.0',
 
565
                                   'comments.title.0',
 
566
                                   'tags.id3v1.title.0',
 
567
                                   'id3v1.title',
 
568
                                   'id3v1.comments.title.0',
 
569
                                   'tags_html.id3v1.title.0',
 
570
                                   'comments.title.0',
 
571
                                   'tags.quicktime.title');
 
572
        $data['Track'] =
 
573
            array($gallery->i18n('Track'),
 
574
                                   'tags.id3v1.track.0',
 
575
                                   'id3v1.track',
 
576
                                   'id3v1.comments.track.0',
 
577
                                   'tags_html.id3v1.track.0');
 
578
        $data['VideoBitRate'] =
 
579
            array($gallery->i18n('Video Bit Rate'),
 
580
                                   'video.bitrate');
 
581
        $data['VideoBitRateMode'] =
 
582
            array($gallery->i18n('Video Bit Rate Mode'),
 
583
                                   'video.bitrate_mode');
 
584
        $data['VideoCodec'] =
 
585
            array($gallery->i18n('Video Codec'),
 
586
                                   'video.codec',
 
587
                                   'quicktime.video.codec',
 
588
                                   'riff.video.0.codec');
 
589
        $data['VideoDataFormat'] =
 
590
            array($gallery->i18n('Video Data Format'),
 
591
                                   'video.dataformat');
 
592
        $data['VideoFrameRate'] =
 
593
            array($gallery->i18n('Video Frame Rate'),
 
594
                                   'video.frame_rate');
 
595
        $data['VideoResolutionX'] =
 
596
            array($gallery->i18n('Video Resolution X'),
 
597
                                   'video.resolution_x');
 
598
        $data['VideoResolutionY'] =
 
599
            array($gallery->i18n('Video Resolution Y'),
 
600
                                   'video.resolution_y');
 
601
        $data['VideoSoftware'] =
 
602
            array($gallery->i18n('Video Software'),
 
603
                                   'riff.AVI .INFO.ISFT.0.data');
 
604
        $data['Year'] =
 
605
            array($gallery->i18n('Year'),
 
606
                                   'tags.id3v1.year.0',
 
607
                                   'id3v1.year',
 
608
                                   'id3v1.comments.year.0',
 
609
                                   'tags_html.id3v1.year.0');
 
610
 
 
611
        return $data;
 
612
    }
 
613
}
 
614
?>