private function _readPalette()
	{
		$length = self::_GetInt2d($this->_data, $this->_pos + 2);
		$recordData = substr($this->_data, $this->_pos + 4, $length);

		// move stream pointer to next record
		$this->_pos += 4 + $length;

		if (!$this->_readDataOnly) {
			// offset: 0; size: 2; number of following colors
			$nm = self::_GetInt2d($recordData, 0);

			// list of RGB colors
			for ($i = 0; $i < $nm; ++$i) {
				$rgb = substr($recordData, 2 + 4 * $i, 4);
				$this->_palette[] = self::_readRGB($rgb);
			}
		}
	}
private function _readPalette()
	{
		$length = self::_GetInt2d($this->_data, $this->_pos + 2);
		$recordData = substr($this->_data, $this->_pos + 4, $length);

		// move stream pointer to next record
		$this->_pos += 4 + $length;

		if (!$this->_readDataOnly) {
			// offset: 0; size: 2; number of following colors
			$nm = self::_GetInt2d($recordData, 0);

			// list of RGB colors
			for ($i = 0; $i < $nm; ++$i) {
				$rgb = substr($recordData, 2 + 4 * $i, 4);
				$this->_palette[] = self::_readRGB($rgb);
			}
		}
	}
private function _readPalette ( ) { $ length = self :: _GetInt2d ( $ this -> _data , $ this -> _pos + 2 ) ; $ recordData = substr ( $ this -> _data , $ this -> _pos + 4 , $ length ) ; // move stream pointer to next record
 $ this -> _pos += 4 + $ length ; if ( ! $ this -> _readDataOnly ) { // offset: 0; size: 2; number of following colors
 $ nm = self :: _GetInt2d ( $ recordData , 0 ) ; // list of RGB colors
 for ( $ i = 0 ; $ i < $ nm ; ++ $ i ) { $ rgb = substr ( $ recordData , 2 + 4 * $ i , 4 ) ; $ this -> _palette [ ] = self :: _readRGB ( $ rgb ) ; } } }
Read PALETTE record
Read PALETTE record