From d596c0f603b20fd7beccd8cf66b662a7d36fbe94 Mon Sep 17 00:00:00 2001 From: guptaprince8832 Date: Mon, 17 Jul 2017 22:42:49 +0530 Subject: [PATCH] Speed up recommendations with -t- options --- precomp.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/precomp.cpp b/precomp.cpp index 243a656..be263dc 100644 --- a/precomp.cpp +++ b/precomp.cpp @@ -3372,6 +3372,34 @@ void show_used_levels() { } } + string disable_methods(""); // for comfort it will be reverse +/* +P = PDF, Z = ZIP, G = GZip, N = PNG, F = GIF, J = JPG +S = SWF, M = MIME Base64, B = bZip2, 3 = MP3 +*/ +#ifdef COMFORT +#define DISABLE_OR_ENABLE_FOR_COMFORT ! +#else +#define DISABLE_OR_ENABLE_FOR_COMFORT +#endif // COMFORT + if (((use_pdf) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_pdf_count == 0) || (decompressed_pdf_count == 0)))) disable_methods += 'P'; + if (((use_zip) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_zip_count == 0) && (decompressed_zip_count == 0)))) disable_methods += 'Z'; + if (((use_gzip) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_gzip_count == 0) && (decompressed_gzip_count == 0)))) disable_methods += 'G'; + if ((((use_png) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_png_count == 0) && (decompressed_png_count == 0))) && ((recompressed_png_multi_count == 0) && (decompressed_png_multi_count == 0)) )) disable_methods += 'N'; + if (((use_gif) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_gif_count == 0) && (decompressed_gif_count == 0)))) disable_methods += 'G'; + if (((use_jpg) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_jpg_count == 0) && (decompressed_jpg_count == 0)))) disable_methods += 'J'; + if (((use_jpg) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_jpg_prog_count == 0) && (decompressed_jpg_prog_count == 0)))) disable_methods += 'P'; + if (((use_mp3) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_mp3_count == 0) && (decompressed_mp3_count == 0)))) disable_methods += '3'; + if (((use_swf) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_swf_count == 0) && (decompressed_swf_count == 0)))) disable_methods += 'S'; + if (((use_base64) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_base64_count == 0) && (decompressed_base64_count == 0)))) disable_methods += 'M'; + if (((use_bzip2) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_bzip2_count == 0) && (decompressed_bzip2_count == 0)))) disable_methods += 'B'; + if ( disable_methods.length() > 0 ) { + if (DISABLE_OR_ENABLE_FOR_COMFORT(false)) + printf("\nCompression_Types=%s",disable_methods.c_str()); + else + printf(" -t-%s",disable_methods.c_str()); + } + if (max_recursion_depth_reached) { printf("\n\nMaximal recursion depth %i reached, increasing it could give better results.\n", max_recursion_depth); } else if (max_recursion_depth_used != max_recursion_depth) {