22 $info = &$this->getid3->info;
24 $info[
'fileformat'] =
'gif';
25 $info[
'video'][
'dataformat'] =
'gif';
26 $info[
'video'][
'lossless'] =
true;
27 $info[
'video'][
'pixel_aspect_ratio'] = (float) 1;
30 $GIFheader = $this->
fread(13);
33 $info[
'gif'][
'header'][
'raw'][
'identifier'] = substr($GIFheader, $offset, 3);
37 if (
$info[
'gif'][
'header'][
'raw'][
'identifier'] != $magic) {
39 unset(
$info[
'fileformat']);
44 $info[
'gif'][
'header'][
'raw'][
'version'] = substr($GIFheader, $offset, 3);
57 $info[
'video'][
'resolution_x'] =
$info[
'gif'][
'header'][
'raw'][
'width'];
58 $info[
'video'][
'resolution_y'] =
$info[
'gif'][
'header'][
'raw'][
'height'];
59 $info[
'gif'][
'version'] =
$info[
'gif'][
'header'][
'raw'][
'version'];
60 $info[
'gif'][
'header'][
'flags'][
'global_color_table'] = (bool) (
$info[
'gif'][
'header'][
'raw'][
'flags'] & 0x80);
61 if (
$info[
'gif'][
'header'][
'raw'][
'flags'] & 0x80) {
63 $info[
'gif'][
'header'][
'bits_per_pixel'] = 3 * (((
$info[
'gif'][
'header'][
'raw'][
'flags'] & 0x70) >> 4) + 1);
65 $info[
'gif'][
'header'][
'bits_per_pixel'] = 0;
67 $info[
'gif'][
'header'][
'flags'][
'global_color_sorted'] = (bool) (
$info[
'gif'][
'header'][
'raw'][
'flags'] & 0x40);
68 if (
$info[
'gif'][
'header'][
'flags'][
'global_color_table']) {
71 $info[
'gif'][
'header'][
'global_color_size'] = pow(2, (
$info[
'gif'][
'header'][
'raw'][
'flags'] & 0x07) + 1);
72 $info[
'video'][
'bits_per_sample'] = (
$info[
'gif'][
'header'][
'raw'][
'flags'] & 0x07) + 1;
74 $info[
'gif'][
'header'][
'global_color_size'] = 0;
76 if (
$info[
'gif'][
'header'][
'raw'][
'aspect_ratio'] != 0) {
78 $info[
'gif'][
'header'][
'aspect_ratio'] = (
$info[
'gif'][
'header'][
'raw'][
'aspect_ratio'] + 15) / 64;
172 static $bitbuffer =
'';
173 while (strlen($bitbuffer) < $bits) {
174 $bitbuffer = str_pad(decbin(ord($this->
fread(1))), 8,
'0', STR_PAD_LEFT).$bitbuffer;
176 $value = bindec(substr($bitbuffer, 0 - $bits));
177 $bitbuffer = substr($bitbuffer, 0, 0 - $bits);
static LittleEndian2Int($byteword, $signed=false)
getID3() by James Heinrich info@getid3.org //
static PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8')
fseek($bytes, $whence=SEEK_SET)