mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:07:45 +00:00
image: Support JPEG as an output format
This commit is contained in:
parent
226b214142
commit
b7c30f3096
1 changed files with 4 additions and 0 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <LibGfx/ICC/Profile.h>
|
||||
#include <LibGfx/ImageFormats/BMPWriter.h>
|
||||
#include <LibGfx/ImageFormats/ImageDecoder.h>
|
||||
#include <LibGfx/ImageFormats/JPEGWriter.h>
|
||||
#include <LibGfx/ImageFormats/PNGWriter.h>
|
||||
#include <LibGfx/ImageFormats/PortableFormatWriter.h>
|
||||
#include <LibGfx/ImageFormats/QOIWriter.h>
|
||||
|
@ -152,6 +153,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto const format = ppm_ascii ? Gfx::PortableFormatWriter::Options::Format::ASCII : Gfx::PortableFormatWriter::Options::Format::Raw;
|
||||
TRY(Gfx::PortableFormatWriter::encode(*buffered_stream, *frame, { .format = format }));
|
||||
return 0;
|
||||
} else if (out_path.ends_with(".jpg"sv, CaseSensitivity::CaseInsensitive) || out_path.ends_with(".jpeg"sv, CaseSensitivity::CaseInsensitive)) {
|
||||
TRY(Gfx::JPEGWriter::encode(*buffered_stream, *frame));
|
||||
return 0;
|
||||
} else if (out_path.ends_with(".qoi"sv, CaseSensitivity::CaseInsensitive)) {
|
||||
bytes = TRY(Gfx::QOIWriter::encode(*frame));
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue