}
}
+static void
+set_compress_slow(void)
+{
+ static const struct wimlib_lzx_params slow_params = {
+ .size_of_this = sizeof(struct wimlib_lzx_params),
+ .algorithm = WIMLIB_LZX_ALGORITHM_SLOW,
+ .alg_params = {
+ .slow = {
+ .use_len2_matches = 1,
+ .num_fast_bytes = 96,
+ .num_optim_passes = 4,
+ .max_search_depth = 100,
+ .max_matches_per_pos = 10,
+ .main_nostat_cost = 15,
+ .len_nostat_cost = 15,
+ .aligned_nostat_cost = 7,
+ },
+ },
+ };
+ if (wimlib_lzx_set_default_params(&slow_params))
+ imagex_error(T("Couldn't set slow compression parameters.!"));
+}
+
struct string_set {
const tchar **strings;
unsigned num_strings;
int add_image_flags = WIMLIB_ADD_IMAGE_FLAG_EXCLUDE_VERBOSE |
WIMLIB_ADD_IMAGE_FLAG_WINCONFIG;
int write_flags = 0;
- int compression_type = WIMLIB_COMPRESSION_TYPE_LZX;
+ int compression_type = WIMLIB_COMPRESSION_TYPE_INVALID;
const tchar *wimfile;
int wim_fd;
const tchar *name;
goto out_err;
break;
case IMAGEX_COMPRESS_SLOW_OPTION:
- write_flags |= WIMLIB_WRITE_FLAG_COMPRESS_SLOW;
+ set_compress_slow();
break;
case IMAGEX_FLAGS_OPTION:
flags_element = optarg;
source = argv[0];
wimfile = argv[1];
+ /* Set default compression type. */
+ if (compression_type == WIMLIB_COMPRESSION_TYPE_INVALID) {
+ struct wimlib_lzx_params params;
+ memset(¶ms, 0, sizeof(params));
+ params.size_of_this = sizeof(params);
+ params.algorithm = WIMLIB_LZX_ALGORITHM_FAST;
+ params.use_defaults = 1;
+
+ wimlib_lzx_set_default_params(¶ms);
+ compression_type = WIMLIB_COMPRESSION_TYPE_LZX;
+ }
+
if (!tstrcmp(wimfile, T("-"))) {
/* Writing captured WIM to standard output. */
#if 0
write_flags |= WIMLIB_WRITE_FLAG_RECOMPRESS;
break;
case IMAGEX_COMPRESS_SLOW_OPTION:
- write_flags |= WIMLIB_WRITE_FLAG_COMPRESS_SLOW;
+ set_compress_slow();
break;
case IMAGEX_THREADS_OPTION:
num_threads = parse_num_threads(optarg);
T(
" %"TS" (DIRECTORY | NTFS_VOLUME) WIMFILE\n"
" [IMAGE_NAME [IMAGE_DESCRIPTION]] [--boot]\n"
-" [--check] [--nocheck] [--compress-slow]\n"
-" [--flags EDITION_ID] [--verbose] [--dereference]\n"
-" [--config=FILE] [--threads=NUM_THREADS] [--source-list]\n"
-" [--no-acls] [--strict-acls] [--rpfix] [--norpfix]\n"
-" [--unix-data] [--pipable] [--update-of=[WIMFILE:]IMAGE]\n"
+" [--check] [--nocheck] [--flags EDITION_ID] [--verbose]\n"
+" [--dereference] [--config=FILE] [--threads=NUM_THREADS]\n"
+" [--source-list] [--no-acls] [--strict-acls] [--rpfix]\n"
+" [--norpfix] [--unix-data] [--pipable]\n"
+" [--update-of=[WIMFILE:]IMAGE]\n"
),
[CMD_APPLY] =
T(
T(
" %"TS" (DIRECTORY | NTFS_VOLUME) WIMFILE\n"
" [IMAGE_NAME [IMAGE_DESCRIPTION]] [--boot]\n"
-" [--check] [--nocheck] [--compress=TYPE] [--compress-slow]\n"
+" [--check] [--nocheck] [--compress=TYPE]\n"
" [--flags EDITION_ID] [--verbose] [--dereference]\n"
" [--config=FILE] [--threads=NUM_THREADS] [--source-list]\n"
" [--no-acls] [--strict-acls] [--rpfix] [--norpfix]\n"
#endif
[CMD_OPTIMIZE] =
T(
-" %"TS" WIMFILE [--check] [--nocheck] [--recompress]\n"
-" [--compress-slow] [--threads=NUM_THREADS]\n"
-" [--pipable] [--not-pipable]\n"
+" %"TS" WIMFILE [--check] [--nocheck] [--recompress] [--compress-slow]\n"
+" [--threads=NUM_THREADS] [--pipable] [--not-pipable]\n"
),
[CMD_SPLIT] =
T(