v0.12.0i13: lossless encode-effort knob (ratio ↔ speed) #399
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| checks: write | |
| jobs: | |
| build-and-test: | |
| name: Build & test (macOS) | |
| runs-on: macos-15 | |
| timeout-minutes: 25 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Show toolchain | |
| run: | | |
| swift --version | |
| sw_vers | |
| - name: Install libjxl + pkg-config | |
| run: | | |
| brew update | |
| brew install jpeg-xl pkg-config | |
| - name: Build (release) | |
| run: swift build -c release | |
| - name: Test | |
| run: swift test -c release | |
| - name: CLI smoke test | |
| run: | | |
| # Generate a small synthetic PNG, encode + decode through jxl-tool, | |
| # then verify libjxl can decode the same .jxl (cross-codec sanity). | |
| mkdir -p /tmp/ci | |
| python3 - <<'PY' | |
| import struct, zlib | |
| w, h = 32, 32 | |
| raw = b''.join(b'\x00' + bytes((x + y) & 0xff for x in range(w)) for y in range(h)) | |
| def chunk(t, d): | |
| return struct.pack('>I', len(d)) + t + d + struct.pack('>I', zlib.crc32(t + d)) | |
| ihdr = chunk(b'IHDR', struct.pack('>IIBBBBB', w, h, 8, 0, 0, 0, 0)) | |
| idat = chunk(b'IDAT', zlib.compress(raw)) | |
| iend = chunk(b'IEND', b'') | |
| open('/tmp/ci/in.png', 'wb').write(b'\x89PNG\r\n\x1a\n' + ihdr + idat + iend) | |
| PY | |
| .build/release/jxl-tool --version | |
| .build/release/jxl-tool encode --input /tmp/ci/in.png --output /tmp/ci/out.jxl --lossless --effort 5 | |
| /opt/homebrew/bin/djxl /tmp/ci/out.jxl /tmp/ci/ref.png | |
| .build/release/jxl-tool decode --input /tmp/ci/out.jxl --output /tmp/ci/recovered.png | |
| - name: Lint - no leftover NIfTI references | |
| run: | | |
| # Should be 0 — the NIfTI feature was rolled back. | |
| ! grep -rni 'nifti\|\\.nii' Sources Tests 2>/dev/null |