Program: 69392
Project: 69392
Buggy source:
protected BackgroundImageInfo createBackgroundImage(String url,IContent content){
  IStyle style=content.getStyle();
  String widthStr=style.getBackgroundWidth();
  String heightStr=style.getBackgroundHeight();
  Image img=null;
  try {
    img=Image.getInstance(new URL(url));
  }
 catch (  Exception e) {
    if (SvgFile.isSvg(url)) {
      try {
        img=Image.getInstance(SvgFile.transSvgToArray(url));
      }
 catch (      Exception ex) {
        logger.log(Level.WARNING,ex.getMessage(),ex);
      }
    }
 else {
      logger.log(Level.WARNING,e.getMessage(),e);
    }
  }
  int resolutionX=img.getDpiX();
  int resolutionY=img.getDpiY();
  if (0 == resolutionX || 0 == resolutionY) {
    resolutionX=96;
    resolutionY=96;
  }
  float imageWidth=img.plainWidth() / resolutionX * 72 * PDFConstants.LAYOUT_TO_PDF_RATIO;
  float imageHeight=img.plainHeight() / resolutionY * 72 * PDFConstants.LAYOUT_TO_PDF_RATIO;
  int actualWidth=(int)imageWidth;
  int actualHeight=(int)imageHeight;
  if (widthStr != null && widthStr.length() > 0 || heightStr != null && heightStr.length() > 0) {
    if ("String_Node_Str".equals(widthStr) || "String_Node_Str".equals(heightStr)) {
      float rh=imageHeight / height;
      float rw=imageWidth / width;
      if (rh > rw) {
        actualHeight=height;
        actualWidth=(int)(imageWidth * height / imageHeight);
      }
 else {
        actualWidth=width;
        actualHeight=(int)(imageHeight * width / imageWidth);
      }
    }
 else     if ("String_Node_Str".equals(widthStr) || "String_Node_Str".equals(heightStr)) {
      float rh=imageHeight / height;
      float rw=imageWidth / width;
      if (rh > rw) {
        actualWidth=width;
        actualHeight=(int)(imageHeight * width / imageWidth);
      }
 else {
        actualHeight=height;
        actualWidth=(int)(imageWidth * height / imageHeight);
      }
    }
 else {
      DimensionType widthDim=DimensionType.parserUnit(widthStr);
      DimensionType heightDim=DimensionType.parserUnit(heightStr);
      if (widthDim != null) {
        actualWidth=PropertyUtil.getDimensionValue(content,widthDim);
        if (heightDim == null) {
          actualHeight=(int)(imageHeight * actualWidth / imageWidth);
        }
 else {
          actualHeight=PropertyUtil.getDimensionValue(content,heightDim);
        }
      }
 else       if (heightDim != null) {
        actualHeight=PropertyUtil.getDimensionValue(content,heightDim);
        if (widthDim == null) {
          actualWidth=(int)(imageWidth * actualHeight / imageHeight);
        }
 else {
          actualWidth=PropertyUtil.getDimensionValue(content,widthDim);
        }
      }
 else {
        actualHeight=(int)imageHeight;
        actualWidth=(int)imageWidth;
      }
    }
  }
  IStyle cs=pageContent.getComputedStyle();
  return new BackgroundImageInfo(url,cs.getProperty(IStyle.STYLE_BACKGROUND_REPEAT),getDimensionValue(cs.getProperty(IStyle.STYLE_BACKGROUND_POSITION_X),width - actualWidth),getDimensionValue(cs.getProperty(IStyle.STYLE_BACKGROUND_POSITION_Y),height - actualHeight),actualHeight,actualWidth);
}

Fixed version (ground truth):
protected BackgroundImageInfo createBackgroundImage(String url,IContent content){
  IStyle style=content.getStyle();
  String widthStr=style.getBackgroundWidth();
  String heightStr=style.getBackgroundHeight();
  Image img=null;
  try {
    img=Image.getInstance(new URL(url));
  }
 catch (  Exception e) {
    if (SvgFile.isSvg(url)) {
      try {
        img=Image.getInstance(SvgFile.transSvgToArray(url));
      }
 catch (      Exception ex) {
        logger.log(Level.WARNING,ex.getMessage(),ex);
      }
    }
 else {
      logger.log(Level.WARNING,e.getMessage(),e);
    }
  }
  if (img != null) {
    int resolutionX=img.getDpiX();
    int resolutionY=img.getDpiY();
    if (0 == resolutionX || 0 == resolutionY) {
      resolutionX=96;
      resolutionY=96;
    }
    float imageWidth=img.plainWidth() / resolutionX * 72 * PDFConstants.LAYOUT_TO_PDF_RATIO;
    float imageHeight=img.plainHeight() / resolutionY * 72 * PDFConstants.LAYOUT_TO_PDF_RATIO;
    int actualWidth=(int)imageWidth;
    int actualHeight=(int)imageHeight;
    if (widthStr != null && widthStr.length() > 0 || heightStr != null && heightStr.length() > 0) {
      if ("String_Node_Str".equals(widthStr) || "String_Node_Str".equals(heightStr)) {
        float rh=imageHeight / height;
        float rw=imageWidth / width;
        if (rh > rw) {
          actualHeight=height;
          actualWidth=(int)(imageWidth * height / imageHeight);
        }
 else {
          actualWidth=width;
          actualHeight=(int)(imageHeight * width / imageWidth);
        }
      }
 else       if ("String_Node_Str".equals(widthStr) || "String_Node_Str".equals(heightStr)) {
        float rh=imageHeight / height;
        float rw=imageWidth / width;
        if (rh > rw) {
          actualWidth=width;
          actualHeight=(int)(imageHeight * width / imageWidth);
        }
 else {
          actualHeight=height;
          actualWidth=(int)(imageWidth * height / imageHeight);
        }
      }
 else {
        DimensionType widthDim=DimensionType.parserUnit(widthStr);
        DimensionType heightDim=DimensionType.parserUnit(heightStr);
        if (widthDim != null) {
          actualWidth=PropertyUtil.getDimensionValue(content,widthDim);
          if (heightDim == null) {
            actualHeight=(int)(imageHeight * actualWidth / imageWidth);
          }
 else {
            actualHeight=PropertyUtil.getDimensionValue(content,heightDim);
          }
        }
 else         if (heightDim != null) {
          actualHeight=PropertyUtil.getDimensionValue(content,heightDim);
          if (widthDim == null) {
            actualWidth=(int)(imageWidth * actualHeight / imageHeight);
          }
 else {
            actualWidth=PropertyUtil.getDimensionValue(content,widthDim);
          }
        }
 else {
          actualHeight=(int)imageHeight;
          actualWidth=(int)imageWidth;
        }
      }
    }
    IStyle cs=pageContent.getComputedStyle();
    return new BackgroundImageInfo(url,cs.getProperty(IStyle.STYLE_BACKGROUND_REPEAT),getDimensionValue(cs.getProperty(IStyle.STYLE_BACKGROUND_POSITION_X),width - actualWidth),getDimensionValue(cs.getProperty(IStyle.STYLE_BACKGROUND_POSITION_Y),height - actualHeight),actualHeight,actualWidth);
  }
  return null;
}