merge: proxy and decode-tier fixes (V-1, V-24, V-25, V-26, V-27, V-28)
Merge branch fix2/proxies-tiers into the verification branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
28 files changed
+1049
-92
No files matched your search
@@ -56,6 +56,24 @@ public sealed class DecodeTierTests(TestContext context)
|
||||
SequenceFrames.WithTier(none, new FileTier(ImageFileFormat.Cr2, DecodeTier.Unavailable, null, "nothing here", 0, 0), damaged: false).Flags);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AFrameReadFromItsProxyKeepsItsPreviewTierButIsNotPreviewOnly()
|
||||
{
|
||||
// A HEIF on the server: its decoders find only the Exif thumbnail, but renders read the proxy a client sent.
|
||||
var heif = Sidecar() with { File = "originals/IMG_0001.HEIC", Format = ImageFileFormat.Heif, Flags = FrameFlags.Duplicate };
|
||||
var thumbnail = new FileTier(ImageFileFormat.Heif, DecodeTier.EmbeddedPreview, "managed-preview", "no managed decoder for Heif", 160, 120);
|
||||
var proxied = SequenceFrames.WithTier(heif, thumbnail, damaged: false, proxied: true);
|
||||
Assert.Equal((DecodeTier.EmbeddedPreview, FrameFlags.Duplicate, (int?)160, (int?)120), (proxied.Tier, proxied.Flags, proxied.PreviewW, proxied.PreviewH));
|
||||
|
||||
// The flag follows the proxy, the tier and preview size stay the original's.
|
||||
var gone = SequenceFrames.WithProxy(proxied, proxied: false);
|
||||
Assert.Equal((DecodeTier.EmbeddedPreview, FrameFlags.Duplicate | FrameFlags.PreviewOnly, (int?)160), (gone.Tier, gone.Flags, gone.PreviewW));
|
||||
Assert.Equal(FrameFlags.Duplicate, SequenceFrames.WithProxy(gone, proxied: true).Flags);
|
||||
// Other tiers have no preview-only flag to follow.
|
||||
var unavailable = SequenceFrames.WithTier(heif, new FileTier(ImageFileFormat.Heif, DecodeTier.Unavailable, null, "nothing", 0, 0), damaged: false);
|
||||
Assert.Same(unavailable, SequenceFrames.WithProxy(unavailable, proxied: false));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SidecarsKeepTheTierAndThePreviewSizeAndOlderOnesReadAsUnknown()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user