Program: 75034
Project: 75034
Buggy source:
/** 
 * Draws the background image at the contentByteUnder of the PPT with the given offset
 * @param imageURI the URI referring the image
 * @param x the start X coordinate at the PPT where the image is positioned
 * @param y the start Y coordinate at the PPT where the image is positioned
 * @param width the width of the background dimension
 * @param height the height of the background dimension
 * @param positionX the offset X percentage relating to start X
 * @param positionY the offset Y percentage relating to start Y
 * @param repeat the background-repeat property
 * @param xMode whether the horizontal position is a percentage value or not
 * @param yMode whether the vertical position is a percentage value or not
 */
public void drawBackgroundImage(String imageURI,double x,double y,double width,double height,double positionX,double positionY,String repeat){
  if (imageURI == null || imageURI.length() == 0) {
    return;
  }
  byte[] imageData=null;
  try {
    InputStream imageStream=new URL(imageURI).openStream();
    imageData=new byte[imageStream.available()];
    imageStream.read(imageData);
  }
 catch (  IOException ioe) {
    logger.log(Level.WARNING,ioe.getMessage(),ioe);
  }
  String imageTitle="String_Node_Str" + currentPageNum + "String_Node_Str"+ (++shapeCount);
  imageTitles.add(imageTitle);
  String imageName;
  if (imageNames.containsKey(imageURI)) {
    imageName=(String)imageNames.get(imageURI);
  }
 else {
    String extension=getImageExtension(imageURI);
    imageName=imageTitle + "String_Node_Str" + extension;
    imageNames.put(imageTitle,imageName);
    imageExtensions.put(imageTitle,extension);
    recordFileLists(imageName);
    currentImageData.put(imageTitle,imageData);
  }
  exportImageDefn(imageName,imageTitle,width,height,x,y);
}

Fixed version (ground truth):
/** 
 * Draws the background image at the contentByteUnder of the PPT with the given offset
 * @param imageURI the URI referring the image
 * @param x the start X coordinate at the PPT where the image is positioned
 * @param y the start Y coordinate at the PPT where the image is positioned
 * @param width the width of the background dimension
 * @param height the height of the background dimension
 * @param positionX the offset X percentage relating to start X
 * @param positionY the offset Y percentage relating to start Y
 * @param repeat the background-repeat property
 * @param xMode whether the horizontal position is a percentage value or not
 * @param yMode whether the vertical position is a percentage value or not
 */
public void drawBackgroundImage(String imageURI,float x,float y,float width,float height,float positionX,float positionY,String repeat){
  if (imageURI == null || imageURI.length() == 0) {
    return;
  }
  float imageWidth=0;
  float imageHeight=0;
  byte[] imageData=null;
  InputStream imageStream=null;
  try {
    URL url=new URL(imageURI);
    imageStream=url.openStream();
    imageData=new byte[imageStream.available()];
    imageStream.read(imageData);
    imageStream.close();
    imageStream=url.openStream();
    Image image=ImageIO.read(imageStream);
    ImageIcon imageIcon=new ImageIcon(image);
    imageWidth=imageIcon.getIconWidth();
    imageHeight=imageIcon.getIconHeight();
  }
 catch (  IOException ioe) {
    logger.log(Level.WARNING,ioe.getMessage(),ioe);
  }
 finally {
    if (imageStream != null) {
      try {
        imageStream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  String imageTitle="String_Node_Str" + currentPageNum + "String_Node_Str"+ (++shapeCount);
  imageTitles.add(imageTitle);
  String imageName;
  if (imageNames.containsKey(imageURI)) {
    imageName=(String)imageNames.get(imageURI);
  }
 else {
    String extension=getImageExtension(imageURI);
    imageName=imageTitle + "String_Node_Str" + extension;
    imageNames.put(imageTitle,imageName);
    imageExtensions.put(imageTitle,extension);
    recordFileLists(imageName);
    currentImageData.put(imageTitle,imageData);
  }
  Position areaPosition=new Position(x,y);
  Position areaSize=new Position(width,height);
  Position imagePosition=new Position(x + positionX,y + positionY);
  Position imageSize=new Position(imageWidth,imageHeight);
  BackgroundImageLayout layout=new BackgroundImageLayout(areaPosition,areaSize,imagePosition,imageSize);
  Collection positions=layout.getImagePositions(repeat);
  Iterator iterator=positions.iterator();
  while (iterator.hasNext()) {
    Position position=(Position)iterator.next();
    exportImageDefn(imageName,imageTitle,imageWidth,imageHeight,position.getX(),position.getY());
  }
}