1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:47:35 +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

@ -42,7 +42,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
} else if (out_path.ends_with(".png"sv, CaseSensitivity::CaseInsensitive)) {
bytes = TRY(Gfx::PNGWriter::encode(*frame));
} else if (out_path.ends_with(".qoi"sv, CaseSensitivity::CaseInsensitive)) {
bytes = Gfx::QOIWriter::encode(*frame);
bytes = TRY(Gfx::QOIWriter::encode(*frame));
} else {
warnln("can only write .bmp, .png, and .qoi");
return 1;