Expose the option of try_best_compression_for_png

This commit is contained in:
Huibao Lin
2017-03-08 16:23:13 -05:00
parent 5300d22fa1
commit c591621b2e
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -230,7 +230,7 @@ bool ImageOptimizer::ConfigureWriter() {
case IMAGE_PNG:
png_config.reset(
new PngCompressParams(
true /* try best compression */,
options_.try_best_compression_for_png(),
false /* never use progressive format */));
writer_config_.reset(png_config.release());
result = true;
@@ -35,6 +35,10 @@ message ImageOptions {
optional int32 max_webp_quality = 9 [ default = 85 ];
optional int32 max_webp_animated_quality = 10 [ default = 85 ];
optional int32 max_timeout_ms = 11 [ default = -1 ];
// When |try_best_compression_for_png| is set to true, the optimizer uses
// multiple methods, including the expensive ones, for encoding PNG images.
// The smallest output from all methods will be returned.
optional bool try_best_compression_for_png = 12 [ default = true ];
}
message ImageDimensions {