Make lens-profile vignetting correction opt-in.

Applying a profile used to enable distortion, CA and vignetting together,
and the flat-field gain lifts the already tone-mapped corners above the
frame centre, over-exposing the edges. Vignetting now defaults off when a
profile is applied or restored from a camera default, and only turns on
when a profile explicitly stored vignetting: true.
This commit is contained in:
2026-11-28 16:21:19 +00:00
parent b884616889
commit be8cf3c88a
4 changed files with 30 additions and 3 deletions
+17
View File
@@ -1,4 +1,5 @@
import { describe, expect, it } from 'vitest';
import { normalizeEdits } from './edits';
import { defaultForMeta, type CameraLensDefault } from './lensDefaults';
import type { LensProfile } from '../types';
@@ -64,4 +65,20 @@ describe('camera-lens default selection', () => {
).toBe(newer);
});
it('leaves the vignetting correction off unless the profile asked for it', () => {
// Older saved profiles carry no corrections block at all; the flat-field
// gain would brighten the corners past the frame centre if it defaulted on.
const legacy = normalizeEdits({ lens: { maker: 'Nikon', model: 'Nikkor 50mm', crop: 1 } } as never);
expect(legacy.lens?.corrections).toEqual({ distortion: true, tca: true, vignetting: false });
const optedIn = normalizeEdits({
lens: {
maker: 'Nikon',
model: 'Nikkor 50mm',
crop: 1,
corrections: { distortion: true, tca: true, vignetting: true },
},
} as never);
expect(optedIn.lens?.corrections.vignetting).toBe(true);
});
});