Images 💾

Last commit ⭐

commit 6971ba35d53b7f55ad00f1129c0f7f4678a46b9e
Author:     Nico Weber <thakis@chromium.org>
AuthorDate: Mon Jan 29 10:56:22 2024 -0500
Commit:     Andreas Kling <kling@serenityos.org>
CommitDate: Tue Jan 30 05:35:22 2024 +0100

    LibGfx+Tests: Support grayscale jpegs with 2x2 sampling and MCU reset
    
    Non-interleaved files always have an MCU of one data unit.
    
    (A "data unit" is an 8x8 tile of pixels, and an "MCU" is a
    "minium coded unit", e.g. 2x2 data units for luminance and
    1 data unit each for Cr and Cb for a YCrCb image with
    4:2:0 subsampling.)
    
    For the test case, I converted an existing image to a ppm:
    
        Build/lagom/bin/image -o out.ppm \
            Tests/LibGfx/test-inputs/jpg/12-bit.jpg
    
    Then I converted it to grayscale and saved it as a pgm in Photoshop.
    Then I turned it into a weird jpeg like so:
    
        path/to/cjpeg \
            -outfile Tests/LibGfx/test-inputs/jpg/grayscale_mcu.jpg \
            -sample 2x2 -restart 3 out.pgm
    
    Makes 3 of the 5 jpegs failing to decode at #22780 go.