Using use_argb conditionally

This commit is contained in:
Jake Archibald
2018-12-17 10:21:30 +00:00
parent 9260bed1b1
commit d30a85fd48
2 changed files with 2 additions and 1 deletions

View File

@@ -26,7 +26,8 @@ val encode(std::string img, int width, int height, WebPConfig config) {
throw std::runtime_error("Unexpected error"); throw std::runtime_error("Unexpected error");
} }
pic.use_argb = 1; // Only use use_argb if we really need it, as it's slower.
pic.use_argb = config.lossless || config.use_sharp_yuv || config.preprocessing > 0;
pic.width = width; pic.width = width;
pic.height = height; pic.height = height;
pic.writer = WebPMemoryWrite; pic.writer = WebPMemoryWrite;

Binary file not shown.