1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:57:44 +00:00

LibGfx: Change BMPWriter API to be consistent with other image writers

This commit is contained in:
Nico Weber 2023-03-12 12:09:29 -04:00 committed by Jelle Raaijmakers
parent 01387eb72b
commit f1a3028ef1
6 changed files with 15 additions and 12 deletions

View file

@ -371,11 +371,9 @@ ErrorOr<void> Mandelbrot::export_image(DeprecatedString const& export_path, Imag
m_set.resize(Gfx::IntSize { 1920, 1080 });
ByteBuffer encoded_data;
switch (image_type) {
case ImageType::BMP: {
Gfx::BMPWriter dumper;
encoded_data = dumper.dump(m_set.bitmap());
case ImageType::BMP:
encoded_data = TRY(Gfx::BMPWriter::encode(m_set.bitmap()));
break;
}
case ImageType::PNG:
encoded_data = TRY(Gfx::PNGWriter::encode(m_set.bitmap()));
break;