mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-17 22:39:52 +02:00
Revert "Do not use a palette for one color images."
This reverts commit b6513fbaa8
.
This change can produce files that can cause decode failures in some
versions of chrome and safari/ios/macos.
https://chromium-review.googlesource.com/c/chromium/src/+/2876279
The chrome fix will be available in M92. This change can be revisited
after it and the mac updates are more widely deployed.
Bug: b/186640109,b/188702956
Change-Id: I296b8fe88c6c48219e3edf532226c4f972f1605b
This commit is contained in:
@ -591,19 +591,6 @@ static int EncoderAnalyze(VP8LEncoder* const enc,
|
||||
sizeof(*enc->palette_sorted_), PaletteCompareColorsForQsort);
|
||||
}
|
||||
|
||||
if (use_palette && enc->palette_size_ == 1) {
|
||||
crunch_configs[0].entropy_idx_ = kDirect;
|
||||
crunch_configs[0].sub_configs_size_ = 1;
|
||||
crunch_configs[0].sub_configs_[0].lz77_ = kLZ77None;
|
||||
crunch_configs[0].sub_configs_[0].do_no_cache_ = 1;
|
||||
*crunch_configs_size = 1;
|
||||
// Get the entropy image as small as possible.
|
||||
enc->histo_bits_ = MAX_HUFFMAN_BITS;
|
||||
// The transform image is unused as we are direct.
|
||||
enc->transform_bits_ = MAX_TRANSFORM_BITS;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Empirical bit sizes.
|
||||
enc->histo_bits_ = GetHistoBits(method, use_palette,
|
||||
pic->width, pic->height);
|
||||
|
Reference in New Issue
Block a user