1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:18:12 +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

@ -176,8 +176,7 @@ ErrorOr<void> Image::export_bmp_to_file(NonnullOwnPtr<Stream> stream, bool prese
auto bitmap_format = preserve_alpha_channel ? Gfx::BitmapFormat::BGRA8888 : Gfx::BitmapFormat::BGRx8888;
auto bitmap = TRY(compose_bitmap(bitmap_format));
Gfx::BMPWriter dumper;
auto encoded_data = dumper.dump(bitmap);
auto encoded_data = TRY(Gfx::BMPWriter::encode(*bitmap));
TRY(stream->write_entire_buffer(encoded_data));
return {};
}