static computeAspectRatios(image) {
    const url = UrlUtils.elideDataURI(image.src);
    const actualAspectRatio = image.naturalDimensions.width / image.naturalDimensions.height;
    const displayedAspectRatio = image.displayedWidth / image.displayedHeight;

    const targetDisplayHeight = image.displayedWidth / actualAspectRatio;
    const targetDisplayWidth = image.displayedHeight * actualAspectRatio;

    // Small rounding errors in aspect ratio can lead to large differences in target width/height
    // if the aspect ratio is close to 0.
    //
    // In these cases, we should compare the smaller dimension because any rounding errors will
    // affect that dimension less.
    const doRatiosMatch = targetDisplayHeight < targetDisplayWidth
      ? Math.abs(targetDisplayHeight - image.displayedHeight) < THRESHOLD_PX
      : Math.abs(targetDisplayWidth - image.displayedWidth) < THRESHOLD_PX;

    return {
      url,
      node: Audit.makeNodeItem(image.node),
      displayedAspectRatio: `${image.displayedWidth} x ${image.displayedHeight}
        (${displayedAspectRatio.toFixed(2)})`,
      actualAspectRatio: `${image.naturalDimensions.width} x ${image.naturalDimensions.height}
        (${actualAspectRatio.toFixed(2)})`,
      doRatiosMatch,
    };
  }
@param {WellDefinedImage} image
@return {{url: string, node: LH.Audit.Details.NodeValue, displayedAspectRatio: string, actualAspectRatio: string, doRatiosMatch: boolean}}