The API for Image states that getWidth/getHeight can return -1 if the height is not yet known. Use ImageIO to read the file, as using the Toolkit seems to result in this behavior (at least on my...