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
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:
1 parent
db389a54f2
commit
188b2c2e55
355 files changed
+10549
-1061
No files matched your search
@@ -91,6 +91,21 @@ public abstract class ProjectServiceTests(TestContext context) : DatabaseTest(co
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <paramref name="version"/> as a build on the other OS wrote it before every build wrote LF: its text with the other
|
||||
/// line ends (CRLF for LF, LF for CRLF), hashed as such. Flipped, not made CRLF, so a test means the same on every OS.
|
||||
/// </summary>
|
||||
internal static ProjectVersion Foreign(ProjectVersion version)
|
||||
{
|
||||
var text = Foreign(version.SettingsJson);
|
||||
return version with { SettingsJson = text, ContentHash = ProjectContent.Hash(text) };
|
||||
}
|
||||
|
||||
/// <summary><paramref name="text"/> with the other line ends: LF where it has CRLF, CRLF where it has LF.</summary>
|
||||
internal static string Foreign(string text) => text.Contains("\r\n", StringComparison.Ordinal)
|
||||
? text.Replace("\r\n", "\n", StringComparison.Ordinal)
|
||||
: text.Replace("\n", "\r\n", StringComparison.Ordinal);
|
||||
|
||||
[Test]
|
||||
public async Task MainIsMadeFromTheSequenceSettingsWithItsPositionsParkedByPhoto()
|
||||
{
|
||||
@@ -195,6 +210,33 @@ public abstract class ProjectServiceTests(TestContext context) : DatabaseTest(co
|
||||
Assert.Equal(2, (await projects.HeadAsync(main.Id, fx.Ct)).Number);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task PushesFromAnotherOsAreNoOutsideChange()
|
||||
{
|
||||
var fx = await FixtureAsync();
|
||||
// Hashed photos: only line ends tell the texts apart (no photo named anew to compare by).
|
||||
var (sequence, frames) = await UploadedAsync(fx, 4);
|
||||
Assert.True(frames.All(f => f.Sha256 is { Length: 64 }));
|
||||
var projects = fx.Service.Projects;
|
||||
var main = await projects.MainAsync(sequence.Id, fx.Ct);
|
||||
var first = await projects.HeadAsync(main.Id, fx.Ct);
|
||||
|
||||
// A Windows desktop of a build before pushes to this home: CRLF versions on a home writing LF (and the reverse on Linux).
|
||||
var second = Foreign(Draft(first, new ProjectSettings { ExcludedFrames = [1], HeroFrame = 2 }, frames));
|
||||
Assert.Equal(PushOutcome.Stored, (await projects.PushAsync(main.Id, second, fx.Ct)).Outcome);
|
||||
var third = Foreign(Draft(second, new ProjectSettings { ExcludedFrames = [1, 3], Exposure = new ExposureSettings { ExposureOffsetEv = 0.4 } }, frames));
|
||||
Assert.Equal(PushOutcome.Stored, (await projects.PushAsync(main.Id, third, fx.Ct)).Outcome);
|
||||
Assert.Equal(PushOutcome.AlreadyStored, (await projects.PushAsync(main.Id, third, fx.Ct)).Outcome);
|
||||
|
||||
// The editor's old path writes the same settings again: the mirror of the third version, no outside change.
|
||||
await WriteSettingsAsync(fx, sequence.Id, ProjectSettings.FromJson(ProjectContent.Place(third.SettingsJson, Photos(frames))));
|
||||
var head = await projects.HeadAsync(main.Id, fx.Ct);
|
||||
Assert.Equal((third.Id, 3), (head.Id, head.Number));
|
||||
Assert.Equal(third.ContentHash, head.ContentHash);
|
||||
Assert.SequenceEqual([ProjectVersionKind.Commit, ProjectVersionKind.Commit, ProjectVersionKind.Imported],
|
||||
(await projects.HistoryAsync(main.Id, cancellationToken: fx.Ct)).Select(v => v.Kind));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task SettingsAnotherPathWritesBecomeAnExternalVersionOfMain()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user