diff --git a/Userland/Libraries/LibGfx/ImageFormats/ImageDecoder.h b/Userland/Libraries/LibGfx/ImageFormats/ImageDecoder.h index 92626d37c4..7f4ff02ecc 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/ImageDecoder.h +++ b/Userland/Libraries/LibGfx/ImageFormats/ImageDecoder.h @@ -31,6 +31,7 @@ struct VectorImageFrameDescriptor { enum class NaturalFrameFormat { RGB, + Grayscale, CMYK, Vector, }; diff --git a/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp index 3f8bc1a27a..6ae1b4cb3b 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp @@ -2010,7 +2010,11 @@ NaturalFrameFormat JPEGImageDecoderPlugin::natural_frame_format() const if (m_context->state == JPEGLoadingContext::State::Error) return NaturalFrameFormat::RGB; VERIFY(m_context->state >= JPEGLoadingContext::State::HeaderDecoded); - return m_context->components.size() == 4 ? NaturalFrameFormat::CMYK : NaturalFrameFormat::RGB; + if (m_context->components.size() == 1) + return NaturalFrameFormat::Grayscale; + if (m_context->components.size() == 4) + return NaturalFrameFormat::CMYK; + return NaturalFrameFormat::RGB; } ErrorOr> JPEGImageDecoderPlugin::cmyk_frame()