1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:27:45 +00:00

LibGfx: Make QOIWriter use ErrorOr

In addition to it now handling allocation failures, the encode() API is
now consistent with PNGWriter.
This commit is contained in:
Nico Weber 2023-03-12 09:05:25 -04:00 committed by Linus Groh
parent b698d64ee9
commit 9b297c634f
6 changed files with 62 additions and 52 deletions

View file

@ -196,7 +196,7 @@ ErrorOr<void> Image::export_qoi_to_file(NonnullOwnPtr<Stream> stream) const
{
auto bitmap = TRY(compose_bitmap(Gfx::BitmapFormat::BGRA8888));
auto encoded_data = Gfx::QOIWriter::encode(bitmap);
auto encoded_data = TRY(Gfx::QOIWriter::encode(bitmap));
TRY(stream->write_entire_buffer(encoded_data));
return {};
}