* @link https://www.w3.org/Graphics/GIF/spec-gif89a.txt
* @link http://www.matthewflickinger.com/lab/whatsinagif/bits_and_bytes.asp
*/
+
+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
+
class getid3_gif extends getid3_handler
{
/**
return false;
}
+ //if (!$this->getid3->option_extra_info) {
+ // $this->warning('GIF Extensions and Global Color Table not returned due to !getid3->option_extra_info');
+ //}
+
$info['gif']['header']['raw']['version'] = substr($GIFheader, $offset, 3);
$offset += 3;
$info['gif']['header']['raw']['width'] = getid3_lib::LittleEndian2Int(substr($GIFheader, $offset, 2));
if ($info['gif']['header']['flags']['global_color_table']) {
$GIFcolorTable = $this->fread(3 * $info['gif']['header']['global_color_size']);
- $offset = 0;
- for ($i = 0; $i < $info['gif']['header']['global_color_size']; $i++) {
- $red = getid3_lib::LittleEndian2Int(substr($GIFcolorTable, $offset++, 1));
- $green = getid3_lib::LittleEndian2Int(substr($GIFcolorTable, $offset++, 1));
- $blue = getid3_lib::LittleEndian2Int(substr($GIFcolorTable, $offset++, 1));
- $info['gif']['global_color_table'][$i] = (($red << 16) | ($green << 8) | ($blue));
+ if ($this->getid3->option_extra_info) {
+ $offset = 0;
+ for ($i = 0; $i < $info['gif']['header']['global_color_size']; $i++) {
+ $red = getid3_lib::LittleEndian2Int(substr($GIFcolorTable, $offset++, 1));
+ $green = getid3_lib::LittleEndian2Int(substr($GIFcolorTable, $offset++, 1));
+ $blue = getid3_lib::LittleEndian2Int(substr($GIFcolorTable, $offset++, 1));
+ $info['gif']['global_color_table'][$i] = (($red << 16) | ($green << 8) | ($blue));
+ $info['gif']['global_color_table_rgb'][$i] = sprintf('%02X%02X%02X', $red, $green, $blue);
+ }
}
}
}
}
- $info['gif']['extension_blocks'][] = $ExtensionBlock;
+ if ($this->getid3->option_extra_info) {
+ $info['gif']['extension_blocks'][] = $ExtensionBlock;
+ }
break;
case ';':