fix(studio): stop the session from serving a frame an older build developed
A RAW was parked in OPFS whole and its develop kept in the session too, so a
reload painted the stored JPEG and never went back to the sensor. That makes a
session outlive the engine that filled it: 2e36acd fixed the Olympus ORF's
colour — measured against the file's own preview, mean 167.0,163.9,137.7
against the preview's 167.0,164.8,138.6 — and a browser that had opened the ORF
before the fix kept painting the olive develop, which is what "the fix is
deployed and it still opens olive" was.
The RAW is in OPFS either way, so the RAW branch now clears the session slot
instead of filling it (forgetPhoto) and the reload develops the parked sensor
data again (App.tsx:767). Measured in Chromium against the deployed bundle:
after a drop the session holds no photo, and a reload re-develops the parked
RAW to the same 1600x1197 frame, mean 167.3,164.2,138. The cost is one develop
per reload; the comment names the build stamp that would lift it.
This commit is contained in:
@@ -1111,12 +1111,20 @@ export function Workspace() {
|
|||||||
const bytes = await fileToBytes(file);
|
const bytes = await fileToBytes(file);
|
||||||
if (isRawName(file.name)) {
|
if (isRawName(file.name)) {
|
||||||
// A camera RAW: parked in OPFS whole, developed to the JPEG the studio
|
// A camera RAW: parked in OPFS whole, developed to the JPEG the studio
|
||||||
// works on, and remembered in that same shape by the session — so the
|
// works on. The developed JPEG is deliberately NOT the session's copy:
|
||||||
// 30MB is read once, not once per reload.
|
// it is this build's reading of the sensor, and a session keeps it
|
||||||
|
// across reloads — so the next build's colour fix would never reach a
|
||||||
|
// frame already open, which is exactly how a fixed develop kept opening
|
||||||
|
// olive. The RAW is in OPFS either way, so the reload re-develops it
|
||||||
|
// (a few seconds) and always opens at the current engine's colour; the
|
||||||
|
// session's slot is cleared rather than left holding an older photo.
|
||||||
|
//
|
||||||
|
// ponytail: the reload pays one develop. Stamp the session copy with
|
||||||
|
// the build and keep it while the stamp holds, if that ever hurts.
|
||||||
await storeRaw(bytes, file.name);
|
await storeRaw(bytes, file.name);
|
||||||
const jpeg = await developRaw(bytes);
|
const jpeg = await developRaw(bytes);
|
||||||
await adoptPhoto(jpeg, file.name, new Blob([jpeg as BlobPart], { type: 'image/jpeg' }), false, bytes);
|
await adoptPhoto(jpeg, file.name, new Blob([jpeg as BlobPart], { type: 'image/jpeg' }), false, bytes);
|
||||||
void savePhoto(file.name, jpeg);
|
void forgetPhoto();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await clearRaw();
|
await clearRaw();
|
||||||
|
|||||||
Reference in New Issue
Block a user