initJpgWriter = async (storage, imageResizer, isNativeImageResizer) => {
  if (!isNativeImageResizer) {
    return import('sharp')
      .then(lib => {
        sharp = lib.default
        log.debug(`Use sharp as HEIC JPEG writer`)
        return sharpJpgWriter
      })
      .catch(e => {
        log.warn(e, `Could not load sharp to write JPG`)
        return import('jpeg-js')
          .then(lib => {
            jpegJs = lib
            log.warn(`Use slower jpeg-js to write JPG`)
            return createFallbackJpgWriter(storage, imageResizer)
          })
      })
  } else {
    return import('jpeg-js')
      .then(lib => {
        jpegJs = lib
        log.warn(`Use slower jpeg-js to write JPG`)
        return createFallbackJpgWriter(storage, imageResizer)
      })
  }
}
@param {import('./image-resizer.js').ImageResizer} imageResizer
@param {boolean} isNativeImageResizer
@returns {Promise<TJpgWriter>}