if (! saveDir.equals("")) {
fileOnly = FileUtils.addFolder(saveDir, fileOnly);
}
newImage = Toolkit.getDefaultToolkit().getImage(fileOnly);
tracker = new MediaTracker(this);
tracker.addImage(newImage, 0);
tracker.waitForAll();
imageHeight = newImage.getHeight(this);
imageWwidth = newImage.getWidth(this);
if ((imageHeight <= 0) || (imageWwidth <= 0)) {
newImage = Toolkit.getDefaultToolkit().getImage(brokenImageString);
tracker = new MediaTracker(this);
tracker.addImage(newImage, 0);
tracker.waitForAll();
imageHeight = newImage.getHeight(this);
imageWwidth = newImage.getWidth(this);
logger.error("loadImage() BROKEN IMAGE - failed to load: " + fileOnly);
isBroken = true;
}
else {
isBroken = false;
}
if (! isBroken) {
logger.debug("loadImage() ...finished loading image from URL.");
}
}
catch (InterruptedException ie) {
logger.error("loadImage() FAILED TO LOAD IMAGE - Image problem", ie);
isBroken = true;
}
// image from file
}
else {
try {
newImage = Toolkit.getDefaultToolkit().getImage(imageFileName);
tracker = new MediaTracker(this);
tracker.addImage(newImage, 0);
tracker.waitForAll();
imageHeight = newImage.getHeight(this);
imageWwidth = newImage.getWidth(this);
if ((imageHeight <= 0) || (imageWwidth <= 0)) {