LibGfx/JPEG: Accept grayscale images with an App14 segment
The adobe specification doesn't even consider JPEG images with a single component. So let's not consider the content of the App14 segment for grayscale images.
This commit is contained in:
parent
8df714ff1e
commit
af14ed6b2e
Notes:
sideshowbarker
2024-07-16 23:05:02 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/af14ed6b2e Pull-request: https://github.com/SerenityOS/serenity/pull/19574
1 changed files with 3 additions and 1 deletions
|
@ -1687,7 +1687,9 @@ static void ycck_to_rgb(JPEGLoadingContext const& context, Vector<Macroblock>& m
|
|||
|
||||
static ErrorOr<void> handle_color_transform(JPEGLoadingContext const& context, Vector<Macroblock>& macroblocks)
|
||||
{
|
||||
if (context.color_transform.has_value()) {
|
||||
// Note: This is non-standard but some encoder still add the App14 segment for grayscale images.
|
||||
// So let's ignore the color transform value if we only have one component.
|
||||
if (context.color_transform.has_value() && context.components.size() != 1) {
|
||||
// https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-T.872-201206-I!!PDF-E&type=items
|
||||
// 6.5.3 - APP14 marker segment for colour encoding
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue