From 7b1ecb45990e26521e892e3606a2a2fd0baf26e8 Mon Sep 17 00:00:00 2001 From: spillerrec Date: Sun, 11 Oct 2015 15:30:39 +0200 Subject: [PATCH] ADD: --combined option ADD: text to --auto and --combined in README.md --- README.md | 8 +++++++- src/main.cpp | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0603dc1..8ff401a 100644 --- a/README.md +++ b/README.md @@ -22,12 +22,18 @@ Provides a file-size/compression-time trade-off. A value of 0 means maximum comp --help Display quick help and exit + --auto +Automatically tries to split the input files into several cgCompress files based on visual difference. Note that it will expand folders. It only compares files next to each other, so it requires the files to be in order. See `--combined` to manually fix those files which were split incorrectly. + --extract -Extract the images in cgCompress files to their original state. Use *\--format* to change output file format. Currently requires qt5-cgcompress-plugin to be installed. +Extract the images in cgCompress files to their original state. Use `--format` to change output file format. Currently requires qt5-cgcompress-plugin to be installed. --recompress Extract and recompress cgCompress files. Useful for optimizing files which were created in an older version of cgCompress. Currently requires qt5-cgcompress-plugin to be installed. + --combined +Extract and combines several cgCompress files into one file. Allows ordinary image files as well. Useful when `--auto` fails to combine files. + --pack Create a cgCompress file from a directory containing an un-zipped cgCompress file. OpenRaster sets some requirements on the structure of the zip archive such as file order and compression settings, use this option to get it correct. diff --git a/src/main.cpp b/src/main.cpp index b2224e5..c55ec60 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -152,6 +152,14 @@ int main( int argc, char* argv[] ){ doMultiImg( multi_img, name ); } } + else if( options.contains( "--combined" ) ){ + MultiImage multi_img( format ); + for( auto file : files ) + for( auto image : extract_files( file ) ) + multi_img.append( Image( image.second ) ); + + doMultiImg( multi_img, QFileInfo(files[0]).completeBaseName() ); + } else{ files = expandFolders( files );