function replaceHead(blob, head, callback) {
    var options = { maxMetaDataSize: 1024, disableMetaDataParsers: true }
    if (!callback && global.Promise) {
      return parseMetaData(blob, options).then(function (data) {
        return replaceJPEGHead(blob, data.imageHead, head)
      })
    }
    parseMetaData(
      blob,
      function (data) {
        callback(replaceJPEGHead(blob, data.imageHead, head))
      },
      options
    )
  }
Replaces the image head of a JPEG blob with the given one.
Returns a Promise or calls the callback with the new Blob.

@param {Blob} blob Blob object
@param {ArrayBuffer} head New JPEG head
@param {Function} [callback] Callback function
@returns {Promise<Blob|null>|undefined} Combined Blob