mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:27:45 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue