mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-30 02:05:15 +01:00
914fc9f006310ec47c19a88019b1fce093bb1fcc
43
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a10135dd9c |
Merge main (4edf1ee286) into upstream-pr/checked-decoder-dims
Conflicts: crates/codecs/src/jpeg.rs crates/codecs/src/lib.rs Ported in this merge: main now decodes JPEG through craft-image-codecs (craft-libs), so the zune path this PR hardened is gone and jpeg.rs is main's; main's own size and sample checks cover it there. Kept from this PR: the final check_has_pixels guard in decode_unguarded (now alongside main's AVIF arm), its unit tests, the 32-bit wrap regression and the CRC-repaired zero-size header test. Codec tests (parallel,jxl,heif) and clippy pass locally. |
||
|
|
cf3d0205ef |
Decode AVIF through shared image codecs (#4312)
* Decode AVIF through shared image codecs * Include JPEG encoder distribution notices * Exercise AVIF HDR decoding through public API * Preserve AVIF source bit depth * Test AVIF alpha through public entrypoints * Update AVIF round trip for supported decode * Document native AVIF decode support * Clarify import feature gates * Keep RAW fixtures valid under shared container and strip bounds * Include sample-to-chunk mappings in CR3 fixtures * Find Similar test: a photo read from memory isn't a missing read (#3823) The second search after a stop plans its reads after frames in which the loupe and filmstrip decoded photos; those are measured from memory (source_ref takes the cached source), so the drive sees fewer than 12 reads on a loaded machine. Check instead that no file is read twice, the searched photo above all; the answer still needs every photo's signature. * Find Similar test: every photo is measured after the resumed search * Bound AVIF padded picture storage and preserve integer source flag * Size the AVIF picture-store budget for the stored canvas, not the clap-cropped size * Attribute the AVIF lossless decode fixture * Keep the AVIF clap test helpers free of unwrap for the codecs lint gate * lightcraft: keep the newer craft-cms pin after merging main --------- Co-authored-by: Bruno-Alumn <171815746+Bruno-Alumn@users.noreply.github.com> Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com> |
||
|
|
c11eb960eb | codecs: use shared JPEG encoder | ||
|
|
61005f3dc1 |
Culling: the loupe uses built previews; photos prepared ahead and in the background (#3077)
* PERF-CULL-0: ui.inspect reports how the loupe showed each photo it was stepped to
perf.loupeSteps records, per step, the ms from the step to the first frame
with anything of the photo, with a full-size picture (camera JPEG, cached
or rendered) and with LightCraft's own render, measured on the frames the
app draws, so culling benchmarks exclude the control channel's round trip.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 95f0343848fc0a238f80f07ceb292eaf6779aeaa)
* PERF-CULL-1: browsing a folder shows its first photos within a second
The Local view read and hashed every file of the folder before showing any
of them (2,933 EOS R5 C CR3s: 30.6 s to the first photo). It now hands the
files the library lacks straight to the import, ordered the way the view
sorts them (file time for the date sorts), which adds them batch by batch:
first photo 0.9 s, twelve thumbnails 1.4 s, the whole folder in the same
~34 s as before, in the background.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit b766558e7ef4f802919a144da53e444f70e0186b)
* PERF-CULL-2: the loupe makes the next photos' camera previews ahead of the step
Culling steps through photos, and each step waited for the next raw's
embedded JPEG to be read and decoded (p50 187 ms, p95 332 ms on EOS R5 C
CR3s) and then for a full raw develop. Now:
- the loupe's stand-ins for the next five photos in the direction of
travel and the one behind are made ahead (Slot::QuickAhead, priority
just below the loupe's own render) and taken over at the step, so a
step shows the camera JPEG at once (p50 0 ms);
- a slot keeps its photo while the photo stays wanted, so photos that
shift places as the user steps are not made twice;
- decoded camera JPEGs stay in the memory LRU (never on disk), so going
back shows them again without a decode;
- while an arrow key is held (a photo left within 0.25 s), the raw
develop waits until the photo has stayed 0.12 s, and a render queued
for a photo already left is dropped, so the workers make the previews
instead of renders nobody sees.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 0430b95636d2b6adce8887af7b9464687c95549e)
* PERF-CULL-3: CR3 previews take the smallest embedded JPEG that covers the view; plain sRGB JPEGs decode straight to 8-bit
Upstream's embedded_preview_covering (
|
||
|
|
a9afb1868c |
test(codecs): test the no-pixels guard and checked JPEG sample count directly
Moves the final-output check into check_has_pixels and tests it with zero width, zero height, an overflowing w*h and a short RGB buffer (fails when the guard is removed). Adds the 65535x21846x3 case a 32-bit usize product wraps. The PNG zero-dimension fixture now repairs its IHDR CRC and covers height too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
824395025b |
security(codecs): refuse decodes with no pixels; checked JPEG sample counts
- `decode_unguarded` returns `Malformed` for an image of zero width or height or a buffer shorter than its size, so nothing downstream receives an empty image. - The JPEG short-output checks compute w × h × channels with `checked_sample_buf_len` instead of a `usize` product that wraps on wasm32. Refs #2579 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c2cdb112b7 |
LR-IMP-FORMATS: GIF and BMP sizes from the header; a canvas the file can't fill is refused (#2553)
read_header had no reader for GIF or BMP and fell back to a full decode, so a few-dozen-byte file declaring a canvas just under the 1-gigapixel limit made the import probe allocate ~4.3 GB; a failed allocation aborts the process. A decode had the same allocation. - other::header reads the size from the header. A canvas up to 4 MP is still decoded there, so truncated small files are refused at import as before. - check_fillable refuses a canvas larger than the file's bytes can describe (BMP: 128 pixels per byte, covering 1-bit and RLE; GIF: 11,000, an LZW code of at least 3 bits expanding to at most 4096 pixels), in both the probe and the decode, before the decoder allocates. - The GIF and BMP decoders get an allocation limit (the RGBA buffer of max_pixels). The approach follows the abandoned #2182 (PierrunoYT). JPEG XL still decodes in the probe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K93HTyCiwYvbRGaAkjPvXn |
||
|
|
8ec24dc868 | Integration: #2180 keep the pixel limit as the only size cap | ||
|
|
36d22a2745 |
raw, codecs: checked dimension products so wasm32 cannot wrap the size gates (#2138)
On wasm32 usize is 32-bit, so 65536 x 65536 wraps to 0 and products like w * h, w * h * cpp, fw * fh * nc and row_bytes * ch wrapped past their own validation and let later true-dimension indexing panic (profile.web sets panic = abort). All the enumerated sites now validate through a checked u64 gate: - lightcraft-raw gains checked_pixel_count(width, height) (u64, capped at MAX_SAMPLES), used by the ARW decode head (the strip-length equality now compares the true sample count, not a wrapped one) and by RawImage::check's data-length validation; - the CR2 lossless-JPEG frame size is checked in u64 on both the Full and Header paths (it used to be clamped AFTER wrapping), and the no-slices width fallback is checked; - the TIFF DEFLATE chunk's inflate length is checked and capped before the cast; - lightcraft-codecs gains checked_sample_buf_len for the finish() buffer bound, compared in u64 via try_from so no cast truncates on 32-bit. Tests pin the gate arithmetic with values that would wrap 32-bit usize (65536 x 65536, u32::MAX x 2, 2^30 x 4). cargo check --target wasm32-unknown-unknown passes for both crates. The issue's suggested wasm32 arithmetic-side-effects clippy pass is a follow-up. |
||
|
|
b29a1a8cc2 |
Merge PR #1215
# Conflicts: # crates/engine/src/lib.rs # crates/engine/src/pdf.rs # crates/ui-egui/src/lib.rs # crates/ui-egui/src/menus.rs # crates/ui-egui/src/panels/dialogs.rs # crates/ui-egui/src/state.rs # docs/gaps.md # docs/parity-checklist.md |
||
|
|
bc9d8a21b5 | Merge slideshow-templates into slideshow-export (origin/main: batches 32–33) | ||
|
|
6e5cd82ce7 |
Merge remote-tracking branch 'upstream/main' into feat/print-color
# Conflicts: # docs/gaps.md # docs/parity-checklist.md |
||
|
|
f36020c3cf | Merge origin/main into slideshow-export (batch 32: state.rs keeps the SlideshowExport dialog and New Album's include_selected) | ||
|
|
32253d862a |
Merge PR #1017
# Conflicts: # crates/pipeline/src/spots.rs # docs/gaps.md # docs/parity-checklist.md |
||
|
|
7b6b25e6ab | Composite straight alpha onto white before develop. | ||
|
|
a4716d9e4f |
LR-IMP-FORMATS: transparent areas develop on white instead of black (#1212)
The decoders keep the alpha plane, but to_working converted only the colour, so transparent pixels kept the black most encoders store under them: renders, previews, exports and contact sheets showed it. The working image is now flattened onto white, in linear light like the rest of the pipeline. |
||
|
|
068caf361c |
LRC-PRINT-JOB: print colour transform (printer / paper profiles, intent, black point compensation, print adjustment)
codecs::print converts a composed print page (16-bit RGB in the Rec2020 output encoding) to the samples a print-ready file carries: - PrintTarget::Profile(icc): a printer / paper profile, RGB, CMYK or grey, matrix or LUT based, converted with moxcms; PrintTarget::Managed(space): the printer manages colour and the page goes in sRGB or Adobe RGB with that profile embedded. - Perceptual or relative colorimetric (ProofIntent, as soft proofing). - Black point compensation for relative colorimetric: the device's darkest is measured by a round trip of black through the profile and linear values are scaled to land the page's black there (Y' = Y(1 - Yb) + Yb, the published mapping for a neutral destination black), so shadows below the ink's black no longer clip to one value. Perceptual tables keep their own black mapping. - Print adjustment brightness / contrast (-100..100) on the sRGB-encoded values, black and white held, monotonic at every setting. Everything before the profile is per channel and folds into one 16-bit table; pages convert in bounded batches (parallel with the `parallel` feature). Hostile profiles, half pixels and NaN settings are errors or neutral, never panics. Not wired to the print job yet. |
||
|
|
0a6f8d3db8 |
LR-HDR-EXPORT: HLG HDR AVIF export (hdrTransfer) and a tested SDR/HDR display decision
AVIF HDR export takes hdrTransfer = pq | hlg (export dialog: HDR curve; MCP export schema lists it). HLG writes CICP transfer 18 and no clli box. The window logs whether it shows HDR; today always SDR (eframe configures an 8-bit surface), with the platform / surface format / headroom / opt-out rules unit-tested. Also satisfies clippy 1.99's chunks_exact_to_as_chunks in spots.rs. Part of #868. Sources: ITU-R BT.2100 (HLG OETF, inverse OOTF with system gamma 1.2), ITU-R BT.2408 (203 cd/m2 reference white at 75 % HLG); own design for the display decision. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
6ec7044ebf | Merge slideshow-templates into slideshow-export (origin/main: batch 31; whats-new keeps main's Reliability entry, parity summary refreshed) | ||
|
|
ccfff38548 | Merge slideshow-templates into slideshow-export (origin/main: sidebar and slideshow_export modules side by side; whats-new and tracker summary) | ||
|
|
4a0d04b994 |
Merge PR #780
JPEG XL export via the pure-Rust jixel crate (robmdunn; fixes #247). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BKWB9TCnvzJHV6xMLAj2J4 |
||
|
|
e1016acc0f |
Merge PR #953
# Conflicts: # crates/codecs/src/lib.rs # docs/parity-checklist.md # docs/whats-new.md |
||
|
|
05939cbc54 |
Merge PR #928
# Conflicts: # crates/ui-egui/locales/de.json # crates/ui-egui/locales/es.json # crates/ui-egui/locales/fr.json # crates/ui-egui/locales/ja.json # crates/ui-egui/locales/pt-br.json # crates/ui-egui/locales/ru.json # crates/ui-egui/locales/uk.json # crates/ui-egui/locales/zh-hans.json # crates/ui-egui/locales/zh-hant.json |
||
|
|
44b12efea3 |
LR-EXP-PSD: Edit in PhotoCraft (right-click Edit In, flat PSD hand-off)
Photo > Edit In > Edit in PhotoCraft (Cmd+Shift+E, also on the photo context menu) renders a copy with the edits as a flat 16-bit PSD, which PhotoCraft saves back to in place, stacks it on the original and opens it in PhotoCraft, found where its installers put it. Edit in Other Editor (Cmd+Alt+E) keeps the configured program. Per-editor format, colour space and bit depth in Settings > External Editing. Export gains a flat PSD format. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T4kqvR9KVCPia3SSXyB8WG |
||
|
|
b391307009 |
LRC-SS-EXPORT: slideshow export to PDF, JPEG sequence and AV1 video
View > Export Slideshow... (and Export PDF / JPEG / Video in Settings > Slideshow) writes the photos in view as their composed slides, between the intro and ending screens that are on: - PDF: a page per slide (1024/1920/3840 px long side, JPEG quality), /Dur and /Trans fades per page, optional /PageMode /FullScreen. The contact sheet's writer moves to engine/src/pdf.rs and streams to disk. - JPEG: <name>-001.jpg... in a folder. - Video: AV1 (rav1e, speed 10, low latency) in MP4 or WebM written by our own muxers (codecs/src/video.rs); fades rendered as blended frames, held slides one key-frame sample with a long duration; 720p/1080p, 24/30 fps; no audio; capped at 2 hours. slideshow.export runs in the background with a row in the activity stack (activity.cancel stops it); outputs are written as .part and renamed when complete, so cancel or failure leaves nothing behind. A photo that can't be rendered is skipped with a warning. slideshow.exportStatus reports the result. |
||
|
|
bac0f75551 |
Soft proofing against printer ICC profiles: intent, Simulate Paper & Ink, device gamut warning
Soft Proofing's Profile menu takes a printer / paper ICC profile (Other…;
`view.softProof {profile, intent, paperInk}`), RGB or CMYK, matrix or LUT.
The CMS (moxcms) builds a 33^3 proof table over the working space: forward with
the chosen intent (Perceptual / Relative), back relative colorimetric; the
destination gamut warning comes from the colorimetric round trip. Simulate
Paper & Ink renders absolute colorimetric: the profile's media white replaces
screen white and the ink black is unscaled. The pipeline gets the table by id
(`Proof::profile`, `register_proof_profile`), so Proof stays Copy and render
keys include it. Proof copies are named after the profile.
Sources: ICC.1:2022 (rendering intents, media white point, absolute
colorimetric); own design for the proof table.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
||
|
|
cbc0e2d7db |
LR-HDR-EXPORT: HDR PNG export as 16-bit Rec. 2020 PQ (cICP, cLLI)
With HDR output on, a photo edited in HDR exports as a 16-bit PNG with the PQ curve in Rec. 2020 (SDR white at HDR_REFERENCE_WHITE_NITS), described by a `cICP` chunk (PNG third edition: BT.2020 primaries, PQ, RGB, full range) and a `cLLI` content light level chunk (the levels the HDR AVIF records). EXIF, XMP and print resolution are kept; no ICC profile next to cICP. Photos without an HDR edit, and HDR edits with HDR output off, export as before. `codecs::encode_png_pq` sits next to `encode_avif_pq` and takes the same input. Follow-up to #646, ported from #466. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
afbc0f9744 |
LR-EXP-TYPE: JPEG XL export (#247)
Export as JPEG XL from the dialog, CLI, MCP and control channel (format jxl): lossy with quality or lossless, 8/16-bit, effort fast/normal, progressive, EXIF/XMP boxes; HDR edits as 16-bit Rec. 2020 PQ. Encoder: jixel (pure Rust, BSD-3-Clause OR Apache-2.0, native only: it spawns its own threads), wrapped in catch_unwind. Lossy files declare an enum encoding (sRGB / P3 / Rec. 2020; Adobe RGB and ProPhoto written as Rec. 2020); lossless files embed the ICC profile. Decoder fix: jxl-oxide desaturated colours outside sRGB when rendering XYB images to wider primaries; lossy wide-gamut JXL now renders to linear sRGB primaries and is converted to Rec. 2020 here. jixel's slowest effort is left out: jxl-oxide misdecodes its (valid) files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e46e7ab265 |
Merge PR #646 (HDR peak threaded through #533's base_tone; V1 at peak 1 unchanged)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
78550e5de9 |
Merge PR #609
# Conflicts: # crates/engine/src/tests_import.rs # docs/parity.md |
||
|
|
7828f93c32 |
LR-HDR-EXPORT: HDR AVIF (10-bit Rec. 2020 PQ)
`encode_avif_pq`: linear Rec. 2020 with SDR white at 1.0 → PQ (SDR white at 203 cd/m², BT.2408), BT.2020 NCL YCbCr 4:4:4, 10-bit, with CICP nclx (9/16/9, full range) and a clli box. ravif fixes the sRGB curve, so this drives the rav1e + avif-serialize it already uses (no new crates). Export: AVIF with `hdr` renders the HDR edit in Rec. 2020 and writes PQ. Photos without an HDR edit export as before, in every format. CoreImage decodes the file as HDR (same 3.1 % of the frame above SDR white as the gain map JPEG of the same edit). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e11db8fea0 |
LR-HDR-EXPORT: ISO 21496-1 gain map JPEG codec
`lightcraft_codecs::gainmap`: - `compute` measures a gain map (luminance or RGB, log2, block-averaged) from an SDR and an HDR rendition; `apply` rebuilds the HDR rendition. - ISO 21496-1 metadata: writer (fixed denominator) and reader (also the common-denominator form; refuses unknown versions, backward maps and zero denominators). Adobe `hdrgm` XMP reader and writer, per-channel values as rdf:Seq; Apple's HDRGainMap/HDRToneMap description of the same map. - `encode_jpeg`: base with CIPA DC-007 MPF index (gain map typed 0x050000), the ISO marker and Container XMP merged into the user's packet, followed by the gain map JPEG. `read_jpeg` / `is_gain_map_jpeg` find and decode the map. Also: gain map images are no longer picked as embedded thumbnails (an Ultra HDR JPEG could show its greyscale gain map in the grid). The JPEG APP-segment building is shared with `encode_jpeg`. Fuzzed with the other decoders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
90361935ba |
LR-IMP-FORMATS: HEIC decodes like libheif; release builds include it
heic-rs reconstructs iPhone HEVC tiles bit-exactly (checked against libde265), but its colour stage was 2-27 code values off libheif on every iPhone photo: it ignores the HEVC VUI and assumes BT.709 limited range. lightcraft-heif now converts YCbCr itself (nclx, else VUI, else H.265 defaults; nearest chroma, bilinear for odd clap offsets, as libheif), inherits tile ICC/nclx on grids, follows libheif's imir axis and clap rounding, and outputs 16-bit RGB. Measured on 30 real and synthetic files: within 1 code value of libheif (pillow-heif 1.8 / libheif 1.23). Also: HEIF header reader for import (no pixel decode), embedded thumbnail for small decodes, nclx/VUI colour hint (shared CICP mapping with PNG), clear 4:2:2/4:4:4 Unsupported error, Format::not_decodable as the one source of "why not" (import reports "HEIC/HEIF support isn't included in this build"), `.heif` imports. Release packaging and Nix build with the heif feature, as whats-new promised. lightcraft_heif::testdata writes lossless (PCM) synthetic HEICs for the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
3bcc265bf6 |
LR-PREF-DISPLAY: monitor ICC profiles (display colour management)
Previews were always sRGB, which wide-gamut monitors show oversaturated. Settings > Display > Choose Profile... (and the UI command app.displayProfile) now shows photos through the monitor's ICC profile, matrix/TRC or LUT-based. - codecs: DisplayProfile (moxcms): the display's primaries (colorant tags, or measured through the A2B tables of a LUT-only profile), the proxy -> device correction (per-channel curve tables for matrix/TRC profiles, a CMS transform for LUT profiles) and sRGB <-> display transforms. - pipeline: DisplaySpace / RenderRequest::display: the per-pixel stage renders into the display's primaries and gamut maps into its gamut (CPU and GPU: only to_out / out_luma change). Soft proofing's display gamut warning uses the display's gamut. - engine: RenderJob::with_display; display::present converts sRGB results (thumbnails, cached previews, embedded JPEGs). Histograms and the preview caches stay sRGB; exports are unchanged. - ui: the loupe, Before, Compare, hover and second window render for the display; everything else is converted on the render workers. Settings > Display tab, ui.json setting, file picker opening in the system's ICC folder. Tests: profile parsing and transforms (sRGB, P3, gamma 2.2, a synthetic LUT-only profile, corrupted files), display renders equal 8-bit renders into the matching output space, sampled histograms, and a headless UI test of the whole flow. docs/display-profiles.md describes the design. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WEuxxPyG8t6KcADbZSEAUj |
||
|
|
4977c648f6 |
Merge main into formats/heif-heif-decode; CI gates the heif feature
Resolve the docs/parity.md conflict, keep the HEIC rows. `cargo xtask ci` gets a heif step (clippy + tests for lightcraft-codecs with --features heif), since the workspace build leaves the feature off. The Cargo.toml comments no longer say official builds enable it; the web one notes that wasm32 aborts on panic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
f6f5e6f1b7 |
Part of #367: probes read image headers instead of decoding the pixels
The import probe of a non-raw image decoded it (at a 64 px fit, which for
JPEG still entropy-decodes every block and for PNG inflates everything)
only to learn its stored size and orientation: ~95 % of import CPU.
lightcraft-codecs gets `read_header(bytes) -> Header { format, width,
height, orientation }`: JPEG from its markers (EXIF orientation), PNG from
its chunks (IHDR, eXIf anywhere), TIFF from the first IFD (tiff crate,
no strips read), WebP from its RIFF chunks / bitstream header (image-webp),
PSD from its header and image resources. GIF, BMP and JPEG XL keep the
small decode. `files::probe_bytes` uses it; raw handling is unchanged.
The TIFF colour-layout check is shared with the decoder (`layout`).
Measured (release, 4 cores, throwaway benchmark, per file, bytes in
memory): 200 generated 4000x3000 JPEGs (3.6 MB): 72.7 ms -> 2.1 ms
(read_header alone 1.05 ms; the rest is the content hash and metadata);
20 PNGs (30.8 MB): 236-265 ms -> 9.0-9.6 ms.
Corrupt files (behaviour note): the header readers also refuse what a
decode refuses before the pixels (unsupported layout, compression, frame
type, bad IHDR, ...) and truncated files: a JPEG whose markers don't reach
its EOI, a PNG cut before the chunk after its IDAT run, TIFF strips/tiles
that start past the end, a WebP image chunk or PSD merged data past the
end. So truncated files (interrupted copies, partial downloads) are still
marked `error` in the import review, as before; tests check that whenever
the old decode accepted a (cut or byte-mutated) file the header agrees.
Changed: damage *inside* compressed data that is all present (flipped or
garbled bytes) was refused at scan and is now imported, and shows as
unreadable ("!" in the grid) when rendered. Also: tiny JPEGs (< 128 px)
were decoded leniently by the old probe, so a truncated one imported; it
is now refused. A TIFF truncated inside its last strip is not detected
(StripByteCounts are often overstated, so only strip starts are checked).
Tests: header readers vs decode on generated JPEG/PNG/TIFF/WebP/PSD/BMP
with and without EXIF/TIFF orientation; truncations and random mutations
agree with decode; hostile headers (zero/absurd sizes, bad lengths,
truncation, garbage) are errors; read_header added to the fuzz tests;
probe_bytes oriented dims match the decode-based values.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01912WaK6Rmew3wxZuPyX7E8
|
||
|
|
853ada7754 |
LR-IMP-FORMATS: HEIC/HEIF decode behind the optional heif feature
New crate `lightcraft-heif` (a port of PhotoCraft's photocraft-heif): a thin, panic-guarded wrapper around heic-rs (pure Rust, pinned =0.1.1) - 8/10-bit, alpha, grid tiles, container irot/imir/clap, ICC/EXIF/XMP. `lightcraft-codecs` decodes HEIF behind its non-default `heif` feature (HEVC patents are the distributor's call, the same policy as PhotoCraft); the apps forward it. HEIC files stay recognised without the feature: opening one is a clear "isn't included in this build" error. Fuzz-found heic-rs panics arrive as regression fixtures (inline bytes, no media committed). Verified end-to-end on real iPhone HEICs (lightcraft-cli render, rotation and metadata correct). Note for reviewers: measured here, the engine currently ignores the decoded image's source-space matrix on export for ANY format (a true Display-P3 PNG round-trips unchanged); the ICC and space are carried for all codecs, so this inherits - and does not worsen - existing behaviour. Co-Authored-By: opencode <noreply@opencode.ai> |
||
|
|
024e983a7e | M3: honour Nikon CropArea and embedded preview colour space | ||
|
|
ee9a989834 |
Codecs: bound thumbnail fallback decodes and WebP metadata allocations
Non-JPEG thumbnail fallbacks decode at source resolution before resizing, so the output size does not bound memory. ThumbnailOptions gains max_pixels (default 64 MP, previously about 1 GP via DecodeOptions::fit); larger sources return Error::TooLarge. Nothing in the workspace calls decode_thumbnail yet. WebP RIFF chunk lengths are untrusted: set_memory_limit(bytes.len()) stops a tiny truncated file requesting gigabytes for metadata. In image-webp 0.2.4 the limit applies only to ICC, EXIF and XMP chunks. Fuzz tests cover both; the roundtrip test only switches to struct update syntax. Split from a327b98 (T0 thumbnail work), where it was bundled. Co-authored-by: Codex <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
eb378c491a |
Never crash: codecs and catalog free of panicking calls
- catalog store: the journal appender is a let-else with an io::Error,
not expect("appender just opened").
- catalog dates: group_label slices with get(), so a non-ASCII key of a
date's length no longer panics mid-character (regression test).
- codecs jpeg_par: rows come from map_while instead of next().unwrap().
- lightcraft-codecs and lightcraft-catalog now #![deny] unwrap/expect/
panic/unimplemented/todo/unreachable (one test let-else uses panic!
instead of unreachable!); clippy.toml as in the steering PR.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
dae90e9a7b |
M10.4: parallel baseline JPEG encoder (restart-interval bands, AAN DCT)
Own T.81 encoder: Annex K tables, JFIF YCbCr 4:4:4/4:2:0 + gray, EXIF/XMP/ICC segments, bands of MCU rows separated by RSTn so entropy coding runs on all cores. Per-core speed matches jpeg-encoder at 4:4:4 (225 vs 237 ms on 24 MP, single thread); with all cores 24 MP encodes in ~130 ms vs ~500–800 ms (loaded machine). Output decodes with jpeg-decoder and zune-jpeg (odd sizes tested); same-or-smaller files at equal/higher PSNR. 4:2:2 keeps jpeg-encoder. Bench: crates/codecs/examples/jpeg_bench.rs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
fa59a060dc |
M1.1: codecs fuzz/corpus/bench tests, thumbnail options, README
Property tests (random bytes behind every magic, mutated/truncated files), corpus tests (corpus/images, pngsuite, raw routing, system ICC profiles), ignored 24 MP JPEG benchmark, decode_thumbnail_with(min_embedded_edge), fast deflate levels for PNG/TIFF, README with formats, licences, gaps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
304180a500 |
M1.1: lightcraft-codecs decode/encode, ICC, sniffing
Decoders (JPEG via zune-jpeg + jpeg-decoder for DCT scaling/CMYK, PNG, TIFF, WebP, GIF, BMP, PSD composite, JPEG XL via jxl-oxide) produce linear Rgb32f in source primaries with SourceSpace; ICC matrix/TRC applied exactly, LUT/CMYK profiles through moxcms; to_working() to linear Rec.2020 D65. Encoders: JPEG, PNG 8/16, TIFF 8/16/32f, lossless WebP, AVIF (native). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |