ladybird/Tests
Nico Weber 1e31753382 Tests/LibGfx: Add a jbig2 file using refinement in the text segment
This adds a test for the code added in #23696.

I created this file using `jbig2` (see below for details), but as
usual it required a bunch of changes to it to make it actually produce
spec-compliant output. See the PR adding this image for my local diff.

I created the test image file by running this shell script with
`jbig2` tweaked as described above:

    #!/bin/bash
    set -eu

    S=Tests/LibGfx/test-inputs/bmp/bitmap.bmp

    # See make-symbol-jbig.sh (the script in #23659) for the general
    # setup and some comments. Note that the symbol section here only
    # has 3 symbols, instead of 4 over there.
    #
    # `-RefID` takes 6 arguments:
    # 1. The symbol ID of the base symbol (like after an `-ID`)
    # 2. A bmp file that the base symbol gets refined to
    # 3. y, x (like after an `-ID`)
    # 4. dx, dy (note swapped order to previous item)
    #
    # We also explicitly set refinement adaptive pixels, because the
    # default adaptive refinement pixels aren't the nominal pixels from
    # the spec.

    cat << EOF > jbig2-symbol-textrefine.ini
    -sym -Seg 1
    -sym -file -numClass -HeightClass 3 -WidthClass 1
    -sym -file -numSymbol 3
    -sym -file -Height 250
    -sym -file -Width 120 -Simple 0 mouth-1bpp.bmp
    -sym -file -EndOfHeightClass
    -sym -file -Height 100
    -sym -file -Width 100 -Simple 1 nose-1bpp.bmp
    -sym -file -EndOfHeightClass
    -sym -file -Height 30
    -sym -file -Width 30 -Simple 2 top_eye-1bpp.bmp
    -sym -file -EndOfHeightClass
    -sym -Param -Huff_DH 0
    -sym -Param -Huff_DW 0

    -txt -Seg 2
    -txt -Param -numInst 4
        -ID 2 108 50 -RefID 2 bottom_eye-1bpp.bmp 265 60 0 0
        -ID 1 100 135 -ID 0 70 232
    -txt -Param -RefCorner 1
    -txt -Param -Xlocation 0
    -txt -Param -Ylocation 0
    -txt -Param -W 399
    -txt -Param -H 400
    -txt -Param -rATX1 -1
    -txt -Param -rATY1 -1
    -txt -Param -rATX2 -1
    -txt -Param -rATY2 -1
    EOF

    J=$HOME/Downloads/T-REC-T.88-201808-I\!\!SOFT-ZST-E/Software
    J=$J/JBIG2_SampleSoftware-A20180829/source/jbig2

    $J -i "${S%.bmp}" -f bmp -o symbol-textrefine -F jb2 -ini \
        jbig2-symbol-textrefine.ini
2024-03-25 15:11:57 -04:00
..
AK AK: Reject invalid Base64 encoded string lengths 2024-03-25 08:13:27 +01:00
JSSpecCompiler JSSpecCompiler: Parse method headers 2024-02-24 15:03:08 -07:00
Kernel Tests/Kernel: Add tests for verifying proper loop device support 2024-03-13 15:33:47 -06:00
LibAudio LibAudio: Test reading and writing of wav files 2024-01-08 07:20:11 -07:00
LibC LibFileSystem+Everywhere: Return ByteString from read_link() 2024-01-16 08:42:34 +00:00
LibCompress Tests/LibCompress: Add a reproducer of oss-fuzz issue 58046 2024-01-13 15:17:08 -07:00
LibCore Tests: Use Core::Environment instead of Core::System::*env() 2024-02-27 08:33:48 +00:00
LibCpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibCrypto LibCrypto: Remove unused Crypto::PK::EMSA_PSS class 2024-03-16 01:17:02 -06:00
LibDeviceTree LibDeviceTree: Add a simple DeviceTree class 2024-02-24 16:43:44 -07:00
LibDiff LibDiff: Fix wrong index used when prepending context lines 2023-09-11 12:10:50 +01:00
LibEDID AK: Rename AK::FixedPoint::round to rint and fix a rounding error 2023-08-14 14:20:45 -06:00
LibELF LibFileSystem+Everywhere: Return ByteString from read_link() 2024-01-16 08:42:34 +00:00
LibGfx Tests/LibGfx: Add a jbig2 file using refinement in the text segment 2024-03-25 15:11:57 -04:00
LibGL LibGL+LibGPU+LibSoftGPU: Implement blend equations 2024-02-19 23:23:40 +01:00
LibGLSL Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibIMAP Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibJS Tests: Use Core::Environment instead of Core::System::*env() 2024-02-27 08:33:48 +00:00
LibLocale LibLocale+LibJS+ClockSettings: Make date time format APIs infallible 2023-08-23 05:29:21 +02:00
LibMarkdown Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibPDF LibPDF: Handle indirect reference resolving during parsing more robustly 2024-03-19 19:20:01 -04:00
LibRegex LibRegex: Account for extra explicit And/Or in class parser assertion 2024-03-24 08:24:46 +01:00
LibSemVer Userland+Tests: Remove unused <AK/Tuple.h> includes 2024-03-01 14:05:53 -07:00
LibSQL LibSQL: Add a helper to convert a SQL::Value to a UnixDateTime 2024-01-10 23:26:40 +01:00
LibTest LibTest: Add more numeric generators 2024-01-12 16:42:51 -07:00
LibTextCodec LibTextCodec+Everywhere: Port Decoders to new Strings 2023-02-19 17:15:47 +01:00
LibThreading LibThreading: Improve resiliancy of timed threading tests 2023-05-24 00:25:35 +02:00
LibTimeZone LibTimeZone+Userland: Change timezone functions to use UnixDateTime 2023-05-24 23:18:07 +02:00
LibTLS Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibTTF LibGfx/OpenType: Ensure Cmap subtable offset is within expected range 2023-11-11 22:20:17 +01:00
LibUnicode LibUnicode: Add IDNA::to_ascii 2023-12-10 08:04:58 -05:00
LibURL LibURL+LibWeb: Move data URL processing to LibWeb's fetch infrastructure 2024-03-25 08:13:27 +01:00
LibVideo Tests: Add regression tests for fixed OSS-Fuzz test cases 2023-10-24 07:30:04 +02:00
LibWasm Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibWeb LibWeb: Remove cache for Paintable::is_visible() 2024-03-25 14:17:30 +01:00
LibWebView AK+LibURL: Move AK::URL into a new URL library 2024-03-18 14:06:28 -04:00
LibXML LibXML: Actually append resolved references when parsing content 2023-07-23 16:09:12 +02:00
Spreadsheet Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Utilities patch+LibDiff: Add support for applying patches with preprocessor macro 2024-03-03 08:56:00 +01:00
CMakeLists.txt AK+LibURL: Move AK::URL into a new URL library 2024-03-18 14:06:28 -04:00