Program: 67556
Project: 67556
Buggy source:
private int[] getImageSize(IImageContent image,Image imageInfo,ContainerSizeInfo parentSizeInfo,int imageWidthDpi,int imageHeightDpi){
  int imageHeight;
  int imageWidth;
  int imageInfoHeight=imageInfo.getHeight() * 1000;
  int imageInfoWidth=imageInfo.getWidth() * 1000;
  if (image.getWidth() == null && image.getHeight() == null) {
    int imageFileWidthDpi=imageInfo.getPhysicalWidthDpi() == -1 ? 0 : imageInfo.getPhysicalWidthDpi();
    int imageFileHeightDpi=imageInfo.getPhysicalHeightDpi() == -1 ? 0 : imageInfo.getPhysicalHeightDpi();
    imageWidthDpi=PropertyUtil.getImageDpi(image,imageFileWidthDpi,0);
    imageHeightDpi=PropertyUtil.getImageDpi(image,imageFileHeightDpi,0);
  }
  if (image.getWidth() == null && image.getHeight() != null) {
    imageHeight=LayoutUtil.getImageHeight(image.getHeight(),imageInfoHeight,imageHeightDpi);
    float scale=((float)imageInfoHeight) / ((float)imageInfoWidth);
    imageWidth=(int)(imageHeight / scale);
  }
 else   if (image.getHeight() == null && image.getWidth() != null) {
    imageWidth=LayoutUtil.getImageWidth(image.getWidth(),parentSizeInfo.getWidth(),imageInfoWidth,imageWidthDpi);
    float scale=((float)imageInfoHeight) / ((float)imageInfoWidth);
    imageHeight=(int)(imageWidth * scale);
  }
 else {
    imageHeight=LayoutUtil.getImageHeight(image.getHeight(),imageInfoHeight,imageHeightDpi);
    imageWidth=LayoutUtil.getImageWidth(image.getWidth(),parentSizeInfo.getWidth(),imageInfoWidth,imageWidthDpi);
  }
  int[] imageSize={imageHeight,imageWidth};
  return imageSize;
}

Fixed version (ground truth):
private int[] getImageSize(IImageContent image,Image imageInfo,ContainerSizeInfo parentSizeInfo,int imageWidthDpi,int imageHeightDpi){
  int imageHeight;
  int imageWidth;
  int imageInfoHeight=(int)(imageInfo.getHeight() * 1000 * ExcelUtil.INCH_PT / imageHeightDpi);
  int imageInfoWidth=(int)(imageInfo.getWidth() * 1000 * ExcelUtil.INCH_PT / imageWidthDpi);
  if (image.getWidth() == null && image.getHeight() == null) {
    int imageFileWidthDpi=imageInfo.getPhysicalWidthDpi() == -1 ? 0 : imageInfo.getPhysicalWidthDpi();
    int imageFileHeightDpi=imageInfo.getPhysicalHeightDpi() == -1 ? 0 : imageInfo.getPhysicalHeightDpi();
    imageWidthDpi=PropertyUtil.getImageDpi(image,imageFileWidthDpi,0);
    imageHeightDpi=PropertyUtil.getImageDpi(image,imageFileHeightDpi,0);
  }
  if (image.getWidth() == null && image.getHeight() != null) {
    imageHeight=LayoutUtil.getImageHeight(image.getHeight(),imageInfoHeight,imageHeightDpi);
    float scale=((float)imageInfoHeight) / ((float)imageInfoWidth);
    imageWidth=(int)(imageHeight / scale);
  }
 else   if (image.getHeight() == null && image.getWidth() != null) {
    imageWidth=LayoutUtil.getImageWidth(image.getWidth(),parentSizeInfo.getWidth(),imageInfoWidth,imageWidthDpi);
    float scale=((float)imageInfoHeight) / ((float)imageInfoWidth);
    imageHeight=(int)(imageWidth * scale);
  }
 else {
    imageHeight=LayoutUtil.getImageHeight(image.getHeight(),imageInfoHeight,imageHeightDpi);
    imageWidth=LayoutUtil.getImageWidth(image.getWidth(),parentSizeInfo.getWidth(),imageInfoWidth,imageWidthDpi);
  }
  int[] imageSize={imageHeight,imageWidth};
  return imageSize;
}