function decodeFallback(image, src) {
  if (src) {
    image.src = src;
  }
  return image.src && IMAGE_DECODE
    ? new Promise((resolve, reject) =>
        image
          .decode()
          .then(() => resolve(image))
          .catch((e) =>
            image.complete && image.width ? resolve(image) : reject(e),
          ),
      )
    : load(image);
}
@param {HTMLImageElement} image Image, not yet loaded.
@param {string} [src] `src` attribute of the image. Optional, not required if already present.
@return {Promise<HTMLImageElement>} Promise resolving to an `HTMLImageElement`.