photocraft/crates/codecs/tests
David Moulton a35af4e279
Add FITS read/write (astronomy images) (#2956)
* Add FITS read/write codec

FITS (the astronomy format) opens and saves as a flat image: the primary
HDU or first IMAGE extension; gray, or RGB when NAXIS3 = 3; BITPIX 8/16/
32/64/-32/-64 with BSCALE/BZERO/BLANK; rows follow ROWORDER (bottom-up by
default). Camera U16 data stays exact; float data is normalised to 0..1.
Header cards round-trip as text metadata (HIERARCH for long names).
Tile-compressed (fpack) files are refused as unsupported.

Wired into File > Open, Save As and the batch commands as .fits/.fit/.fts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Test FITS open and save through photocraft-io

Gray 16-bit, RGB 8-bit and RGB 32-bit float documents round-trip exactly,
and header cards travel as the document's text metadata.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* FITS: hostile-header regression test (absurd axes, bad BITPIX, no END, HDU chains, overflowing sizes)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-11 13:15:22 -04:00
..
common TIFF: BigTIFF, every IFD and SubIFD, banded parallel decode (FILE-215-8, part of #215) (#859) 2026-10-07 22:37:51 -04:00
camera_raw.rs Format: adopt the craft-family rustfmt.toml and format the workspace 2026-10-04 11:31:17 -04:00
decode_warnings.rs Import warns when it keeps only the first frame or page, or a JPEG ends early (#518, #523) (#563) 2026-10-07 16:20:02 +07:00
deep_exr.rs Corpus: pin the deep OpenEXR test images and check them in CI (#881) 2026-10-08 16:08:56 -04:00
detect_caps.rs Add FITS read/write (astronomy images) (#2956) 2026-10-11 13:15:22 -04:00
exr_cryptomatte.rs EXR: Cryptomatte layers list, decode and hash to the specification (#2180) 2026-10-10 06:40:49 -04:00
exr_multipart.rs EXR: multi-part files open the colour part; exr_info lists them all (#2116) 2026-10-09 18:51:33 -04:00
fidelity.rs Layered TIFF: open and save Photoshop layer data in TIFF files, in either byte order (part of #215) (#672) 2026-10-07 17:10:35 -04:00
heif.rs Open HEIC/HEIF photos (#355) (#372) 2026-10-07 10:20:40 -04:00
limits.rs Keep PNG text metadata through document saves (#1684) 2026-10-09 09:53:37 -04:00
malformed.rs Add FITS read/write (astronomy images) (#2956) 2026-10-11 13:15:22 -04:00
metadata.rs Add FITS read/write (astronomy images) (#2956) 2026-10-11 13:15:22 -04:00
orientation.rs Harden EXIF orientation: limits after rotation, fallible allocation, strict IFD parsing (#345) (#345) 2026-10-06 18:21:33 -04:00
png_jpeg.rs Photoshop oracles via storytold/photocraft-corpus: pinned corpora, corpus feature, test-corpus, CI job (#190) (#190) 2026-10-05 17:47:33 -04:00
resolution.rs fix(codecs): exports drop the source's EXIF thumbnail (#2147, #2373) (#2450) 2026-10-10 13:11:59 -04:00
roundtrip.rs Add FITS read/write (astronomy images) (#2956) 2026-10-11 13:15:22 -04:00
tiff_bench.rs TIFF: BigTIFF, every IFD and SubIFD, banded parallel decode (FILE-215-8, part of #215) (#859) 2026-10-07 22:37:51 -04:00
tiff_pages.rs TIFF: alpha after an unspecified extra sample opens transparent (#1349) (#1513) 2026-10-09 11:12:00 +07:00
tiff_photoshop.rs Layered TIFF: open and save Photoshop layer data in TIFF files, in either byte order (part of #215) (#672) 2026-10-07 17:10:35 -04:00
tiff_regressions.rs fix(codecs): correct TIFF polarity and BigTIFF orientation (#746) 2026-10-07 13:50:04 -07:00
webp_lossy.rs Lossy WebP: a pure-Rust VP8 encoder with quality and lossless controls (#648) (#880) 2026-10-07 21:12:38 -04:00