mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibGfx: Compress PNGs with a better compression level
While for a general purpose encoder a good balance between compression speed and size by default is important, in case of PNG it don't matter that much, as it was said in #14594. Also note that it's not the best we can have. We use zlib's compression level, which has a range of 0-4, while our deflate implementation ranges from 0 to 5.
This commit is contained in:
parent
a0546318f9
commit
cf69763b54
Notes:
sideshowbarker
2024-07-17 08:29:50 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/cf69763b54 Pull-request: https://github.com/SerenityOS/serenity/pull/14738
@ -250,7 +250,7 @@ void PNGWriter::add_IDAT_chunk(Gfx::Bitmap const& bitmap)
|
||||
uncompressed_block_data.append(best_filter.buffer);
|
||||
}
|
||||
|
||||
auto maybe_zlib_buffer = Compress::ZlibCompressor::compress_all(uncompressed_block_data);
|
||||
auto maybe_zlib_buffer = Compress::ZlibCompressor::compress_all(uncompressed_block_data, Compress::ZlibCompressionLevel::Best);
|
||||
if (!maybe_zlib_buffer.has_value()) {
|
||||
// FIXME: Handle errors.
|
||||
VERIFY_NOT_REACHED();
|
||||
|
Loading…
Reference in New Issue
Block a user