private function decodeImageData(Decoded $gif)
    {
        $data = '';

        // LZW minimum code size
        $data .= $this->getNextBytes(1);

        do {

            $byte = $this->getNextBytes(1);

            if ($byte !== self::BLOCK_TERMINATOR) {
                $size = unpack('C', $byte)[1];
                $data .= $byte;
                $data .= $this->getNextBytes($size);
            } else {
                $data .= self::BLOCK_TERMINATOR;
            }

        } while ($byte !== self::BLOCK_TERMINATOR);

        $gif->addImageData($data);
    }