function getResolutions(image, referenceImage) {
  try {
    return image.getResolution(referenceImage);
  } catch {
    return [
      referenceImage.getWidth() / image.getWidth(),
      referenceImage.getHeight() / image.getHeight(),
    ];
  }
}
Get the resolution of an image.  If the image does not have an affine transform,
the width of the image is compared with the reference image.
@param {GeoTIFFImage} image The image.
@param {GeoTIFFImage} referenceImage The reference image.
@return {Array<number>} The map x and y units per pixel.