fix(imaging): record only what decoding proves and find GPR JPEGs across sequences
- Preview sizes come from probes and unscaled decodes: a size-limited decode picks the smallest preview that reaches its edge (CR3 PRVW 1620x1080), so renders and deep passes record its tier without a size and the output cap keeps the largest preview's. - A read error is not an undecodable file: ImageDecoder.Decode throws the IOException when a provider could not read the file and none produced pixels. Deep passes never flag frames they could not read or that vanished, and frames only an interrupted earlier run found undecodable are decoded again before they are flagged. - Renders resolve stand-ins only for frames the pipeline asks for; frames the read-ahead meets on the way (skipped by speed-ups) are left alone. - A GoPro GPR finds its JPEG in the index when an import or upload kept it in a sequence of its own (same original stem and capture time), for probes, deep analysis, renders, thumbnails, proxies and the editor; GPRs whose JPEG is indexed later are probed again. - Thumbnails judge an embedded preview by its own JPEG header. - PostgreSQL writes tier fields 1000 frames per statement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
19 files changed
+689
-111
No files matched your search
@@ -318,17 +318,19 @@ public abstract class CatalogRepositoryTests(TestContext context) : RepositoryTe
|
||||
await db.Archives.UpsertAsync(archive, Ct);
|
||||
var sequence = TestData.Sequence(archive.Id);
|
||||
await db.Sequences.UpsertAsync(sequence, Ct);
|
||||
var frames = Enumerable.Range(0, 40).Select(i => TestData.Frame(sequence.Id, i) with { Flags = FrameFlags.Duplicate }).ToList();
|
||||
// More frames than one batched PostgreSQL statement holds.
|
||||
const int count = 1205;
|
||||
var frames = Enumerable.Range(0, count).Select(i => TestData.Frame(sequence.Id, i) with { Flags = FrameFlags.Duplicate }).ToList();
|
||||
await db.Frames.BulkInsertAsync(frames, Ct);
|
||||
|
||||
var tiers = frames.Select(f => new FrameTierFields(f.Id, f.Index % 2 == 0 ? FrameFlags.PreviewOnly : FrameFlags.Undecodable, 1620 + f.Index, 1080)).ToList();
|
||||
Assert.Equal(40, await db.Frames.UpdateTiersAsync(tiers, Ct));
|
||||
var read = await db.Frames.ListBySequenceAsync(sequence.Id, cancellationToken: Ct);
|
||||
Assert.Equal(count, await db.Frames.UpdateTiersAsync(tiers, Ct));
|
||||
var read = await Titano.Data.Processing.SequenceFrames.ListAsync(db, sequence.Id, Ct);
|
||||
Assert.SequenceEqual(tiers.Select(t => (t.Flags, t.PreviewWidth, t.PreviewHeight)), read.Select(f => (f.Flags, f.PreviewWidth, f.PreviewHeight)));
|
||||
|
||||
// A sync from the sidecar writes the tier fields like every other one.
|
||||
await db.Frames.SyncSequenceAsync(sequence.Id, [.. read.Select(f => f with { PreviewWidth = 4, PreviewHeight = 3, Flags = FrameFlags.None })], Ct);
|
||||
Assert.True((await db.Frames.ListBySequenceAsync(sequence.Id, cancellationToken: Ct)).All(f => (f.Flags, f.PreviewWidth, f.PreviewHeight) == (FrameFlags.None, 4, 3)));
|
||||
Assert.True((await Titano.Data.Processing.SequenceFrames.ListAsync(db, sequence.Id, Ct)).All(f => (f.Flags, f.PreviewWidth, f.PreviewHeight) == (FrameFlags.None, 4, 3)));
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
Reference in new issue
Block a user