fix(studio): let a session an older build filled heal on the next open
The previous frame stops a session being written, not read: the browser that reported this still holds the olive develop under the ORF's name, and a reload would paint it once more. A session photo named like a RAW is that develop and nothing else — the RAW branch writes none — so the restore path now reads the parked RAW first and only falls back to such a copy when there is nothing parked to develop. An ordinary photo's name is left alone. Measured in Chromium on the built bundle, with the session poisoned and the ORF parked: a copy named POISON.ORF opens as the re-developed 1600x1197 frame (mean 167.3,164.2,138) and a copy named POISON.jpg opens as itself.
This commit is contained in:
@@ -761,11 +761,17 @@ export function Workspace() {
|
|||||||
loadPhoto()
|
loadPhoto()
|
||||||
.then(async (photo) => {
|
.then(async (photo) => {
|
||||||
if (!alive) return;
|
if (!alive) return;
|
||||||
if (photo) {
|
const show = (row: { name: string; bytes: Uint8Array }) =>
|
||||||
return adoptPhoto(photo.bytes, photo.name, new Blob([photo.bytes as BlobPart], { type: 'image/jpeg' }), true);
|
adoptPhoto(row.bytes, row.name, new Blob([row.bytes as BlobPart], { type: 'image/jpeg' }), true);
|
||||||
}
|
// A session photo named like a RAW is a develop an older build left
|
||||||
|
// there — the RAW branch writes none any more — and it carries that
|
||||||
|
// build's colour, which is how a fixed develop kept opening olive. The
|
||||||
|
// parked RAW is the copy that is not stale, so it is read first; the
|
||||||
|
// session's is only shown when nothing is parked to develop.
|
||||||
|
if (photo && !isRawName(photo.name)) return show(photo);
|
||||||
const parked = await readRaw();
|
const parked = await readRaw();
|
||||||
if (!alive || !parked) return;
|
if (!alive) return;
|
||||||
|
if (!parked) return photo ? show(photo) : undefined;
|
||||||
const jpeg = await developRaw(parked.bytes);
|
const jpeg = await developRaw(parked.bytes);
|
||||||
await adoptPhoto(jpeg, parked.name, new Blob([jpeg as BlobPart], { type: 'image/jpeg' }), true, parked.bytes);
|
await adoptPhoto(jpeg, parked.name, new Blob([jpeg as BlobPart], { type: 'image/jpeg' }), true, parked.bytes);
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user