function getHeaderLength(dataView, offset) {
    var length = dataView.getUint8(offset + 7)
    if (length % 2 !== 0) length += 1
    // Check for pre photoshop 6 format
    if (length === 0) {
      // Always 4
      length = 4
    }
    return length
  }
Returns header length.

@param {DataView} dataView Data view interface
@param {number} offset Segment offset
@returns {number} Header length