image: Make the ppm writing code a tiny bit shorter

This commit is contained in:
Nico Weber 2023-03-15 11:16:48 +01:00 committed by Linus Groh
commit 76d8e5d866
Notes: sideshowbarker 2024-07-18 00:41:35 +09:00

View file

@ -48,7 +48,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
bytes = TRY(Gfx::PNGWriter::encode(*frame, { .icc_data = icc_data }));
} else if (out_path.ends_with(".ppm"sv, CaseSensitivity::CaseInsensitive)) {
auto const format = ppm_ascii ? Gfx::PortableFormatWriter::Options::Format::ASCII : Gfx::PortableFormatWriter::Options::Format::Raw;
bytes = TRY(Gfx::PortableFormatWriter::encode(*frame, Gfx::PortableFormatWriter::Options { .format = format }));
bytes = TRY(Gfx::PortableFormatWriter::encode(*frame, { .format = format }));
} else if (out_path.ends_with(".qoi"sv, CaseSensitivity::CaseInsensitive)) {
bytes = TRY(Gfx::QOIWriter::encode(*frame));
} else {