#include #include #include #include #include #include #include #include #include #include void convert(const String &strPathFileName,const String &strPathSaveFile,int width); Console console(Console::ConsoleType(Console::Write|Console::Read)); Options getOptions(int argc,char **argv); void main(int argc,char **argv) { Block entryList; PathFind pathFind; String strExtension(".jpg"); String strMask("*"); String strPathDirectory; String strPathDestination; String strPathHTML("index.html"); File outFile; Profile profile; DiskInfo diskInfo; Options options; options=getOptions(argc,argv); if(1==argc||options.getHelp()) { console.writeLine("USAGE -s -d -iw -tw -q "); console.read(); return; } console.writeLine("2001 diversified software solutions \"http://www.diversified-software.com\""); console.writeLine(String("source-path:")+options.getInputPath()); console.writeLine(String("destination-path:")+options.getOutputPath()); console.writeLine(String("thumbnail-width:")+String().fromInt(options.getThumbnailWidth())); console.writeLine(String("image-width:")+String().fromInt(options.getImageWidth())); console.writeLine(String("quality:")+String().fromInt(options.getQuality())); strPathDirectory=options.getInputPath()+String("\\"); strPathDestination=options.getOutputPath()+String("\\"); pathFind.fileList(strPathDirectory+strMask+strExtension,entryList); if(!entryList.size())return; if(!outFile.open(strPathDestination+strPathHTML,"wb"))return; outFile.writeLine(""); outFile.writeLine(""); outFile.writeLine("Image"); outFile.writeLine(""); outFile.writeLine(""); outFile.writeLine("

 

"); diskInfo.createDirectory(strPathDestination); for(int index=0;index")); } outFile.writeLine(""); outFile.writeLine(""); } void convert(const String &strPathFileName,const String &strPathSaveFile,int width) { JPGImage jpgImage; PureDevice screenDevice; Profile profile; String strSaveFileName; String strPathDirectory; DiskInfo diskInfo; strPathDirectory=strPathFileName; profile.makeFileName(strPathFileName,strSaveFileName); strSaveFileName=strSaveFileName.betweenString(0,'.'); strSaveFileName+=".bmp"; profile.makeDirectoryName(strPathDirectory); strPathDirectory+=String("\\")+strSaveFileName; screenDevice.screenDevice(); jpgImage.decode(strPathFileName,screenDevice); jpgImage.resample(screenDevice,width); jpgImage.saveBitmap(strPathDirectory); ImageConverter::convert(strPathDirectory,strPathSaveFile,100); diskInfo.unlink(strPathDirectory); } /* -s sourcedir -d destination -iw imagewidth -tw thumbnailwidth -q quality -? display help */ Options getOptions(int argc,char **argv) { Options options; for(int arg=1;arg