Apply a camera profile to every raw from the same camera body

A DCP matrix describes the sensor, so a profile chosen for one frame belongs to
all camera-native raws from that body; the panel offers the bulk apply when the
library holds more photos than the one on screen.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
2026-11-28 05:49:47 +00:00
parent 749047ae9e
commit d4cce4e001
4 changed files with 100 additions and 1 deletions
+26 -1
View File
@@ -2211,8 +2211,17 @@ export function CameraProfilePanel({
photo,
set,
cameraNative = false,
}: PanelSetProps & { cameraNative?: boolean }) {
cameraPhotoCount = 0,
onApplyToCamera,
}: PanelSetProps & {
cameraNative?: boolean;
/** Camera-native raws from this body, including the photo on screen. */
cameraPhotoCount?: number;
/** Apply the current profile to every photo from this camera body. */
onApplyToCamera?: (profile: { name: string; matrix: number[] }) => boolean | void;
}) {
const [error, setError] = useState<string | null>(null);
const [appliedAll, setAppliedAll] = useState<number | null>(null);
const profile = edits.cameraProfile;
const camera = photo.meta?.camera ?? '';
// Saved per camera body: the matrix describes the sensor, so every frame from
@@ -2291,6 +2300,22 @@ export function CameraProfilePanel({
</select>
</label>
)}
{profile && onApplyToCamera && cameraPhotoCount > 1 && (
<button
className="btn ghost small"
onClick={() => {
const done = onApplyToCamera({ name: profile.name, matrix: profile.matrix });
if (done !== false) setAppliedAll(cameraPhotoCount);
}}
>
Apply “{profile.name}” to {cameraPhotoCount} photos
</button>
)}
{appliedAll !== null && (
<p className="muted small panel-hint">
Applied to {appliedAll} photos from this camera.
</p>
)}
{applied && (
<button
className="btn ghost small"