code: function oldReadColors(scan, buffer, offset, xmax) {
      var rshift = 0, x = 0, len = xmax;
      while (len > 0) {
          scan[x][0] = buffer[offset++];
          scan[x][1] = buffer[offset++];
          scan[x][2] = buffer[offset++];
          scan[x][3] = buffer[offset++];
          if (scan[x][0] === 1 && scan[x][1] === 1 && scan[x][2] === 1) {
              // exp is count of repeated pixels
              for (var i = (scan[x][3] << rshift) >>> 0; i > 0; i--) {
                  copyrgbe(scan[x-1], scan[x]);
                  x++;
                  len--;
              }
              rshift += 8;
          } else {
              x++;
              len--;
              rshift = 0;
          }
      }
      return offset;
  }
docs: TODO : check