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:
parent
b698d64ee9
commit
9b297c634f
6 changed files with 62 additions and 52 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue