feat(editor): visual crop, rotate/mirror/flip/straighten, colour looks (owner review 1 phase 4) (#26)
CI / Build and test (push) Successful in 8m19s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 12m9s
CI / PostgreSQL 16 integration (push) Successful in 7m49s
CI / PostgreSQL 17 integration (push) Successful in 7m19s
CI / Docker image (push) Successful in 46s
Release / Server image (push) Successful in 1m14s

Owner review 1 R5 + R6. Camera rotation, mirror, flip, straighten and crop handles locked to the output; an Exposure Look group; Export output size ("proportions win"); settings format 2 with older-node gates. Also fixes project text and hashes differing between Windows and Linux.

Closes #19
Closes #20

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 #26.
This commit is contained in:
Alby96andClaude Opus 5.5 authored and Alby96 committed 2026-11-05 01:09:09 +01:00
1 parent db389a54f2
commit 188b2c2e55
355 files changed
+10549 -1061

No files matched your search

@@ -1,3 +1,4 @@
using Chronos.Core.Export;
using Chronos.Core.Imaging;
using Chronos.Core.Video;
using Chronos.Core.Windows.MediaFoundation;
@@ -143,6 +144,62 @@ public sealed class MediaFoundationEncoderTests(TestContext context)
Assert.Equal(60, report.FrameCount);
}
/// <summary>
/// Owner review 1, phase 4: 4K at 9:16 is 2160×3840. Each H.264 encoder of this machine is asked for portrait UHD and
/// its landscape twin: none takes one and refuses the other, so the announced limits are a long edge × short edge
/// (<see cref="EncoderSelector.Takes"/>), and portrait UHD is announced wherever landscape UHD is. Encoders that refuse
/// both (Microsoft's DX12 encoder on some GPUs) are left to the provider, which then opens the next one.
/// </summary>
[Test]
[WindowsOnly]
[Timeout(180_000)]
public void PortraitUhdH264EncodesWhereLandscapeDoes()
{
RequireMediaFoundation();
var provider = new MediaFoundationEncoderProvider();
var h264 = provider.Capabilities.Where(c => c.Codec == VideoCodec.H264).ToList();
if (h264.Count == 0) TestContext.Skip("No H.264 encoder on this machine");
foreach (var capability in h264)
{
var (portrait, landscape) = (Accepts(capability, 2160, 3840), Accepts(capability, 3840, 2160));
Assert.Equal(landscape, portrait, $"{capability.Name} takes portrait UHD as it takes landscape UHD");
Assert.True(EncoderSelector.Takes(capability, 2160, 3840), $"{capability.Name} announces portrait UHD");
if (!capability.Hardware) Assert.False(EncoderSelector.Takes(capability, 2400, 3840), $"{capability.Name}: the short edge is over the software limit");
}
var request = Settings(Path.Combine(context.CreateTempDirectory(), "portrait.mp4"), VideoCodec.H264, 8);
Assert.Equal(provider.CanEncode(request with { Width = 3840, Height = 2160 }), provider.CanEncode(request with { Width = 2160, Height = 3840 }));
bool Accepts(EncoderCapability capability, int width, int height)
{
var settings = Settings(Path.Combine(context.CreateTempDirectory(), $"{width}x{height}.mp4"), VideoCodec.H264, 8) with
{
Width = width,
Height = height,
EncoderName = capability.Name,
PreferHardware = capability.Hardware,
BitRate = 20_000_000,
};
try
{
using (var session = provider.Open(settings))
{
using var frame = new ImageBuffer(width, height);
for (var c = 0; c < 3; c++) frame.Plane(c).Fill(0.25f);
for (var f = 0; f < 3; f++) session.WriteFrame(frame, Frame30);
session.Complete();
}
var report = Mp4Inspector.Inspect(settings.OutputPath);
context.Log($"{capability.Name} {width}×{height}: {report}");
return report.IsValid && (report.Width, report.Height) == (width, height);
}
catch (NotSupportedException ex)
{
context.Log($"{capability.Name} {width}×{height}: refused ({ex.InnerException?.Message ?? ex.Message})");
return false;
}
}
}
[Test]
[WindowsOnly]
[Timeout(60_000)]