From: Eric Biggers Date: Sat, 1 Sep 2012 21:36:34 +0000 (-0500) Subject: imagex export: For new dest WIMs, default to ctype of src WIM X-Git-Tag: v1.0.0 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=e539282ce394eba2d94752c3e3cbf8beaaad7aff imagex export: For new dest WIMs, default to ctype of src WIM --- diff --git a/doc/imagex-export.1.in b/doc/imagex-export.1.in index e80a5d13..bc442d9d 100644 --- a/doc/imagex-export.1.in +++ b/doc/imagex-export.1.in @@ -55,7 +55,8 @@ Specifies the compression type for \fIDEST_WIMFILE\fR. This is only valid if \fIDEST_WIMFILE\fR does not yet exist, since if \fIDEST_WIMFILE\fR exists, the compression type must be the same as that of \fIDEST_WIMFILE\fR. -\fITYPE\fR may be "none", "maximum", or "fast". By default, it is "fast". +\fITYPE\fR may be "none", "maximum", or "fast". By default, it is the same as +that of the input WIM file. You may also specify the actual names of the compression algorithms, "XPRESS" and "LZX", instead of "fast" and "maximum", respectively. diff --git a/programs/imagex.c b/programs/imagex.c index 6d8b1a88..376ba984 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -735,7 +735,7 @@ static int imagex_export(int argc, const char **argv) int open_flags = WIMLIB_OPEN_FLAG_SHOW_PROGRESS; int export_flags = 0; int write_flags = WIMLIB_WRITE_FLAG_SHOW_PROGRESS; - int compression_type = WIM_COMPRESSION_TYPE_XPRESS; + int compression_type; bool compression_type_specified = false; const char *src_wimfile; const char *src_image_num_or_name; @@ -818,6 +818,8 @@ static int imagex_export(int argc, const char **argv) } else { wim_is_new = true; /* dest_wimfile is not an existing file, so create a new WIM. */ + if (!compression_type_specified) + compression_type = wimlib_get_compression_type(src_w); if (errno == ENOENT) { ret = wimlib_create_new_wim(compression_type, &dest_w); if (ret != 0) diff --git a/programs/mkwinpeimg b/programs/mkwinpeimg index 8d0d176a..3e932e74 100755 --- a/programs/mkwinpeimg +++ b/programs/mkwinpeimg @@ -333,7 +333,7 @@ get_boot_wim() { wim="$windows_dir/sources/boot.wim" stat_busy "Exporting image from \"$wim\"" imagex export "$windows_dir"/sources/boot.wim 2 \ - --compress --boot "$boot_wim" || stat_fail + --boot "$boot_wim" || stat_fail stat_done fi else