Skip to content

LR-VIEW-PHOTOGRID: the grid asks the image decoders for no thumbnail of a video (#2682) - #2765

Merged
aiongg merged 3 commits into
storytold:mainfrom
insideTheFlux:fix/2682-video-thumbnails
Oct 31, 2026
Merged

aiongg merged 3 commits into
storytold:mainfrom
insideTheFlux:fix/2682-video-thumbnails

Conversation

@insideTheFlux

@insideTheFlux insideTheFlux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Part of #2682 (split from #2678): the "do not queue an image decode for a file the image decoder cannot read" ask. The other half, retrying a failure only when its photo changes, is #2764.

Problem

Four of the six files #2682 lists are healthy MP4 videos. The grid asked the image decoders for their thumbnails, which failed with "unrecognised image format", put a "!" on the cell and were asked again whenever the library changed. Folder import never takes a video, but a Lightroom catalog import does: it keeps each record with Lightroom's format VIDEO and the kind Image (#2021 changes the kind to Video), and no thumbnail code looked at the kind.

Fix

Not changed: opening a video in the loupe still fails with the decoder's message, and Build Previews still counts a video's view render as failed. Showing a frame needs a video decoder (LR-VID-PLAY).

Test

  • model::edited_tests::a_video_is_known_by_its_kind_format_or_extension.
  • render::thumbnail_tests::a_video_asks_the_decoders_for_no_thumbnail: through grid::request_thumb, a video by kind, by format VIDEO and by extension alone builds no job, queues nothing and has no failure, while a JPEG still gets its job. With the thumb_job check removed it fails (thumb_jobs_built 1 instead of 0).
  • cmd::face_recognize::imp::tests::a_video_is_not_searched_for_faces, beside a_photo_that_could_not_be_searched_is_left_alone_for_the_session: a video is not searched and is not queued, while a photo still is. Without the skip it fails.

Checks (Windows 11, CPU only: LIGHTCRAFT_GPU=0)

  • cargo test -p lightcraft-ui-egui --lib: 1225 passed, 6 failed. The six are tests_model_setup::*, which need the engine's denoise feature that a single-crate build leaves off ("this build cannot run denoise models"); the same six fail on LR-VIEW-PHOTOGRID: a thumbnail that can't be read is tried again only when its photo changes (#2682) #2764's branch, which shares only main with this one.
  • cargo test -p lightcraft-engine --lib: 1248 passed, 1 failed: tests_import::recursive_discovery_includes_sony_sr2_and_srf_case_insensitively, a Windows path-separator failure already on main.
  • cargo test -p lightcraft-catalog --lib a_video_is_known: passed.
  • cargo clippy --keep-going -p lightcraft-catalog -p lightcraft-engine -p lightcraft-ui-egui --all-targets -- -D warnings: the only error is the Windows unused variable: gvfs in crates/engine/src/doc_path.rs:66, which is on main and fixed by Tests: fix the Windows clippy failure in doc_path's GVfs check (unused variable since #2412) #2746.
  • cargo fmt --check, cargo xtask parity, layers and assets pass. Not run: the full cargo xtask ci.

Overlap

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Video files are now recognized by type, format, or filename extension. Grid cells show a placeholder instead of attempting thumbnail decoding, and videos are excluded from background face searches.

…of a video (storytold#2682)

A video in the library (an MP4 or MOV from a Lightroom catalog import) went
to the image decoders for its grid thumbnail, failed with "unrecognised
image format", showed a "!" and was tried again whenever the library
changed (issue storytold#2682: four of its six undecodable files were healthy
videos). Photo::is_video recognises a video by its kind, by the format
VIDEO a Lightroom catalog gives it (its import still keeps them as images),
or by its extension; Session::thumb_job returns None for one, so the grid,
filmstrip, Compare and Build Previews ask for no thumbnail. The cell keeps
its plain placeholder.

Tests: model::edited_tests::a_video_is_known_by_its_kind_format_or_extension,
render::thumbnail_tests::a_video_asks_the_decoders_for_no_thumbnail (fails
on main: a job is built for the video).

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

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between f53d559 and 746917e.

Files selected for processing: 3
  • crates/engine/src/media/session.rs
  • crates/ui-egui/src/render/thumbnail_tests.rs
  • docs/whats-new.md
Files skipped from review as they are similar to previous changes: 1
  • docs/whats-new.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

Walkthrough

The catalog now identifies videos by media kind, format, or filename extension. Thumbnail job creation and background face-search eligibility skip recognized videos. Tests cover video recognition and both exclusions.

Changes: Video handling

Layer / File(s) Summary
Video identification
crates/catalog/src/model.rs
Photo::is_video recognizes videos by media kind, Lightroom’s VIDEO format, or a listed filename extension. Tests cover matching and non-matching examples.
Skip video thumbnail jobs
crates/engine/src/media/session.rs, crates/ui-egui/src/render/thumbnail_tests.rs, docs/whats-new.md
Session::thumb_job returns no job for videos. UI tests check repeated requests and confirm that regular photos still build thumbnail jobs. The release note describes the placeholder behavior and video handling.
Exclude videos from face search
crates/engine/src/cmd/face_recognize.rs
Background face-search eligibility excludes videos. Tests verify that videos are excluded while regular photos remain eligible.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: aiongg, echelon

Merge Risk: Minimal · up to 74691

The supplied evidence identifies no actionable issue that should delay merging after normal checks.

Architecture risk: Low · up to 74691

The change affects 2 systems.

Changed systems: crates, docs

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 4 changed files map to changed impact.
  • observed — docs (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/catalog/src/model.rs: Added Photo::is_video, which recognizes videos by kind, VIDEO format, or a case-insensitive match against 12 filename extensions.
  • observed — Modified behavior in crates/catalog/src/model.rs: Added a test covering recognition by kind, Lightroom format, and video extensions, plus rejection of image formats, extensionless names, and dotfiles.
  • observed — Modified behavior in crates/engine/src/cmd/face_recognize.rs: needs_search now requires !photo.is_video() as well as library membership, so videos no longer qualify for background face searches.
  • observed — Modified behavior in crates/engine/src/cmd/face_recognize.rs: Added a test that creates a video photo and asserts it is excluded by needs_search and pending, while a regular photo remains eligible.
Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: preventing the grid from requesting thumbnails from image decoders for videos.
Docstring Coverage Passed Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Clippy (1.99.0)

Clippy execution timed out

Comment @coderabbitai help to get the list of available commands.

…id's thumbnails do

needs_search sent each video to the image decoders to look for faces; the
decode failed and the photo was left alone only for the session
(scan_failed is in memory), so every launch tried each video again,
silently. Photo::is_video now keeps videos out of the search, as it keeps
them out of the grid's thumbnails. The face search was not part of the
issue this PR fixes; it follows the same rule.

Test: cmd::face_recognize::imp::tests::a_video_is_not_searched_for_faces

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

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the whole diff at f53d559. Photo::is_video (kind, VIDEO format, or a listed extension, with dot files and bare names excluded) is used by thumb_job to return None, and by the face scan needs_search to skip videos. Tests cover the helper, the scan and the grid (no jobs built, no failure marker, photos still asked for). gate / gate (ubuntu-24.04) and SonarCloud Scan are green at this head. No defects found.

d-rouge added a commit to d-rouge/lightcraft that referenced this pull request Oct 25, 2026
…me, docs

Address the review at e7f9934:

- A video in a rendered export, print, contact sheet or slideshow is skipped
  with a per-file warning instead of failing every other photo with "no such
  photo"; Original format still copies the clip. Photo::is_video() is the one
  check (kind, a Lightroom catalog's VIDEO format, or an mp4/mov/m4v
  extension), used by the engine guards and the UI and ready to share with
  storytold#2765.
- The bounded video probe no longer falls back to reading a whole .mp4 when
  the file is ISO-BMFF: a clip cut off before its moov (mdat size 0) or a moov
  over the cap is an error. The 64 MB cap applies to all metadata boxes
  together, and top-level XMP uuid boxes are kept. Only a file whose bytes are
  another format is read whole and probed as what it is.
- mvhd UTC times keep their Z offset; Apple's mdta
  com.apple.quicktime.creationdate (with make/model/software/location) is
  parsed and preferred, so iPhone clips keep their local time. Durations use
  the ISO all-ones sentinel and the tkhd matrix entries use checked arithmetic,
  with a hostile i32 test.
- Desktop videos get the same XMP titles, captions and keywords as the web
  build: the kept boxes go through meta::extract and the container fills only
  what is missing (tested with a top-level XMP uuid).
- read_udta_text honours the text length; the 10:00/07:20 comment is fixed;
  the new messages are in all 17 catalogs and Duration is filled in ka/pl/vi.
- docs/whats-new and the parity checklist's Last updated/revision explain that
  the LR-VID-PLAY partial is import and cataloguing, not playback.

New tests: mdat before moov with a 64-bit size, moov over the cap, a misnamed
.mp4, mdta/XMP metadata, matrix overflow, export/print/contact/slideshow skips
and legacy VIDEO guards. cargo xtask ci: fmt, clippy, heif, test, parity,
layers and assets pass; wasm needs the wasm32 target on this machine.
d-rouge added a commit to d-rouge/lightcraft that referenced this pull request Oct 25, 2026
…me, docs

Address the review at e7f9934:

- A video in a rendered export, print, contact sheet or slideshow is skipped
  with a per-file warning instead of failing every other photo with "no such
  photo"; Original format still copies the clip. Photo::is_video() is the one
  check (kind, a Lightroom catalog's VIDEO format, or an mp4/mov/m4v
  extension), used by the engine guards and the UI and ready to share with
  storytold#2765.
- The bounded video probe no longer falls back to reading a whole .mp4 when
  the file is ISO-BMFF: a clip cut off before its moov (mdat size 0) or a moov
  over the cap is an error. The 64 MB cap applies to all metadata boxes
  together, and top-level XMP uuid boxes are kept. Only a file whose bytes are
  another format is read whole and probed as what it is.
- mvhd UTC times keep their Z offset; Apple's mdta
  com.apple.quicktime.creationdate (with make/model/software/location) is
  parsed and preferred, so iPhone clips keep their local time. Durations use
  the ISO all-ones sentinel and the tkhd matrix entries use checked arithmetic,
  with a hostile i32 test.
- Desktop videos get the same XMP titles, captions and keywords as the web
  build: the kept boxes go through meta::extract and the container fills only
  what is missing (tested with a top-level XMP uuid).
- read_udta_text honours the text length; the 10:00/07:20 comment is fixed;
  the new messages are in all 17 catalogs and Duration is filled in ka/pl/vi.
- docs/whats-new and the parity checklist's Last updated/revision explain that
  the LR-VID-PLAY partial is import and cataloguing, not playback.

New tests: mdat before moov with a 64-bit size, moov over the cap, a misnamed
.mp4, mdta/XMP metadata, matrix overflow, export/print/contact/slideshow skips
and legacy VIDEO guards. cargo xtask ci: fmt, clippy, heif, test, parity,
layers and assets pass; wasm needs the wasm32 target on this machine.
main split media.rs into media/ and moved render.rs's thumbnail tests to render/thumbnail_tests.rs
(storytold#3103): thumb_job's video check moves with it to media/session.rs, the grid test to thumbnail_tests.rs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GfjNkJiMUagz3DN3zoV2rV

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed current head f53d559 and existing review, including Photo::extension/is_video, thumb_job, grid::request_thumb and background face-scan eligibility. No additional concrete introduced defect found. The video guard returns before thumbnail/quick-thumbnail job creation and excludes the background face search; the image path remains intact. The extension fallback deliberately also identifies older catalog entries whose kind still says Image.

Local validation: all changed Rust files pass rustfmt --edition 2024 --check. I did not execute the new catalog, face-scan or UI tests. Full dependency validation is blocked by client-credential transport failures; I did not repeat the known pinned egui fetch or change security settings. The head's Ubuntu gate and SonarCloud checks report success; those are CI results. The author-reported tests are not independent local verification. COMMENT for the unexecuted thumbnail/scan integration coverage.

@insideTheFlux

Copy link
Copy Markdown
Contributor Author

The gate failure on 746917e (run 40453832859) is tests::slideshow::a_manual_slideshow_waits_for_the_arrow_keys: its click on Settings ▸ Slideshow ▸ Manual was cancelled because the checkbox moved 21 px before the release ("moved before its release; nothing was retargeted"). That is the Slideshow settings layout shift that @nledford's #2848 fixes. This PR doesn't touch the slideshow or Settings, and the other 1585 ui-egui tests passed.

d-rouge added a commit to d-rouge/lightcraft that referenced this pull request Oct 27, 2026
…me, docs

Address the review at e7f9934:

- A video in a rendered export, print, contact sheet or slideshow is skipped
  with a per-file warning instead of failing every other photo with "no such
  photo"; Original format still copies the clip. Photo::is_video() is the one
  check (kind, a Lightroom catalog's VIDEO format, or an mp4/mov/m4v
  extension), used by the engine guards and the UI and ready to share with
  storytold#2765.
- The bounded video probe no longer falls back to reading a whole .mp4 when
  the file is ISO-BMFF: a clip cut off before its moov (mdat size 0) or a moov
  over the cap is an error. The 64 MB cap applies to all metadata boxes
  together, and top-level XMP uuid boxes are kept. Only a file whose bytes are
  another format is read whole and probed as what it is.
- mvhd UTC times keep their Z offset; Apple's mdta
  com.apple.quicktime.creationdate (with make/model/software/location) is
  parsed and preferred, so iPhone clips keep their local time. Durations use
  the ISO all-ones sentinel and the tkhd matrix entries use checked arithmetic,
  with a hostile i32 test.
- Desktop videos get the same XMP titles, captions and keywords as the web
  build: the kept boxes go through meta::extract and the container fills only
  what is missing (tested with a top-level XMP uuid).
- read_udta_text honours the text length; the 10:00/07:20 comment is fixed;
  the new messages are in all 17 catalogs and Duration is filled in ka/pl/vi.
- docs/whats-new and the parity checklist's Last updated/revision explain that
  the LR-VID-PLAY partial is import and cataloguing, not playback.

New tests: mdat before moov with a 64-bit size, moov over the cap, a misnamed
.mp4, mdta/XMP metadata, matrix overflow, export/print/contact/slideshow skips
and legacy VIDEO guards. cargo xtask ci: fmt, clippy, heif, test, parity,
layers and assets pass; wasm needs the wasm32 target on this machine.
@aiongg
aiongg merged commit 9ac518a into storytold:main Oct 31, 2026
5 of 6 checks passed
d-rouge added a commit to d-rouge/lightcraft that referenced this pull request Nov 1, 2026
…me, docs

Address the review at e7f9934:

- A video in a rendered export, print, contact sheet or slideshow is skipped
  with a per-file warning instead of failing every other photo with "no such
  photo"; Original format still copies the clip. Photo::is_video() is the one
  check (kind, a Lightroom catalog's VIDEO format, or an mp4/mov/m4v
  extension), used by the engine guards and the UI and ready to share with
  storytold#2765.
- The bounded video probe no longer falls back to reading a whole .mp4 when
  the file is ISO-BMFF: a clip cut off before its moov (mdat size 0) or a moov
  over the cap is an error. The 64 MB cap applies to all metadata boxes
  together, and top-level XMP uuid boxes are kept. Only a file whose bytes are
  another format is read whole and probed as what it is.
- mvhd UTC times keep their Z offset; Apple's mdta
  com.apple.quicktime.creationdate (with make/model/software/location) is
  parsed and preferred, so iPhone clips keep their local time. Durations use
  the ISO all-ones sentinel and the tkhd matrix entries use checked arithmetic,
  with a hostile i32 test.
- Desktop videos get the same XMP titles, captions and keywords as the web
  build: the kept boxes go through meta::extract and the container fills only
  what is missing (tested with a top-level XMP uuid).
- read_udta_text honours the text length; the 10:00/07:20 comment is fixed;
  the new messages are in all 17 catalogs and Duration is filled in ka/pl/vi.
- docs/whats-new and the parity checklist's Last updated/revision explain that
  the LR-VID-PLAY partial is import and cataloguing, not playback.

New tests: mdat before moov with a 64-bit size, moov over the cap, a misnamed
.mp4, mdta/XMP metadata, matrix overflow, export/print/contact/slideshow skips
and legacy VIDEO guards. cargo xtask ci: fmt, clippy, heif, test, parity,
layers and assets pass; wasm needs the wasm32 target on this machine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants