Commit Graph
152 Commits
Author SHA1 Message Date
Dylan M. Taylor 50b2b32c08 Merge branch 'main' into codex/exif-ifd0-consumer 2026-11-18 10:08:13 -05:00
Dylan M. Taylor b471f6008d Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	packaging/linux/flatpak/cargo-sources.json
2026-11-16 23:06:45 -05:00
Dylan M. Taylor 7e5e28591a Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	Cargo.lock
#	Cargo.toml
2026-11-16 23:03:08 -05:00
Dylan M. Taylor 9de93337c5 Use shared HEIF metadata and preserve location checks (#4315) 2026-11-16 21:58:40 -05:00
Dylan M. Taylor e81d19f821 Integrate refreshed RAW parent while preserving shared EXIF routing 2026-11-15 17:45:16 -05:00
Dylan M. Taylor 8be9a6f835 Delegate PSD metadata resource selection 2026-11-15 18:08:57 +00:00
Dylan M. Taylor 646895e2af Delegate first IFD orientation to shared metadata 2026-11-15 17:46:43 +00:00
Dylan M. TaylorandAndrew Frahn 8ce9ab9ea1 meta: reuse shared MRW block container parser
Original MRW reader and retained tests by Andrew Frahn, d6c29aaf; shared parser already exists at the workspace craft-raw pin. Keep the public facade and recovery contract.

Co-authored-by: Andrew Frahn <andrew@emmertex.com>
2026-11-15 10:19:37 -05:00
Dylan M. Taylor 6b2b7e6d11 fix(meta): import DateTime and Gps in exif write_tests (#4263)
* fix(meta): import DateTime and Gps in exif write_tests

* fix(meta): scope DateTime and Gps imports to write_tests
2026-11-14 15:21:35 -05:00
Dylan M. Taylor 25ffe3e5d4 codecs,raw,preview,meta,engine: cut over TIFF/JPEG/focus to craft-libs and fix CI (#4244)
* codecs,raw,preview,meta,engine: cut over TIFF/JPEG/focus to craft-libs and fix CI

* docs: update parity-checklist paths after craft-raw/craft-metadata cutover

* Remove unused codec workspace deps and cut examples over to craft-image-codecs

* chore: update Cargo.lock after removing unused codec deps
2026-11-14 13:49:38 -05:00
FredApps e2d1befd0b Merge branch 'main' into fix/1619-shutter-precision
# Conflicts:
#	docs/parity-checklist.md
2026-11-14 12:43:49 +01:00
Bruno-Alumn be2cb6e727 meta: cargo fmt the MergeRules call so CI's fmt step passes 2026-11-14 04:34:50 +01:00
Dylan M. Taylor 9cd6817c3b codecs, meta: read PSD header and image resources with craft-psd (#4167) 2026-11-14 00:09:58 +00:00
Dylan M. Taylor 264330d7e9 meta: migrate DateTime, gpx, and xmp_merge to craft-metadata 2026-11-14 00:03:58 +00:00
FredApps 1f8e1ef1ad Merge branch 'main' into fix/1619-shutter-precision
# Conflicts:
#	crates/catalog/src/model.rs
#	crates/engine/src/files/tests.rs
#	docs/parity-checklist.md
2026-11-13 20:49:01 +01:00
Dylan M. Taylor 0d88706ec5 security(meta): bound namespace declarations in scope while parsing XMP
* security(meta): bound namespace declarations in scope while parsing XMP

* address review: a readable sidecar that fails the merge read-back is kept and the save fails

* address review: a sidecar over the XMP complexity limit is kept and the save fails

* merge main into fix/sec-xmp-namespace-bound

* address review: text with no rdf:RDF element is backed up and replaced, not kept as readable

* xmp merge: open a self-closing rdf:RDF element instead of replacing the sidecar
2026-11-12 06:28:53 -05:00
Dylan M. Taylor e4dd081dd4 Use craft-gainmap from craft-libs for gain map metadata and arithmetic
Use craft-gainmap from craft-libs for gain map metadata and arithmetic

* Use craft-heif from craft-libs; remove crates/heif

lightcraft-heif moved to craft-libs unchanged as craft-heif
(storytold/craft-libs#784), so PhotoCraft can share it. The layer table,
the heif CI step and the change triggers drop the local crate; a workspace
file change (which a craft-heif rev bump is) still runs the heif step.

* Pin craft-heif to the merge of storytold/craft-libs#794

* docs: the HEIF rows point at craft-heif, not the removed crates/heif

* Use craft-gainmap from craft-libs for gain map metadata and arithmetic

crates/codecs/src/gainmap.rs keeps the JPEG layout (encode_jpeg, read_jpeg,
is_gain_map_jpeg) and re-exports GainMapMeta, GainImage, GainMapOptions,
ISO_URN, compute and apply from craft-gainmap, which is this file's metadata
and arithmetic moved to craft-libs (storytold/craft-libs#904). The tests of
the moved code went with it.

* craft-heif's Options has a chroma field at this rev: keep the libheif upsampling LightCraft had

* raw: count the chunks a TIFF declares from its offsets table

craft-tiff builds at most one chunk descriptor per byte of file
(craft-libs#827), so a grid of tiles sharing one payload lists fewer
chunks than the image declares. Compare the offsets table, which is the
source of truth, so such a file reaches the byte-accounting check and is
refused for the data it actually holds.
2026-11-12 00:43:54 -05:00
Dylan M. Taylor c5d60d2fa7 Use craft-tiff from craft-libs for TIFF/IFD (#4088)
* Use craft-tiff from craft-libs; remove crates/tiff

lightcraft-tiff moved to craft-libs unchanged as craft-tiff
(storytold/craft-libs#783), the first step of sharing RAW support with
PhotoCraft (storytold/craft-libs#587). The layer table drops tiff and its
intra-layer ordering before raster.

* Pin craft-tiff to the merge of storytold/craft-libs#795
2026-11-11 19:51:47 -05:00
Dylan M. Taylor f786b87533 security(meta): linear entity decoding, indexed keyword de-duplication, bounded XMP path building (#3672)
* security(meta): linear entity decoding, indexed keyword de-duplication, bounded XMP path building

* address review: decode zero-padded numeric references in the three entity decoders
2026-11-11 04:26:21 -05:00
0429844cd9 never-crash: deny the panic lints in every crate root; GPU asserts become fail paths (#2137) (#2170)
* never-crash: deny the panic lints in every crate root; GPU asserts become fail paths (#2137)

The never-crash policy was documented but not machine-checked for the two largest crates:
engine and meta carried only #![forbid(unsafe_code)], so a future unwrap/expect/panic would
pass cargo xtask ci. Both crate roots now also carry
as does xtask (previously un-annotated); the guarded expects in meta/src/xmp.rs and xtask's
parity.rs / root() now use the documented #[allow(clippy::expect_used)] + invariant form.

crates/gpu: the three production asserts become fail(FailKind::Fatal, ..) + return, so a
binding-count mismatch, an over-long readback, or a wrong-length curve fails the render over
to the CPU instead of crashing (finish_and_read also early-returns on len == 0, which would
have issued a zero-size copy_buffer_to_buffer that wgpu rejects).

xtask: new roots check (in ci) verifies every workspace lib root and every binary main.rs
carries both attributes; crates/sysmem is the documented exception for forbid(unsafe_code)
only. A panic in placement or readback is a fail, not a crash.

* audit fixes: roots covers binary and cdylib/rlib roots; render gates on failed() after finish_block (#2137)

Two reviewers audited the first commit; both highs it found are fixed here:

- roots scanner: the by_ref().any()/any() pair consumed the kind iterator hunting for
  "lib", so every bin-only root (both app mains, the sam3-worker bin, xtask itself) and the
  cdylib/rlib web root was silently unchecked — the check covered 29 of the 33 real roots.
  Kind detection now collects the kinds once and matches lib/rlib/dylib/cdylib/staticlib,
  with a root_paths regression test over bin, lib and cdylib/rlib targets; unreadable root
  files now fail with the I/O error instead of a fake policy violation.
- render.rs: the caller gates on failed() right after finish_block, so the malformed-curve
  fail path can no longer reach the band loop's p[y0_at] index on the empty block.
- finish_and_read: the len == 0 path now submits the encoder before returning zeros, so a
  failure staged in the same render stays detectable (the old zero-size copy failed loudly
  via the error scopes; a bare return would have hidden it).
- docs: finish_block and finish_and_read state their failure contracts; USAGE and AGENTS.md
  name the new roots step in the ci enumeration.

* xtask: check a library root at the source path that cargo metadata reports

The roots check read src/lib.rs for every library target, so a package that sets its library path was checked on the wrong file. Libraries now use the reported source path, with the same default as binaries when none is given.

* xtask: match the crate-root deny lints by whole name, ignoring a trailing comment

A lint named only in a trailing comment, or a lint whose name contains another (clippy::panic inside clippy::panic_in_result_fn), satisfied the deny check. Lint names are now compared whole and a trailing comment is ignored.

* xtask: read the crate-root attributes from the header, not a fixed 30 lines

The roots check read only the first 30 lines of each crate root, so a root whose attributes came after a longer doc header was reported as missing them. The check now reads the inner attributes at the top of the file: it skips blank lines and comments, reads each attribute whole, and stops at the first item. A multi-line list is read in full and a commented-out attribute does not count.

* xtask: reword two comments in the roots check

Comments only: the lint-name match and the source-path default are described without naming a lint or a build tool. No code changes.

* xtask: report a root attribute that overrides the required denies

* xtask: accept a runtime manifest dir only when it has a parent

* xtask: render the overridden deny attribute without literal braces

The write! escaped the braces around the substituted attribute and lint,
so the violation printed `#![{allow}({clippy::panic})]`; assert the
rendered message in the allow-override test.

* Tests: new test helpers meet the crate-root panic lints

Main added test helpers after this branch; the deny at the crate root now
applies to them.

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

* roots: crates/wincolor is the second crate allowed unsafe

Main added it for the Windows colour APIs after this branch; its module docs
already say so.

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

---------

Co-authored-by: eliets2 <287273517+eliets2@users.noreply.github.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 00:29:41 +01:00
insideTheFluxandClaude Sonnet 5.5 85c1265da7 LR-LIB-PEOPLE: face boxes turn only by an orientation the Exif states (#2674, review)
A photo whose Exif states a size but no orientation, and whose XMP says
tiff:Orientation=6, is displayed as stored (by the Exif alone). extract turned
its stored-frame boxes by the XMP's orientation anyway, so import stored them
turned while Read Metadata from File did not (review of #2857).

extract_embedded now turns by the orientation the Exif's own first IFD states
(exif::ifd0_orientation, which also leaves out the XMP in a TIFF's tag 700),
the same rule as for the size. Metadata::orientation is still filled from the
XMP as before.

Tests (both fail on the previous head, with the reviewer's numbers): the photo
as a JPEG and as a TIFF in lightcraft-meta, and through library.import and
photo.readMetadataFromFile in the engine.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CvoftP5JSqAEJ9t7FSczTs
2026-11-04 18:04:57 -08:00
FredApps 95455a73ce Merge main into branch, combining the parity checklist rows both sides edited 2026-10-31 07:28:20 +01:00
insideTheFluxandClaude Opus 5.5 8fd4e3bf1c Merge storytold/main into fix/2674-stored-frame-regions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CvoftM8ZqGRb62UWw9DAKP
2026-10-30 23:25:02 -07:00
aiongg 71aaf18818 Integration: GPX attributes use decoded_and_normalized_value (deprecated method fails clippy) 2026-10-31 03:09:09 +00:00
aiongg 56c842d8fe Merge track r3-t09
# Conflicts:
#	docs/parity-checklist.md
#	docs/raw-parity.md
#	docs/ui-parity.md
#	docs/whats-new.md
2026-10-31 02:31:25 +00:00
aiongg e05c4f7e7c Merge track r3-t08
# Conflicts:
#	crates/meta/README.md
#	crates/ui-egui/locales/cs.json
#	crates/ui-egui/locales/de.json
#	crates/ui-egui/locales/es.json
#	crates/ui-egui/locales/fi.json
#	crates/ui-egui/locales/fr.json
#	crates/ui-egui/locales/id-formats.json
#	crates/ui-egui/locales/id.json
#	crates/ui-egui/locales/it.json
#	crates/ui-egui/locales/ja.json
#	crates/ui-egui/locales/ka-formats.json
#	crates/ui-egui/locales/ka.json
#	crates/ui-egui/locales/pl.json
#	crates/ui-egui/locales/pt-br.json
#	crates/ui-egui/locales/ru.json
#	crates/ui-egui/locales/sv-formats.json
#	crates/ui-egui/locales/sv.json
#	crates/ui-egui/locales/uk.json
#	crates/ui-egui/locales/vi.json
#	crates/ui-egui/locales/zh-hans.json
#	crates/ui-egui/locales/zh-hant.json
#	crates/ui-egui/src/panels/grid.rs
#	crates/ui-egui/tests/it/main.rs
#	docs/gaps.md
#	docs/library-shortcuts.md
#	docs/parity-checklist.md
#	docs/raw-parity.md
#	docs/user/guides/export-photos.md
#	docs/whats-new.md
2026-10-31 02:31:16 +00:00
aiongg 1f111b5e80 Merge track r3-t07
# Conflicts:
#	crates/engine/src/tests/libops.rs
#	docs/gaps.md
#	docs/parity-checklist.md
#	docs/whats-new.md
2026-10-31 02:30:21 +00:00
aiongg b500ddadd0 Integration: #2605 use unsigned_abs for the written UTC offset and skip offsets beyond 18 h; test with i16::MIN 2026-10-31 02:22:42 +00:00
aiongg 42e1685b3a Merge PR #3367: Reject multiple GPX document roots 2026-10-31 02:10:50 +00:00
aiongg bfb9572eb1 Merge PR #2529: LR-MAP-TRACKLOG: Decode XML character references in GPX
docs/gaps.md, docs/whats-new.md, docs/parity-checklist.md: both sides' header items, entries and rows kept.
2026-10-31 02:10:14 +00:00
aiongg b28ef86773 Merge PR #2724: fix(codecs): validate JPEG ICC APP2 chunk sequences
Conflicts: docs/gaps.md header merged (newer date, both change lists), rows kept; other docs unioned
2026-10-31 02:09:46 +00:00
aiongg cc4471d472 Merge PR #3371: Ignore negative XMP pixel dimensions 2026-10-31 02:08:31 +00:00
aiongg a13d7dd47d Merge PR #3242: Reject EXIF offsets beyond 18 hours 2026-10-31 02:08:31 +00:00
aiongg 035d4d5dcb Merge PR #2977: LR-META-EXIF-FULL: reject malformed EXIF clocks
docs/gaps.md, docs/parity-checklist.md, docs/whats-new.md: both sides kept; the PR's sentences added to main's rows and entries.
docs/xmp-interop.md: capture-time paragraph combines both sides.
The PR's test file crates/engine/src/tests_import.rs landed in crates/engine/src/tests/import.rs (moved on main).
2026-10-31 02:08:25 +00:00
aiongg 60e730c3df Merge PR #2712: Never crash: NaN in tone curves and an i16::MIN UTC offset (#2579 items 3 and 4) 2026-10-31 02:08:23 +00:00
aiongg e967200f0d Merge PR #2912: Reject incomplete ISO timestamps in metadata and track logs
crates/meta/src/xmp.rs: kept main's 'mod tests;'; the PR's two tests ported to xmp/tests.rs.
docs/gaps.md, docs/parity-checklist.md, docs/whats-new.md: both sides kept; newer date in headers; XMP row and header carry the PR's sentence.
2026-10-31 02:07:55 +00:00
aiongg 020622aadf Merge PR #2776: Reject signed numeric character references in XML entity decoding
crates/meta/src/xmp.rs: kept main's 'mod tests;' (tests moved to xmp/tests.rs); PR's new test ported there.
2026-10-31 02:06:49 +00:00
aiongg 6c8bcf8a29 Merge PR #2771: Read Canon maker-note lens when LensModel is missing 2026-10-31 02:06:36 +00:00
aiongg 8c96803360 Merge PR #2717: Never crash: rational tag lists show 16 values like every other list (#2579 item 7) 2026-10-31 02:06:36 +00:00
aiongg 9a98d40575 Merge PR #2605: Write capture time UTC offset and sub-seconds in write_exif 2026-10-31 02:06:35 +00:00
aiongg 0c264a6a49 Merge PR #2290: #2284: read the Exif and XMP items of HEIF files 2026-10-31 02:06:35 +00:00
insideTheFluxandClaude Opus 5.5 72a074b9bc LR-LIB-PEOPLE: a size only the XMP states doesn't turn face boxes (#2674)
extract turned regions by the shape of the size it had, and that could be the XMP's: tiff:ImageWidth and
tiff:ImageLength fill it in when Exif states no size, and for a TIFF-based file from_tiff has already merged the file's
own XMP. An XMP size of the upright photo then matched boxes drawn on the upright photo, so they were turned by
mistake. Other paths don't get here (the image header decides for images, merge_into for a packet read as a sidecar).
A raw with its own sidecar without mwg-rs:Regions does, because it keeps extract's boxes.

from_tiff now keeps the size Exif states when it merges the XMP, and extract decides with that size; with none, boxes
stay as written, as they do on main. extract still reports the XMP's size. Every raw decoder sets its own size after
from_tiff, so none of them sees a difference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CvoftN82NMM6Ebbf3YAK9e
2026-10-30 17:38:32 -07:00
insideTheFluxandClaude Opus 5.5 772bb8296a Merge storytold/main into fix/2674-stored-frame-regions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:44:54 -07:00
Brandon Thomas bdb146be43 Merge PR #2833 2026-10-30 15:24:30 -04:00
FredApps 1d7d188846 Reconcile shutter precision with split import/export modules
Preserve main's module boundaries and current metadata behavior. Move the shutter changes and regressions into the corresponding probe, encoding and test modules. Preserve both parity records. Hosted CI must validate this refreshed head.
2026-10-30 08:13:52 +01:00
Max MittelstädtandGPT-6-Luna 4e7d0a6282 Ignore negative XMP pixel dimensions
Found while testing crates/meta/src/xmp.rs:550

Co-Authored-By: GPT-6-Luna <noreply@openai.com>
2026-10-30 06:52:49 +00:00
Max MittelstädtandGPT-6-Luna 4c4d322bec Reject multiple GPX document roots
Found while testing crates/meta/src/gpx.rs:111

Co-Authored-By: GPT-6-Luna <noreply@openai.com>
2026-10-30 06:15:05 +00:00
Max MittelstädtandGPT-6-Luna e981b25e06 Reject EXIF offsets beyond 18 hours
Found while testing crates/meta/src/datetime.rs:77

Co-Authored-By: GPT-6-Luna <noreply@openai.com>
2026-10-28 12:07:28 +00:00
eliets2 3833c37a75 review: read Canon LensModel (0x0095) for the maker-note lens fallback
- tag 0x0001 is CameraSettings (numeric LensType at index 22), not an ASCII name; real EOS 5D files never carry a lens name there
- read the lens name from 0x0095 (LensModel) and yield none when only the numeric LensType exists
- fixture now builds a representative maker note (CameraSettings table + LensType 178) and covers both byte orders plus the nameless case
2026-10-28 07:56:50 +02:00
eliets2 9db9811759 Read Canon maker-note lens when LensModel is missing
LightCraft already fills a missing lens_model from the Panasonic and Nikon maker notes in try_read_exif, but never from the Canon maker note, so Canon bodies such as the EOS 5D that omit EXIF LensModel cannot match any lens profile even when the maker note records the lens.

Add a canon_maker_note_lens fallback in try_read_exif, parsed with lightcraft_tiff::makernote::parse_makernote (Canon notes are the Plain kind), mirroring panasonic_maker_note_lens; add a unit test in exif.rs that feeds an Exif block with a Canon maker note but no LensModel and asserts lens_model is populated.

Test: canon_maker_note_lens_fills_lens_model failed before the change and passes after.
2026-10-28 07:56:50 +02:00