private Dimension getImageDimensions(File imgFile, Properties props) throws IOException, InterruptedException {
        logger.entering(getClass().getName(), "getImageDimensions", imgFile.getName());
        
        int width = 0;
        int height = 0;
        
        if (props.containsKey("imageTestProgArgs") &&
            props.containsKey("imageTestWidthPattern") &&
            props.containsKey("imageTestHeightPattern")) {
            // use external program to get dimensions
            List<String> argList = new LinkedList<String>();
            Scanner scanner = new Scanner(props.getProperty("imageTestProgArgs"));
            scanner.useDelimiter("\\s");
            while (scanner.hasNext()) {
                String token = scanner.next();
                if (token.contains("$INFILE")) {
                    argList.add(token.replace("$INFILE", imgFile.getCanonicalPath()));
                } else {
                    argList.add(token);
                }
            }
            String response = runProgramGetResp(argList);
            String widthStr = response.replaceAll(props.getProperty("imageTestWidthPattern"), "$1");
            String heightStr = response.replaceAll(props.getProperty("imageTestHeightPattern"), "$1");
            logger.finer("getImageDimensions - parsed values: width=" + widthStr + ", height=" + heightStr);
            width = Integer.parseInt(widthStr);
            height = Integer.parseInt(heightStr);
        }
        else {
            // get dimensions
            //BufferedImage srcImage = ImageIO.read(imgFile);   // note: this doesn't work for CMYK images
            BufferedImage img = readJPGFile(imgFile);           // this can read CMYK
            // get image dimensions
            width = img.getWidth();
            height = img.getHeight();
        }
        
        Dimension dimension = new Dimension(width, height);
        
        logger.exiting(getClass().getName(), "getImageDimensions", dimension);
        return dimension;        
    }