private int ParseLogicalScreen(byte[] gifData, int offset)
{
_logicalWidth = BitConverter.ToUInt16(gifData, offset);
_logicalHeight = BitConverter.ToUInt16(gifData, offset + 2);
byte packedField = gifData[offset + 4];
bool hasGlobalColorTable = (int)(packedField & 0x80) > 0 ? true : false;
int currentIndex = offset + 7;
if (hasGlobalColorTable)
{
int colorTableLength = packedField & 0x07;
colorTableLength = (int)Math.Pow(2, colorTableLength + 1) * 3;
currentIndex = currentIndex + colorTableLength;
}
return currentIndex;
}