feat: owner review 2 phase 4b: mass conversion after import (#13)
CI / Build and test (push) Failing after 3m1s
CI / PostgreSQL 16 integration (push) Skipped
CI / PostgreSQL 17 integration (push) Skipped
CI / Docker image (push) Skipped
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 10s
Release / Build, test and publish (push) Successful in 15m31s
Release / Server image (push) Successful in 1m13s
CI / Build and test (push) Failing after 3m1s
CI / PostgreSQL 16 integration (push) Skipped
CI / PostgreSQL 17 integration (push) Skipped
CI / Docker image (push) Skipped
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 10s
Release / Build, test and publish (push) Successful in 15m31s
Release / Server image (push) Successful in 1m13s
Convert photos already in the archive to JPEG, TIFF-16 or Linear DNG, from the panel's Library and the desktop's Archive and Library. Each run asks Replace (same frames, originals to the trash, recoverable) or New sequence. A dry run lists what converts, what is skipped and why, size before and after, and free space; the job converts exactly the confirmed photos, resumes, and commits all or nothing per sequence. A conversion never changes what Chronos reads from a photo. Replaced originals are erased only on the archive's own word that their conversion is gone. Desktop TIFFs that WIC showed black or as noise now go to the managed reader; the Edit picker no longer spins a core. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #13.
This commit is contained in:
1 parent
7e4a3b481d
commit
efa87f68ce
354 files changed
+24530
-843
No files matched your search
@@ -232,6 +232,44 @@ public sealed class ManagedDecoderProviderTests(TestContext context)
|
||||
Assert.Equal(DecodeTier.Unavailable, client.Probe(Write("y.webp", Fixtures.WebP()), ImageFileFormat.WebP).Tier);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A provider that reads headers (a conversion's) finds a JPEG, PNG or TIFF native, at its oriented size, only when its
|
||||
/// decoder takes what the headers describe; the others probe as before. Damage past the headers shows only when decoding.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void HeaderProbesSayWhatTheDecodersTake()
|
||||
{
|
||||
var headers = new ManagedDecoderProvider { ReadsHeaders = true };
|
||||
using var scene = SyntheticRaw.Smooth(W, H);
|
||||
var jpeg = headers.Probe(Write("portrait.jpg", JpegFile(W, H, 6)), ImageFileFormat.Jpeg);
|
||||
Assert.Equal((DecodeTier.Native, "managed-jpeg", H, W), (jpeg.Tier, jpeg.Decoder, jpeg.Width, jpeg.Height));
|
||||
var png = headers.Probe(Write("a.png", PngEncoder.Encode(scene)), ImageFileFormat.Png);
|
||||
Assert.Equal((DecodeTier.Native, "managed-png", W, H), (png.Tier, png.Decoder, png.Width, png.Height));
|
||||
var tiff = headers.Probe(Write("a.tif", TiffWriter.Write(scene)), ImageFileFormat.Tiff);
|
||||
Assert.Equal((DecodeTier.Native, "managed-tiff", W, H), (tiff.Tier, tiff.Decoder, tiff.Width, tiff.Height));
|
||||
Assert.Equal(DecodeTier.Native, headers.Probe(Write("IMG_5.CR2", Cr2File("Canon EOS 5D Mark III")), ImageFileFormat.Cr2).Tier);
|
||||
// Headers alone: what follows them is not read.
|
||||
var header = headers.Probe(Write("header.jpg", Conversion.ColorFixtures.JpegHeader(4_000, 3_000)), ImageFileFormat.Jpeg);
|
||||
Assert.Equal((DecodeTier.Native, 4_000, 3_000), (header.Tier, header.Width, header.Height));
|
||||
|
||||
// A CMYK TIFF, a JPEG cut before its first scan, a file that is not what its format says, an arithmetic-coded JPEG,
|
||||
// and a JPEG, PNG or TIFF larger than its decoder takes: refused, like a decode.
|
||||
var cmyk = Write("cmyk.tif", Conversion.ColorFixtures.Tiff(6, 4, 5, [0, 255, 255, 0]));
|
||||
Assert.Throws<InvalidDataException>(() => headers.Probe(cmyk, ImageFileFormat.Tiff));
|
||||
Assert.Throws<InvalidDataException>(() => headers.Probe(Write("cut.jpg", JpegFile(W, H, 1)[..200]), ImageFileFormat.Jpeg));
|
||||
Assert.Throws<InvalidDataException>(() => headers.Probe(Write("short.png", [0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A]), ImageFileFormat.Png));
|
||||
Assert.Throws<InvalidDataException>(() => headers.Probe(Write("arithmetic.jpg", Conversion.ColorFixtures.JpegHeader(6, 4, sof: 0xC9)), ImageFileFormat.Jpeg));
|
||||
Assert.Throws<InvalidDataException>(() => headers.Probe(Write("huge.jpg", Conversion.ColorFixtures.JpegHeader(16_384, 16_385)), ImageFileFormat.Jpeg));
|
||||
Assert.Throws<InvalidDataException>(() => headers.Probe(Write("huge.png", Conversion.ColorFixtures.PngHeader(16_384, 16_385)), ImageFileFormat.Png));
|
||||
Assert.Throws<InvalidDataException>(() => headers.Probe(Write("huge.tif", Conversion.ColorFixtures.TiffHeader(13_377, 13_378)), ImageFileFormat.Tiff));
|
||||
// Through a chain: unavailable with the decoder's reason; a provider without header reads still finds it native.
|
||||
var chain = new ImageDecoder([headers]).Probe(cmyk, ImageFileFormat.Tiff);
|
||||
Assert.Equal(DecodeTier.Unavailable, chain.Tier);
|
||||
Assert.Contains("photometric 5", chain.Reason);
|
||||
Assert.Equal(DecodeTier.Native, new ManagedDecoderProvider().Probe(cmyk, ImageFileFormat.Tiff).Tier);
|
||||
Assert.Throws<InvalidDataException>(() => new ManagedDecoderProvider().Decode(new DecodeRequest(cmyk)));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GoProRawDecodesThroughTheJpegBesideIt()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user