From f66de973ff78b42273ec5f813e5a7b3abeac1a1b Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Tue, 21 Mar 2023 19:08:01 -0400 Subject: [PATCH] LibGfx/JPEG: Replace a FIXME with some explanations Calling the `ycbcr_to_rgb` function still looks unsuitable for this usage, but it does the job correctly. --- Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp index d0040c727c..3158084ef3 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp @@ -1306,8 +1306,9 @@ static ErrorOr handle_color_transform(JPEGLoadingContext const& context, V ycbcr_to_rgb(context, macroblocks); if (context.components.size() == 1) { - // FIXME: This is what we used to do for grayscale, - // we should at least document it and maybe change it. + // With Cb and Cr being equal to zero, this function assign the Y + // value (luminosity) to R, G and B. Providing a proper conversion + // from grayscale to RGB. ycbcr_to_rgb(context, macroblocks); }