List<File> todoImageList = new ArrayList();
ImageUtil.findImagesRecusive(todoImageList, params.getInputFiles());
imgCount = todoImageList.size();
//iterator images
for (File ifile : todoImageList) {
ImageActionVO vo = new ImageActionVO();
vo.setParams(params);
File ofile = null;
//get output file
if (params.isOverride()) {
//doOverride is true, just use input file as output file
ofile = ifile;
} else {
//doOverride is false, save images to specified output folder
String absPath = "";
String outputFolderPath = vo.getParams().getOutputFolder().getAbsolutePath();
if(outputFolderPath.endsWith("\\.")){
outputFolderPath = outputFolderPath.substring(0, outputFolderPath.length()-2);
}
absPath = outputFolderPath + File.separator + ifile.getName();
ofile = new File(absPath);
}
//logger.info("Input image:"+ifile.getAbsolutePath());
//logger.info("Output image:"+ofile.getAbsolutePath());
vo.setInputImageFile(ifile);
vo.setOutputImageFile(ofile);
//execute ImageDecorateTask
threadPool.execute(new ImageDecorateTask(vo));
Thread.sleep(10);
//release binding resources
System.gc();