41 Commits

Author SHA1 Message Date
bhursey 41147b6439 Set the package version to 0.5.4.1
CI / verify (push) Has been cancelled
The 0.5.4.1 artifacts report their version from package.json, so the tag they
were built from has to carry it.
2026-12-02 17:37:26 +00:00
bhursey 07cd913c8b Record the two-wide raw import in the 0.5.4.1 notes
CI / verify (push) Has been cancelled
The reissued 0.5.4.1 artifacts no longer import raws four at a time, so the
release notes and the measurements behind the change belong in that section.
2026-12-02 17:36:48 +00:00
bhursey 3b288bc03b Republish the 0.5.4.1 artifacts with the two-wide raw import
Windows setup, portable zip, Ubuntu tar.gz and deb rebuilt from bd90264, with
the checksums the release page now lists.
2026-12-02 17:31:20 +00:00
bhursey bd90264c3c Hold raw imports to two files in flight
A raw upload request stays open for the whole decode, and four X-Trans frames
decoded together took 87-102 s each on a 12-core server against 28 s alone, so
every request outlived a 60 s reverse-proxy read timeout and came back as 504
while the server was still working. Two-wide keeps a request near 45 s and
finishes a 16-file batch sooner as well; Bayer files give up a little.
2026-12-02 17:21:14 +00:00
bhursey 8f23e96b92 Republish the 0.5.4.1 Windows build with the launcher fix
The setup and portable zip are rebuilt from the tree that reads the machine
architecture instead of the process's, so the finish-page launch no longer
refuses 64-bit Windows. Checksums updated for both artifacts.
2026-12-02 16:31:03 +00:00
bhursey 5f15b528f4 Read the machine architecture, not the process's, in the launcher
The platform check read PROCESSOR_ARCHITECTURE, which a WOW64 process reports as
x86. Starting Luminary from the setup's finish page therefore stopped on 64-bit
Windows with "Luminary ships a 64-bit runtime; this PC reports 'x86'". The
machine architecture now comes from PROCESSOR_ARCHITEW6432 and
Is64BitOperatingSystem.
2026-12-02 16:23:12 +00:00
bhursey 5b4b49200c Grade preset previews over the current edit and print the look's cast
Preset tiles were rendered from a reset grade, so correcting a frame and then
browsing looks showed thumbnails that no longer matched the canvas, and the
settle timer was keyed on object identity so the rail rarely caught up at all.
Tiles now render the whole grade a moment after it settles, keep their previous
images while the batch re-renders, and the Light panel shows the applied look's
cast and the final white balance under Temp and Tint.
2026-12-02 05:27:12 +00:00
bhursey 4d7a123d49 Start Luminary from the setup's finish page through the shell
MUI2 runs the finish-page target with Exec, which passes the path straight to
CreateProcess. The 0.5.4.1 bundle ships the PowerShell launcher, so that target
is Luminary.vbs and the ticked "Start Luminary" box closed the installer without
opening anything. ExecShell goes through the shell, so the .exe, .vbs and .cmd
all start. The 0.5.4.1 setup is rebuilt from the same staged bundle, so the
portable zip keeps its hash.
2026-12-02 04:52:57 +00:00
bhursey df447794ea Match the 0.5.4.1 notes to the build that shipped
The entry still described raws importing two at a time and claimed the
build was never published, and it listed the offline audit and object
removal, which are not in the artifacts. Record the four-wide window, the
worker-thread colour pass, the published links and the new hashes; move
the unshipped work to its own section.
2026-12-02 04:16:11 +00:00
bhursey d24cbf26b8 Run the camera-to-sRGB pass on a worker thread
At four parallel imports the synchronous colour conversion was the widest
serial section left in the pipeline. The frame buffers now live on
SharedArrayBuffer, so a worker writes the same memory the encoder reads
and the main thread is free for the decoder pool and zlib.
2026-12-02 04:02:33 +00:00
bhursey 7f0838156b Write ratings, keywords, hierarchy and IPTC to XMP
Sidecars and JPEG exports now carry xmp:Rating, xmp:Label, dc:subject and
lr:hierarchicalSubject plus the IPTC core, and importing a sidecar applies its
cataloguing fields independently of its develop settings. Hierarchical keywords
keep leaf terms in the flat list, so search and filters are unchanged.
2026-12-02 03:30:57 +00:00
bhursey fa0a7e64ef Speed up raw imports and add a per-import 16-bit toggle
Import raws four at a time to match the decoder pool, compress the 16-bit
sidecar with RLE on the libuv pool, and demosaic X-Trans files in a single
Markesteijn pass so Fuji imports no longer queue into decode timeouts. The
import dialog now offers 16-bit (default) or 8-bit per import, sent as
`?sidecar=0`, and the camera thumbnail and embedded-preview fallbacks no
longer drop to 8-bit samples or store a 0x0 photo.
2026-12-02 03:25:53 +00:00
bhursey ea7b5b846c Install remote dependencies before deploying builds
CI / verify (push) Has been cancelled
The rsync excludes node_modules, so a new dependency in the lockfile made the
remote build fail until someone installed it by hand. Run npm ci on the server
first and stop with the installer's exit code if it fails.
2026-12-01 15:27:17 +00:00
bhursey e7e1d16242 Build the 0.5.4 Windows bundles
Zip and installer carry the JXL wasm codec, the regenerated guide and the
native WebView2 window.
2026-12-01 15:13:20 +00:00
bhursey 68f074452c Build the 0.5.4 Linux bundles
Linux smoke test passes, including the offline import path.
2026-12-01 14:58:33 +00:00
bhursey c5d5d6598d Release 0.5.4 with JPEG XL export
Bumps the version, moves the changelog entry out of Unreleased, updates the
guide to version 1.3 and regenerates its PDF, and records the security audit
in the release notes.
2026-12-01 14:56:40 +00:00
bhursey 9ea4c03d65 Rebuild the Windows bundles with JPEG XL export
The zip and installer now carry the JXL wasm codec and the regenerated user
guide, with the native WebView2 window unchanged.
2026-12-01 14:50:10 +00:00
bhursey 326282476f Rebuild the Linux bundles with JPEG XL export
The tar and deb now carry the JXL wasm codec and the regenerated user guide.
2026-12-01 14:44:41 +00:00
bhursey 3759b47bc6 Add JPEG XL export with a lossless option
Export now offers JPEG XL (8-bit sRGB) next to JPEG, PNG, WebP and 16-bit
TIFF, encoded on-device by libjxl compiled to WebAssembly so the export stays
offline. The codec loads only when a JXL is chosen, the quality slider applies
to the lossy mode, and a lossless switch disables it. The user guide and
changelog describe the format and its current limits (no ICC or XMP yet).

Also adds SECURITY-AUDIT.md with the dependency scan and the review of the
server's trust boundaries.
2026-12-01 14:43:29 +00:00
bhursey 8b309d9cad Publish the 0.5.3.1 Windows artifact checksums 2026-12-01 13:31:18 +00:00
bhursey 8fba0835b9 Publish the 0.5.3.1 Linux artifact checksums 2026-12-01 13:26:05 +00:00
bhursey 83322d9b50 Describe the desktop app and the local engine in the user guide
The guide still read as a team-server product: raws were "sent to the server"
and the Windows chapter described the old Program Files install. It now explains
the local engine, the native window, offline start and the per-user installer,
and the PDF is regenerated from it.
2026-12-01 13:25:05 +00:00
bhursey 7282d2d960 Publish the 0.5.3.1 Windows artifact checksums 2026-12-01 13:20:25 +00:00
bhursey 5cc8867878 Publish the 0.5.3.1 Linux artifact checksums 2026-12-01 13:14:06 +00:00
bhursey 93168de914 Document the 0.5.3.1 desktop release and add a changelog
The README described only the browser and team-server modes, so the desktop
bundles, their offline behaviour and the native Windows window were undocumented,
and there was no changelog to point testers at.
2026-12-01 13:12:50 +00:00
bhursey 970fa18d86 Publish the 0.5.3.1 Windows artifact checksums 2026-12-01 13:09:36 +00:00
bhursey a4aa43461f Ship the native app window and start from Luminary.exe
A tester saw Edge open and start syncing his Microsoft account; the bundle
carried no WebView2 host, so the launcher fell back to Edge's app mode. The
window host is now built and shipped, the fallback prefers Chrome over Edge, and
the installer's Start Luminary, shortcuts and start-at-login use Luminary.exe so
they no longer depend on Windows Script Host, which policy can disable.
2026-12-01 13:04:37 +00:00
bhursey 9aff70bd63 Publish the 0.5.3.1 Windows artifact checksums 2026-12-01 12:53:13 +00:00
bhursey bbcf2efda6 Publish the 0.5.3.1 Linux artifact checksums 2026-12-01 12:48:29 +00:00
bhursey f1f96f1f10 Check offline imports in the smoke tests
With the network down, a request that goes through the system proxy cannot
reach 127.0.0.1, which is how a healthy engine looked unreachable. Both smoke
tests now start under a proxy pointed at a black hole, import a TIFF through the
real upload and preview path, and assert the launcher and app window bypass
proxies.
2026-12-01 12:47:06 +00:00
bhursey 0525e496e0 Say local engine in the import dialog and the offline errors
A tester saw "raw files are demosaiced by the server" and read it as an upload
to someone else's machine. In desktop mode the decoder runs in the bundle on
this PC, so the import dialog, the join page and the "cannot reach" error now
say local engine, while team-server installs keep the server wording.
2026-12-01 12:45:04 +00:00
bhursey 91ce88a51f Publish the 0.5.3.1 Windows artifact checksums 2026-12-01 12:38:15 +00:00
bhursey b675fa8fea Publish the 0.5.3.1 Linux artifact checksums 2026-12-01 12:32:31 +00:00
bhursey 2d3b3bb665 Call the local process the local engine on Linux and macOS
The Windows launcher already avoids the word "server" in what users read, and
the macOS health probe now uses curl --noproxy so starting offline cannot stall
on a system proxy. The app windows also ignore proxies, which only ever point
at 127.0.0.1.
2026-12-01 12:31:10 +00:00
bhursey b271037c54 Publish the 0.5.3.1 artifact checksums 2026-12-01 12:24:37 +00:00
bhursey afdbeb4283 Say background service instead of network service
"Network service" still reads as something that talks to the internet. The
generated bundle README now calls the local engine a background service on this
PC and says a connection is not needed.
2026-12-01 12:24:37 +00:00
bhursey e7ecd712e2 Create the NSIS cache directory on a fresh build
--installer unpacks a private NSIS into <out>/tools/nsis, but dpkg-deb creates
only the leaf directory, so the build failed whenever --out had no tools/ yet.
The parent is created first.
2026-12-01 12:24:37 +00:00
bhursey 7eac7e7ecf Release 0.5.3.1
Ships the offline-start fix for the Windows launcher and the before/after split.
2026-12-01 12:14:31 +00:00
bhursey 7cad990c8e Call the local process the local engine, not a server
Windows users read "server" as a network service and asked whether the app
phones home, even though the bundle only ever talks to 127.0.0.1. The launcher
dialogs, the help text, the Stop shortcut and the bundle README now call it the
local engine and say plainly that it is a background process on this PC.
2026-12-01 12:14:31 +00:00
bhursey a7ba0d2e87 Start the Windows bundle when the network is disconnected
The launcher asked /api/health through Invoke-WebRequest, which resolves the
system proxy or PAC script before it looks at the URL; with no network every
probe timed out and the launcher killed a healthy local process after two
minutes and reported that Luminary had not started. Both launchers now probe
127.0.0.1 over a raw TCP socket, which uses no proxy, DNS or certificate store,
and the app window is started with --no-proxy-server.
2026-12-01 12:13:54 +00:00
bhursey 7aef2e37bf Add a before/after split with a draggable handle
The Develop preview can put the untouched source left of a drag line and the
edited frame right of it. Both halves come from one render on one view, so they
line up exactly, and the split shares its handle behaviour with the lens
correction split. The headless render check now asserts that each half shows its
own edit.
2026-12-01 12:13:54 +00:00
66 changed files with 2896 additions and 339 deletions
+209
View File
@@ -0,0 +1,209 @@
# Changelog
Dated release notes, newest first. The same entries are summarised on the product
page; this file is the complete list.
## Unreleased
Finished in the tree, not part of any build yet.
- **Film looks and presets grade over your white balance.** Applying a look used
to overwrite Temp and Tint with the stock's own numbers, so a frame that had
been corrected came back with the look's cast on an uncorrected image. The
cast is now kept apart from the sliders and applied after your correction; it
layers on instead of replacing it, and switching looks swaps the cast rather
than stacking them. Every preset tile now renders over the photo's whole
current grade — exposure, tone, colour, crop and white balance — so a
thumbnail is what the click produces, and the rail keeps its images while the
tiles catch up. The Light panel reports the applied look's cast and the final
balance the photo is graded at, under Temp and Tint.
- **An audited offline guarantee.** A content security policy restricts connections to
the app's own origin, `npm run check:offline` fails the build if any shipped file
reaches for another host, and [docs/OFFLINE-GUARANTEE.md](docs/OFFLINE-GUARANTEE.md)
states what the app does and does not contact.
- **Object removal on the server** (`POST /api/photos/:id/inpaint`, LaMa, Apache-2.0,
bundled weights, no network). The routes and the cached-render store are in place;
there is no editor control for it yet, so nothing changes for a user.
## 0.5.4.1 — 2 December 2026
Windows patch on 0.5.4 for the Fujifilm import report, plus the metadata work that was
finished after 0.5.4. The installer and portable zip are linked from the download page
alongside 0.5.4; macOS remains at 0.5.1.
### Fixed
- **The launcher no longer rejects a 64-bit PC started from a 32-bit parent.**
The platform check read `PROCESSOR_ARCHITECTURE`, which a WOW64 process reports
as `x86`. Starting Luminary from the setup's own finish page (a 32-bit NSIS
process) therefore stopped at "Luminary ships a 64-bit runtime; this PC reports
'x86'" on ordinary 64-bit Windows. It now reads the machine architecture from
`PROCESSOR_ARCHITEW6432` and `Is64BitOperatingSystem`, so launch context no
longer changes the answer.
- **The setup now starts Luminary when "Start Luminary" is ticked.** The finish
page ran the launcher with NSIS `Exec`, which passes the path straight to
`CreateProcess`. This build ships the PowerShell launcher, so the target was
`Luminary.vbs`, a script `CreateProcess` cannot start: the box was ticked, the
installer closed and no window opened. It now goes through the shell
(`ExecShell`), which starts the `.exe`, `.vbs` and `.cmd` alike. The 0.5.4.1
setup was rebuilt from the same staged bundle; the zip is unchanged.
- **Fujifilm imports are about five times faster.** LibRaw was asked for three
Markesteijn demosaic passes on X-Trans sensors; on a 40 MP X-T5 frame that took
**49.9 s**, and one pass takes **8.8 s** with no visible difference in the 6000 px
proxy the editor works on. X-Trans files are detected from the camera make and model
after the cheap header read, and demosaic at one pass
(`LUMINARY_RAW_XTRANS_QUALITY`, 1–3); Bayer files keep their previous setting. A full
40 MP decode fell from 44–50 s to about 20 s including the 16-bit sidecar.
- **A raw can no longer be saved as an unopenable 0×0 photo.** When decoding failed or
timed out, the fallback scanned the container for a JPEG and could stop at a nested
EXIF thumbnail's end marker, then store the truncated bytes anyway, with width and
height 0. It now tries every embedded candidate largest-first and keeps the first one
that actually decodes, so a hard file imports from the camera's own preview instead.
The import no longer trusts a server-reported `0` for a dimension either.
- **A wide selection no longer fails in waves.** The decode timeout used to start when
the request arrived and therefore counted time spent queued for a worker, and a
timed-out decoder was returned to the pool while still busy with the abandoned job —
four parallel Fuji files produced four timeouts and four broken previews. The clock now
starts when a worker picks the job up, and a timed-out worker is discarded.
- **Progress starts with the import.** The bar was only updated when a file finished, so
a 16-file Fuji import showed nothing for the first minute and then jumped to 4/16. It
now reports before each file starts, names the file, and says how many are still
waiting (`7 / 16 · 9 waiting · DSCF1024.RAF`).
- **The 16-bit sidecar no longer blocks previews.** Its PNG is compressed off the main
thread, so the editor stays responsive while an import runs.
### Changed
- **Raws import two at a time.** A raw upload request stays open for the whole decode,
and four 40 MP X-T5 frames decoded together took 87–102 s each on a 12-core server
against 28.4 s alone — long enough for a 60 s reverse-proxy read timeout to answer 504
while the server was still working, which reads as the last files of a batch failing.
Two-wide holds a request near 45 s and finishes sixteen files sooner (~360 s against
~410 s); Bayer files give up a little. Camera JPEGs and PNGs still import four at a
time, because the browser decodes those itself. This build reissues 0.5.4.1 with the
window reduced from four; the setup, zip, tar.gz and .deb were rebuilt for it.
- **The camera-to-sRGB pass runs on a worker thread.** It was the widest synchronous
section left in a decode, and four parallel imports queued behind it on the event
loop. The frame buffers are now allocated on `SharedArrayBuffer`, so a worker writes
the same memory the encoder reads and nothing is copied across the boundary; frames
that arrive unshared fall back to the previous synchronous path.
### Also in this build (finished after 0.5.4)
- **Hierarchical keywords, IPTC and portable ratings.** Keywords can be grouped as paths
(`Wedding > Ceremony > Rings`) with suggestions from what is already in the catalog,
the IPTC fields are editable in the metadata panel, and star ratings and colour labels
are written to XMP (`xmp:Rating`, `xmp:Label`) alongside `dc:subject` and
`lr:hierarchicalSubject`, so they survive a round trip through Lightroom or Bridge.
### Notes
- Windows only. `Luminary-0.5.4.1-win-x64-setup.exe` and the portable zip are built
locally and published as links on the download page, with their SHA-256 sums in
`windows/releases/SHA256SUMS.txt`.
## 0.5.4 — 1 December 2026
Windows and Linux bundles rebuilt with the new export format. macOS remains at
0.5.1 because it has to be built on a Mac.
### Added
- **JPEG XL export.** The export dialog offers JPEG XL alongside JPEG, PNG, WebP and
16-bit TIFF, with the quality slider and a lossless switch. Files are 8-bit sRGB,
encoded by libjxl compiled to WebAssembly in the app itself, so the export stays
offline and nothing is uploaded. The codec loads only when a JXL is exported. No
ICC profile or XMP metadata is embedded yet, and 16-bit JXL waits on a float-input
encoder build. The codec is Apache-2.0 and makes no network requests.
### Security
- **Static security audit published** as [SECURITY-AUDIT.md](SECURITY-AUDIT.md):
dependency scan plus a review of authentication, authorisation, uploads, path
handling, secrets at rest and outbound requests. No exploitable issue was found
in code that ships; the two production advisories are a transitive `adm-zip`
inside `onnxruntime-node` that this application cannot reach.
## 0.5.3.1 — 1 December 2026
Windows and Linux bundles rebuilt. macOS stays at 0.5.1: the app has to be built on
a Mac with the Xcode command line tools, and no Mac was available.
### Added
- **Before/after split** in Develop: a draggable handle compares the edited frame
with the untouched source, alongside the existing hold-`\` full-frame preview.
- **Native Windows window.** Windows bundles now ship `LuminaryWindow.exe`, a
WebView2 window host built from `windows/launcher/webview2` (.NET 8, self-contained
win-x64). The app opens its own window: no browser process, no Edge profile, no
Microsoft account and no settings sync. If the WebView2 runtime is missing, the
window says so and links to the one-time download.
- **Offline import checks in both smoke tests.** `linux/SMOKE-LINUX.sh` and
`windows/SMOKE-WINDOWS.ps1` now start under a proxy pointed at a black hole, import
a TIFF through the real upload → decode → preview path, and assert the launcher and
app window bypass proxies, so a bundle cannot regress to proxy-routed loopback
requests.
### Changed
- **The local process is called the local engine**, not "the server", everywhere a
user reads it: the Windows, Linux and macOS launchers, the import dialog, the join
page and the "cannot reach" error. Team-server installs keep the server wording.
- The import dialog states that raws are demosaiced by the local engine on this PC and
that nothing leaves the computer, instead of implying an upload.
- The Windows fallback app window prefers Chrome over Edge.
- The installer's **Start Luminary** tick, the Start-menu and desktop shortcuts and
start-at-login run `Luminary.exe` instead of `Luminary.vbs`, so they no longer depend
on Windows Script Host — which group policy can disable, leaving the tick silently
doing nothing. `.vbs` and `.cmd` remain fallbacks for bundles without the native
launcher.
- Downloads describe the network need as `Network: not needed` and the process as a
background service on this PC.
### Fixed
- **The Windows bundle starts with the network disconnected.** The launcher waited for
`/api/health` with `Invoke-WebRequest`, which resolves the system proxy/PAC before
the URL; offline, every probe failed and the launcher killed a healthy engine after
120 seconds. The probe is now a raw TCP request to `127.0.0.1`, the Go launcher uses
a loopback-only transport, and app windows start with proxies disabled.
- The macOS launcher probes with `curl --noproxy '*'` for the same reason.
- A fresh Windows build creates the NSIS cache directory before extracting the
compiler, instead of failing on the first run.
### Notes
- macOS 0.5.3.1 is not built yet. On a Mac:
`git pull && node macos/build.mjs --arch universal --node v22.23.5 --publish`.
- Screenshots and the bundled user guide still describe the team-server workflow; they
are being brought in line with the single-user desktop app.
## 0.5.2 — 1 December 2026
- AI denoise offers three models: Guided (fastest), SCUNet (learned, removes the most
grain) and NLM, each cached separately so switching back to one already rendered is
instant.
- The panel reports the stage it is in and, for SCUNet, the tile count while a render
runs instead of leaving a blank spinner.
- The bundles carry the SCUNet weights and ONNX Runtime, so the downloads are larger
than 0.5.1: the Windows setup is 165 MB and the Ubuntu `.deb` is 182 MB.
- The macOS build stays at 0.5.1.
## 0.5.1 — 28 November 2026
- Direct window launches use the PowerShell launcher instead of Windows Script Host,
fixing the direct-launch failure on systems where VBScript is disabled.
- A `.deb` for Ubuntu 22.04 and 24.04 ships alongside the Windows build: same app, same
server, menu entry included.
- A Windows setup exe installs per user with Start-menu shortcuts and keeps the catalog
when uninstalled; the portable ZIP still ships for people who want a folder.
## 0.5.0 — 28 November 2026
- First public beta: browser library, raw editor and Windows app.
- Directly opening the Windows window hands off to the launcher, so desktop mode stays
signed in.
- Masks, lens correction, print layouts and batch export.
- Client galleries with picks, comments and change requests.
- Optional team server for accounts, shared storage and admin.
- Refreshed product site and a 39-page user guide with current screenshots.
+101 -7
View File
@@ -11,8 +11,9 @@ RAW decoding, client galleries, storage quotas and email notifications.
| Mode | How to run | Catalog storage | RAW files | Accounts / galleries | | Mode | How to run | Catalog storage | RAW files | Accounts / galleries |
| --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- |
| Browser only | `npm run dev` | IndexedDB on this device | No — raw needs the server | No | | Browser only | `npm run dev` | IndexedDB on this device | No — raw needs the local engine | No |
| Team server | `npm run server` + `npm run dev` (or `npm start` behind a build) | SQLite + files under `server/data` | Yes — LibRaw demosaic | Yes | | Team server | `npm run server` + `npm run dev` (or `npm start` behind a build) | SQLite + files under `server/data` | Yes — LibRaw demosaic | Yes |
| Desktop app (Windows, Linux, macOS) | the installed bundle — no npm, no account | SQLite in the app's data folder | Yes — bundled LibRaw | One local admin |
Everything edits the same `Edits` JSON document, so a photo edited locally keeps its Everything edits the same `Edits` JSON document, so a photo edited locally keeps its
look when it is later uploaded to a server workspace. look when it is later uploaded to a server workspace.
@@ -38,8 +39,10 @@ look when it is later uploaded to a server workspace.
- [Detail-preserving denoise](#detail-preserving-denoise) - [Detail-preserving denoise](#detail-preserving-denoise)
- [Lens profiles](#lens-profiles) - [Lens profiles](#lens-profiles)
- [Development workflow](#development-workflow) - [Development workflow](#development-workflow)
- [Desktop bundles](#desktop-bundles)
- [Troubleshooting](#troubleshooting) - [Troubleshooting](#troubleshooting)
- [Limitations](#limitations) - [Limitations](#limitations)
- [Changelog](#changelog)
- [Third-party attribution and licences](#third-party-attribution-and-licences) - [Third-party attribution and licences](#third-party-attribution-and-licences)
--- ---
@@ -140,7 +143,7 @@ with a keyword library and reusable metadata presets. Save the current filters a
order as a smart collection. Virtual copies share the master file but keep independent order as a smart collection. Virtual copies share the master file but keep independent
edits; named snapshots preserve alternative looks. edits; named snapshots preserve alternative looks.
**Export and print.** JPEG, PNG, WebP or uncompressed 16-bit TIFF; quality; resize by **Export and print.** JPEG, PNG, WebP, JPEG XL (8-bit, lossy or lossless) or uncompressed 16-bit TIFF; quality; resize by
long edge or percent; filename template (`{name}`, `{date}`, `{time}`, `{index}`); saved long edge or percent; filename template (`{name}`, `{date}`, `{time}`, `{index}`); saved
export recipes; output sharpening; watermark; XMP metadata embedded in JPEGs; sRGB, export recipes; output sharpening; watermark; XMP metadata embedded in JPEGs; sRGB,
Display P3 or Adobe RGB output with a matching generated ICC profile (JPEG/TIFF); batch Display P3 or Adobe RGB output with a matching generated ICC profile (JPEG/TIFF); batch
@@ -229,9 +232,11 @@ storage, while quotas are stored per account in the database.
| `LUMINARY_INVITE` | *(empty)* | Shared registration code for teammates; personal invite links work without it | | `LUMINARY_INVITE` | *(empty)* | Shared registration code for teammates; personal invite links work without it |
| `LUMINARY_MAX_UPLOAD` | `314572800` (300 MB) | Largest accepted upload, in bytes | | `LUMINARY_MAX_UPLOAD` | `314572800` (300 MB) | Largest accepted upload, in bytes |
| `LUMINARY_RAW_EDGE` | `6000` | Long edge of the editable JPEG proxy made from a raw | | `LUMINARY_RAW_EDGE` | `6000` | Long edge of the editable JPEG proxy made from a raw |
| `LUMINARY_16BIT` | `1` | Also keep the decoded samples as a 16-bit PNG beside the raw proxy; `0` saves the disk and download it costs, at the price of grading an 8-bit source | | `LUMINARY_16BIT` | `1` | Also keep the decoded samples as a 16-bit PNG beside the raw proxy; `0` saves the disk and download it costs, at the price of grading an 8-bit source. The import dialog can also turn it off for a single import |
| `LUMINARY_RAW_WORKERS` | `min(4, cores−1)` | Concurrent LibRaw decoders; each holds a worker and a few hundred MB | | `LUMINARY_RAW_WORKERS` | `min(4, cores−1)` | Concurrent LibRaw decoders; each holds a worker and a few hundred MB |
| `LUMINARY_RAW_IDLE_MS` | `90000` | Idle decoders are disposed after this to release memory | | `LUMINARY_RAW_IDLE_MS` | `90000` | Idle decoders are disposed after this to release memory |
| `LUMINARY_RAW_XTRANS_QUALITY` | `1` | Markesteijn passes for Fujifilm X-Trans files, 1–3. Three passes costs 50 s on a 40 MP frame for detail the 6000 px proxy cannot show |
| `LUMINARY_RAW_TIMEOUT_MS` | `120000` | Ceiling on one demosaic, timed from when a worker starts the job rather than from the request |
| `LUMINARY_DENOISE_WORKERS` | `min(4, cores−1)` | Concurrent detail-denoise jobs (read directly from the environment) | | `LUMINARY_DENOISE_WORKERS` | `min(4, cores−1)` | Concurrent detail-denoise jobs (read directly from the environment) |
| `LUMINARY_QUOTA_BYTES` | `107374182400` (100 GiB) | Default per-account storage allowance | | `LUMINARY_QUOTA_BYTES` | `107374182400` (100 GiB) | Default per-account storage allowance |
| `LUMINARY_QUOTA_WARN_RATIO` | `0.9` | Fraction of the quota that triggers warnings, clamped to 0.5–0.99 | | `LUMINARY_QUOTA_WARN_RATIO` | `0.9` | Fraction of the quota that triggers warnings, clamped to 0.5–0.99 |
@@ -876,7 +881,10 @@ The browser cannot demosaic camera raw, so the server does it during upload:
texture and applies `rgb_cam` in the grade shader, so the grade has 65,536 levels per texture and applies `rgb_cam` in the grade shader, so the grade has 65,536 levels per
channel instead of 256. A photo without a sidecar — one imported before this existed, channel instead of 256. A photo without a sidecar — one imported before this existed,
a non-raw file, or a build with `LUMINARY_16BIT=0` — simply grades the JPEG, so a non-raw file, or a build with `LUMINARY_16BIT=0` — simply grades the JPEG, so
nothing breaks either way. The grid and Compare read the same samples: on first nothing breaks either way. The import dialog offers this as **Import raws at 16-bit**,
checked by default; unchecking it for an import asks the server for the 8-bit path
(`?sidecar=0` on the upload), which decodes the same but skips the second encode and
its disk cost. The grid and Compare read the same samples: on first
request the server writes a camera-native tile the size of the JPEG thumbnail at request the server writes a camera-native tile the size of the JPEG thumbnail at
`previews/<id>.t16.png`, and Compare loads the full sidecar, so a loaded DCP profile `previews/<id>.t16.png`, and Compare loads the full sidecar, so a loaded DCP profile
shows in every view of the photo. Preset previews do the same. shows in every view of the photo. Preset previews do the same.
@@ -902,8 +910,11 @@ same matrix from a DCP `ColorMatrix1` — `inverse(rowNormalise(ColorMatrix · x
— matches LibRaw's `rgb_cam` to 2.2e-5 on a D700 NEF and 2.7e-5 on a 5D Mark II CR2. — matches LibRaw's `rgb_cam` to 2.2e-5 on a D700 NEF and 2.7e-5 on a 5D Mark II CR2.
**Parallel import.** Decoding runs in a bounded pool of LibRaw workers (default **Parallel import.** Decoding runs in a bounded pool of LibRaw workers (default
`min(4, cores−1)`, `LUMINARY_RAW_WORKERS`), and the browser uploads several files at a `min(4, cores−1)`, `LUMINARY_RAW_WORKERS`). The browser keeps four raws in flight to
time. Each instance owns one worker thread; extra jobs queue. Idle instances are match that pool and queues the rest, so the server is never asked for more frames than it
can decode; camera JPEGs also go four at a time, since the browser decodes those itself.
Eight 12 MP NEFs took 20.8 s two at a time and 17.4 s four at a time (8 was 15.8 s, not
worth the extra memory). Each instance owns one worker thread; extra jobs queue. Idle instances are
disposed after `LUMINARY_RAW_IDLE_MS` and recreated on demand, so a burst of imports disposed after `LUMINARY_RAW_IDLE_MS` and recreated on demand, so a burst of imports
does not pin memory forever. A decoder that reports a dead worker is recycled rather does not pin memory forever. A decoder that reports a dead worker is recycled rather
than returned to the pool. Measured on this repo with 8 mixed raws (20 MP average): than returned to the pool. Measured on this repo with 8 mixed raws (20 MP average):
@@ -914,6 +925,17 @@ than returned to the pool. Measured on this repo with 8 mixed raws (20 MP averag
| 4 | 5.2 s | 3.7× | ~2.5 GB | | 4 | 5.2 s | 3.7× | ~2.5 GB |
| 8 | 3.5 s | 5.4× | ~3.5 GB | | 8 | 3.5 s | 5.4× | ~3.5 GB |
Those are Bayer files. Fujifilm X-Trans frames behave differently in this wasm build: four
concurrent 40 MP X-Trans decodes each took ~65 s here against ~9 s on their own, so the
worker pool buys throughput in principle but not latency for that sensor. Two things
mattered more than the pool. LibRaw's default 3-pass Markesteijn demosaic took **49.9 s** on
one X-T5 frame; one pass takes **8.8 s** and is what `LUMINARY_RAW_XTRANS_QUALITY` selects.
And the 45 s decode timeout used to count time spent queued for a worker, so a parallel Fuji
import timed out in waves — every file in a wave fell back to the camera preview, and the
byte-scan fallback could hand back a truncated JPEG, which surfaced as a 0x0 photo. The
timeout now starts when a worker picks the job up, an abandoned worker is recycled instead
of being returned to the pool, and the fallback only stores bytes that actually decode.
Raise the worker count on a big machine; keep it low on a small VPS, where each worker Raise the worker count on a big machine; keep it low on a small VPS, where each worker
can hold a few hundred MB while decoding. `GET /api/health` reports the pool size and can hold a few hundred MB while decoding. `GET /api/health` reports the pool size and
busy count. busy count.
@@ -972,6 +994,33 @@ listed in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md).
--- ---
## Metadata portability
The catalog is not the only copy of what you typed. Ratings, colour labels, keywords and
IPTC fields are written into XMP in both directions, so a library can leave.
- **Two keyword lists, on purpose.** `photo.keywords` holds the leaf terms and is what search
and filters read; `photo.keywordPaths` holds the full `A > B > C` chains. Typing
`Nature > Birds > Robin` records `Nature`, `Nature > Birds` and the full path, and adds
`Robin` to the flat list, so taggers never have to think about the tree and search never
has to.
- **The pair Lightroom writes.** `dc:subject` carries the leaves, `lr:hierarchicalSubject`
the paths, and `xmp:Rating` / `xmp:Label` the rating and colour label. Another editor
sees the same thing Luminary does; a library can be rebuilt from sidecars instead of
from this database.
- **IPTC core.** Headline, credit, source, city, state, country and sublocation are edited
in the Metadata panel and written as `photoshop:` and `Iptc4xmpCore:` properties.
- **Import reads both halves.** Importing a sidecar applies its develop settings and its
cataloguing fields independently: a metadata-only file from a DAM imports without a
`crs:` grade, and a grade imports without keywords. Nothing the file omits is cleared.
- **Exported files carry it too.** A JPEG export embeds the same packet as the sidecar, so a
delivered file keeps its rating, keywords, hierarchy and IPTC.
`src/lib/keywords.ts` owns the path rules (separators, ancestors, pruning a subtree and
leaving no orphan leaves); `src/lib/xmp.ts` owns the mapping to and from XMP.
---
## Lens profiles ## Lens profiles
Lens correction uses the calibration data of the Lens correction uses the calibration data of the
@@ -1090,14 +1139,51 @@ when none is installed.
--- ---
## Desktop bundles
The app also ships as a double-clickable desktop bundle for people who do not want a
terminal. The current release is **0.5.4.1**: Windows and Linux bundles are built; the
macOS app stays at 0.5.1 until it can be built on a Mac.
- **Windows** — per-user setup exe or portable zip from `windows/releases/`. The app
opens in its own native window (`LuminaryWindow.exe`, WebView2), so no browser, Edge
profile or Microsoft account is involved. `Luminary.exe` is the launcher; `-Browser`
opens a normal tab instead, and `-Stop` stops the local engine.
- **Linux** — `.deb` or portable tarball from `linux/releases/`; the launcher picks a
Chromium-based browser for its app window or falls back to a normal tab.
- **macOS** — `macos/build.mjs`, run on a Mac, produces the `.app`, zip and dmg.
Each bundle starts a Node process from its own folder that serves the UI and decodes
raws on `127.0.0.1` only. That process is the *local engine*: it is a background
service on the same PC, needs no network, and never uploads anything. The launcher
waits for it with a direct loopback connection and opens the app window with proxies
disabled, so a disconnected machine still starts and imports.
Build them from the repository root (artifacts land outside the checkout and, with
`--publish`, are copied into the release folders):
```bash
node windows/build.mjs --skip-build --installer --publish \
--webview2 /path/to/LuminaryWindow.exe
node linux/build.mjs --skip-build --publish
```
`windows/README.md`, `linux/README.md` and `macos/README.md` cover the packaging
details, the isolation guarantees and the smoke tests (`windows/SMOKE-WINDOWS.ps1`,
`linux/SMOKE-LINUX.sh`).
---
## Troubleshooting ## Troubleshooting
| Symptom | Cause and fix | | Symptom | Cause and fix |
| --- | --- | | --- | --- |
| "Cannot reach the Luminary server" in the app | The Vite dev proxy targets `127.0.0.1:8787`. Start `npm run server`, and do not change `PORT` while using `npm run dev` | | "Cannot reach the Luminary local engine" in the desktop app | The bundled engine stopped, or the window's request to `127.0.0.1` was routed through a system proxy. Start the app again; 0.5.4 probes and opens the window with proxies disabled |
| "Cannot reach the Luminary server" in a dev build | The Vite dev proxy targets `127.0.0.1:8787`. Start `npm run server`, and do not change `PORT` while using `npm run dev` |
| `503` "The web build is missing" | `npm start` was run without `dist/`. Run `npm run build` first, or use `npm run dev` | | `503` "The web build is missing" | `npm start` was run without `dist/`. Run `npm run build` first, or use `npm run dev` |
| Raw upload returns `422` | LibRaw could not decode the file and no embedded preview was found. Check `GET /api/health` → `raw.libraw`; install dependencies and confirm the camera is supported | | Raw upload returns `422` | LibRaw could not decode the file and no embedded preview was found. Check `GET /api/health` → `raw.libraw`; install dependencies and confirm the camera is supported |
| Import is slow or the machine swaps | Lower `LUMINARY_RAW_WORKERS`; each decoder holds a worker and a few hundred MB | | Import is slow or the machine swaps | Lower `LUMINARY_RAW_WORKERS`; each decoder holds a worker and a few hundred MB |
| Fuji imports are slow or a Fuji file fails to import | X-Trans demosaic is the cost, not the network. `LUMINARY_RAW_XTRANS_QUALITY` defaults to 1 pass (~9 s for 40 MP); 3 is sharper and about five times slower. A file that still fails should now import from the camera preview — check its `decode` field for `embedded` |
| Emails never arrive | Gmail needs 2-Step Verification and an app password, not the account password. Use **Send test email**; admin-saved settings override the environment | | Emails never arrive | Gmail needs 2-Step Verification and an app password, not the account password. Use **Send test email**; admin-saved settings override the environment |
| Quota looks wrong after deleting | Trash still counts toward usage. Empty Trash to release the bytes | | Quota looks wrong after deleting | Trash still counts toward usage. Empty Trash to release the bytes |
| Cookies not marked `Secure` behind HTTPS | The proxy must forward `X-Forwarded-Proto: https` | | Cookies not marked `Secure` behind HTTPS | The proxy must forward `X-Forwarded-Proto: https` |
@@ -1107,6 +1193,14 @@ when none is installed.
--- ---
## Changelog
Release notes live in [CHANGELOG.md](CHANGELOG.md): 0.5.4.1 is the desktop and offline
release (before/after split, native Windows window, local-engine wording, offline
start), 0.5.2 added the three denoise models, and 0.5.1 introduced the Ubuntu package.
---
## Limitations ## Limitations
- **Not a cloud service.** No hosted deployment and no camera driver: tethering is a - **Not a cloud service.** No hosted deployment and no camera driver: tethering is a
+136
View File
@@ -0,0 +1,136 @@
# Security audit
Date: 1 December 2026 · Version: 0.5.4 · Scope: this repository (server, client,
build/release scripts, dependencies). Review was static: dependency scan plus a
targeted read of the server's trust boundaries. No infrastructure, host or
third-party service was tested.
## Summary
No critical or high-severity issue was found in code that ships and runs by
default. The production dependency tree has two `high` advisories that come from
one transitive package (`adm-zip` inside `onnxruntime-node`) and are not
reachable through anything this application does.
Everything else is either a development-only toolchain advisory, a hardening
opportunity, or an operational note.
| Area | Result |
| --- | --- |
| Production dependencies | 0 critical, 0 moderate, 2 high (one transitive package, not reachable) |
| Development dependencies | 2 critical, 3 high, 3 moderate — dev server and test runner only |
| Authentication and sessions | scrypt with per-user salt, random tokens, HttpOnly/SameSite cookies, rate limiting |
| Authorisation | Every `/api/admin/*` route calls `requireAdmin`; gallery routes are token-scoped |
| Injection | No `eval`, no `new Function`, no `innerHTML`/`dangerouslySetInnerHTML`; SQLite access is entirely prepared statements |
| Path traversal | Static and tether paths are resolved and compared against a root; uploads use generated IDs |
| Secret handling | SMTP and bridge credentials AES-256-GCM encrypted at rest; no secrets in the tree |
| Uploads | Global size cap, content-length checked before reading, quota per account |
| Outbound requests | Immich and dashboard URLs are operator-configured, not user-configured |
## Dependency findings
### 1. `adm-zip` — high, transitive (`onnxruntime-node` → `adm-zip`)
Advisories: crafted ZIP triggers a 4 GB allocation; extraction follows
destination symlinks and can overwrite arbitrary files; uncontrolled memory
allocation via a declared size.
Reachability here: `onnxruntime-node` declares `adm-zip` for its own archive
handling. Luminary never extracts a ZIP it did not create: the denoise models are
read from local storage, and the only ZIP code in the app writes archives
(`src/lib/zip.ts`) rather than reading them. No route accepts a ZIP. Impact is
therefore latent rather than exploitable.
Fix: upgrade `onnxruntime-node` 1.23.0 → 1.31.1 (`npm i onnxruntime-node@1.31.1`).
That is the version npm proposes, a non-major bump. Not applied in this pass
because it changes the denoise runtime and needs its own regression run.
### 2. Development toolchain — 2 critical, 3 high, 3 moderate
`vitest`/`tinypool`/`@vitest/mocker` (prototype-pollution gadget to RCE, arbitrary
file read via the Vitest UI server), `vite` (path traversal in optimised-deps
`.map` handling, `launch-editor` NTLM hash disclosure), `esbuild` (dev server
request proxying).
None of these ship: the release bundle is static `dist/` output and the Node
server does not run Vite. They matter only for a machine that runs `npm run dev`
or the Vitest UI while exposed to an untrusted network. Fix by moving to the
current Vite/Vitest majors on a branch, not by a patch bump inside the current
majors.
`npm audit --omit=dev` is the meaningful gate for releases; add it to
`predeploy` if that gate should be enforced.
## Verified controls
- **Password storage**: `scrypt` (`server/auth.mjs`), 32-byte key, per-hash random
salt, compared with `timingSafeEqual`. Non-existent accounts spend the same
scrypt work and return the same message, so the endpoint does not reveal which
addresses are registered.
- **Sessions**: 32-byte random tokens, `HttpOnly`, `SameSite=Lax`, `Secure` when
the request arrived over HTTPS, 30-day lifetime, server-side revocation on logout.
- **Rate limiting**: sign-in is limited per IP and per IP+account (429 with
`Retry-After`), gallery unlock is limited per link.
- **Authorisation**: 26 `requireAdmin` checks cover the admin surface; missing or
disabled accounts are rejected; the desktop local owner is only used when
`LUMINARY_LOCAL=1`.
- **Gallery links**: separate password hash with its own salt, constant-time
compare, unlock cookie random per session and held in memory, so a restart
re-locks the gallery. Share tokens are 18 random bytes.
- **Bridge**: HMAC-SHA256 over the payload, version-tagged, expiry checked,
constant-time signature compare.
- **Path handling**: static requests are resolved then checked with
`path.relative` against `dist`; tether file names go through `basename` and
must match exactly; stored files are addressed by generated IDs.
- **Uploads**: `MAX_UPLOAD` enforced against `content-length` before reading and
again while streaming.
- **Headers**: CSP with `object-src 'none'`, `frame-ancestors 'self'`,
`nosniff`, `SAMEORIGIN`, `same-origin` referrer policy, restrictive
`Permissions-Policy`. No CORS headers are emitted, so browsers cannot read
responses cross-origin.
- **Secrets**: SMTP app password and bridge tokens are sealed with AES-256-GCM
(`server/secrets.mjs`); the key comes from `LUMINARY_SECRET_KEY` or a
`0600` file beside the database. No credentials or API keys are committed.
## Hardening opportunities (not vulnerabilities)
1. **CSP includes `'unsafe-eval'`.** It is there for the WebAssembly engines. The
modern token is `'wasm-unsafe-eval'`; keeping the broader one means any future
DOM-XSS can compile and run script. Tighten to `'wasm-unsafe-eval'` and test
LibRaw/JXL/ONNX still initialise.
2. **Server-side request forgery surface.** The Immich base URL and dashboard URL
are operator-supplied and fetched by the server with credentials attached.
An admin can point them at internal services. Acceptable for a self-hosted
tool, but worth blocking loopback/link-local targets by default, or stating
the trust assumption in the docs.
3. **Per-account sign-in limiting is scoped by IP.** A distributed attempt against
one address is not globally throttled; scrypt cost is the only brake. A global
per-account counter would close that.
4. **30-day sessions** with no rotation on privilege change. Revoking sessions on
password change is worth adding.
5. **No HSTS, no built-in TLS.** Correct for a loopback desktop app; for team
installs it depends on a reverse proxy, so document that.
6. **`secret.key` beside the database** protects backups and dumps, not a full
data-directory compromise. `LUMINARY_SECRET_KEY` is the stronger option and
should be recommended for team installs.
7. **Minimum password length is 8** with no breach-list check. Fine; consider 12
for admin accounts.
## Release artefact checks
- The desktop bundles copy `dist/` and production `node_modules/`; no dev
dependencies or test files are included.
- The new JPEG XL encoder is WebAssembly executed in the browser sandbox, loads
only when a JXL export is chosen, makes no network requests, and is Apache-2.0
(`@jsquash/jxl`, libjxl BSD-3-Clause). No new server-side attack surface.
- JPEG exports re-encode pixels, so camera EXIF is not carried into delivered
files; only the XMP block Luminary writes is added.
## Recommended order
1. `onnxruntime-node@1.31.1` with a denoise regression run (clears both production
highs).
2. Tighten CSP to `'wasm-unsafe-eval'` and re-test raw, JXL and denoise loading.
3. Vite/Vitest major upgrade on a branch (clears every dev advisory).
4. Seal the Immich API key if it is not already sealed.
5. Add `npm audit --omit=dev --audit-level=high` to `scripts/predeploy.mjs`.
Binary file not shown.
+32 -30
View File
@@ -198,9 +198,9 @@
<p>Every figure is a real screenshot from a running installation with a portrait session loaded. The file names, cameras and metadata are the uploaded originals; the cull, crop and grade shown were arranged for the guide. Keys are written for both platforms: <kbd>⌘</kbd> means Command on macOS, <kbd>Ctrl</kbd> on Windows and Linux. Boxes marked <b>Try this</b> are short exercises that use the kind of photo you probably have on disk.</p> <p>Every figure is a real screenshot from a running installation with a portrait session loaded. The file names, cameras and metadata are the uploaded originals; the cull, crop and grade shown were arranged for the guide. Keys are written for both platforms: <kbd>⌘</kbd> means Command on macOS, <kbd>Ctrl</kbd> on Windows and Linux. Boxes marked <b>Try this</b> are short exercises that use the kind of photo you probably have on disk.</p>
<div class="glance"> <div class="glance">
<div><strong>Local first</strong><span>The browser keeps its own catalogue in IndexedDB. A server adds shared storage and raw decoding; it is not required for JPEG/PNG work.</span></div> <div><strong>Local first</strong><span>The browser keeps its own catalogue in IndexedDB. A team server adds shared storage and accounts; raw decoding runs in the engine bundled with the desktop app, so it is not required for JPEG/PNG work.</span></div>
<div><strong>Non-destructive</strong><span>Edits are parameters beside the file. The original pixels are only ever read, never rewritten.</span></div> <div><strong>Non-destructive</strong><span>Edits are parameters beside the file. The original pixels are only ever read, never rewritten.</span></div>
<div><strong>Raw aware</strong><span>Camera raws are demosaiced by the bundled LibRaw server, then developed like any other frame — with a 16-bit sidecar for grading.</span></div> <div><strong>Raw aware</strong><span>Camera raws are demosaiced by the bundled LibRaw engine on this PC, then developed like any other frame — with a 16-bit sidecar for grading.</span></div>
</div> </div>
</div> </div>
@@ -224,7 +224,7 @@
<ul> <ul>
<li>Drag a card or folder onto the window.</li> <li>Drag a card or folder onto the window.</li>
<li>Pick the event, or type a new name.</li> <li>Pick the event, or type a new name.</li>
<li>Raws and TIFF need the server; JPEG/PNG do not.</li> <li>Raws and TIFF need the local engine (bundled with the desktop app); JPEG/PNG do not.</li>
</ul> </ul>
</div> </div>
<div class="qs-box"> <div class="qs-box">
@@ -255,7 +255,7 @@
<div class="qs-box"> <div class="qs-box">
<h2>6 · Deliver</h2> <h2>6 · Deliver</h2>
<ul> <ul>
<li><b>Export</b> → JPEG/PNG/WebP/TIFF, size, recipe, watermark.</li> <li><b>Export</b> → JPEG/PNG/WebP/JPEG XL/TIFF, size, recipe, watermark.</li>
<li><b>Share</b> → client gallery link with picks and comments.</li> <li><b>Share</b> → client gallery link with picks and comments.</li>
<li><b>Print</b> → A4/Letter/5×7 through the same renderer.</li> <li><b>Print</b> → A4/Letter/5×7 through the same renderer.</li>
</ul> </ul>
@@ -280,7 +280,7 @@
</div> </div>
</div> </div>
<div class="qs-foot">If a raw will not import, the server is offline or the camera is unsupported by LibRaw — see Chapter 4. If the canvas is black, WebGL 2 is unavailable — see Chapter 21.</div> <div class="qs-foot">If a raw will not import, the local engine is not running or the camera is unsupported by LibRaw — see Chapter 4. If the canvas is black, WebGL 2 is unavailable — see Chapter 21.</div>
</section> </section>
<!-- ============================== 1 ============================== --> <!-- ============================== 1 ============================== -->
@@ -306,7 +306,7 @@
<tbody> <tbody>
<tr><td>Browser</td><td>A current Chromium (Chrome, Edge), Firefox or Safari with WebGL 2. Hardware acceleration is strongly recommended: previews, thumbnails and exports all render on the GPU.</td></tr> <tr><td>Browser</td><td>A current Chromium (Chrome, Edge), Firefox or Safari with WebGL 2. Hardware acceleration is strongly recommended: previews, thumbnails and exports all render on the GPU.</td></tr>
<tr><td>Display</td><td>1280 × 800 minimum. The layout is built for a laptop and expands to fill a desktop screen.</td></tr> <tr><td>Display</td><td>1280 × 800 minimum. The layout is built for a laptop and expands to fill a desktop screen.</td></tr>
<tr><td>Server (optional)</td><td>Node 22.5+ or Docker, for raw and TIFF decoding, shared storage, accounts and proofing links. JPEG, PNG, WebP and AVIF work without it.</td></tr> <tr><td>Team server (optional)</td><td>Node 22.5+ or Docker, for shared storage, accounts and proofing links. The desktop app bundles the same engine for raw and TIFF decoding; JPEG, PNG, WebP and AVIF work without either.</td></tr>
<tr><td>Windows app (optional)</td><td>Windows 10 or 11, 64-bit. Nothing else: Node, .NET and the VC++ runtime are bundled or not needed.</td></tr> <tr><td>Windows app (optional)</td><td>Windows 10 or 11, 64-bit. Nothing else: Node, .NET and the VC++ runtime are bundled or not needed.</td></tr>
</tbody> </tbody>
</table> </table>
@@ -330,7 +330,7 @@
<section class="chapter"> <section class="chapter">
<div class="kicker">Chapter 2</div> <div class="kicker">Chapter 2</div>
<h1>Installing Luminary</h1> <h1>Installing Luminary</h1>
<p class="lede">Three supported ways in. Pick the one that matches how the machine will be used; they all run the same server and the same interface.</p> <p class="lede">Three supported ways in. Pick the one that matches how the machine will be used; they all run the same engine and the same interface. The Linux and macOS bundles install the same desktop app.</p>
<h2>Option A — Docker (recommended for a server)</h2> <h2>Option A — Docker (recommended for a server)</h2>
<ol class="steps"> <ol class="steps">
@@ -372,18 +372,18 @@
<section class="chapter"> <section class="chapter">
<div class="kicker">Chapter 3</div> <div class="kicker">Chapter 3</div>
<h1>The Windows desktop app</h1> <h1>The Windows desktop app</h1>
<p class="lede">An optional, self-contained Windows build of the same application: no Node install, no account, no browser chrome. It is a folder you can copy to another PC, or an installer that creates shortcuts.</p> <p class="lede">An optional, self-contained Windows build of the same application: no Node install, no account, no browser. It is a folder you can copy to another PC, or an installer that creates shortcuts. The app opens its own window and starts, imports and edits with the network disconnected.</p>
<h2>What is in the folder</h2> <h2>What is in the folder</h2>
<table> <table>
<thead><tr><th style="width:34%">Item</th><th>Purpose</th></tr></thead> <thead><tr><th style="width:34%">Item</th><th>Purpose</th></tr></thead>
<tbody> <tbody>
<tr><td><code>Luminary.exe</code> or <code>Luminary.cmd</code></td><td>The launcher: starts the server hidden, waits for health, opens the window. <code>Luminary.vbs</code> does the same with no console window at all.</td></tr> <tr><td><code>Luminary.exe</code> or <code>Luminary.cmd</code></td><td>The launcher: starts the local engine hidden, waits for health, opens the window. <code>Luminary.exe</code> needs no console and no Windows Script Host; <code>Luminary.vbs</code> and <code>Luminary.cmd</code> are fallbacks.</td></tr>
<tr><td><code>LuminaryWindow.exe</code></td><td>The native window (WebView2). The launcher opens it; starting it directly also hands off to the launcher, so it opens in desktop mode.</td></tr> <tr><td><code>LuminaryWindow.exe</code></td><td>The native window (WebView2). The launcher opens it; starting it directly also hands off to the launcher, so it opens in desktop mode.</td></tr>
<tr><td><code>Luminary.ps1</code></td><td>The logic behind the launchers: preflight, port choice, health wait, repair, stop, status.</td></tr> <tr><td><code>Luminary.ps1</code></td><td>The logic behind the launchers: preflight, port choice, health wait, repair, stop, status.</td></tr>
<tr><td><code>node.exe</code></td><td>The bundled Node 24 runtime. Nothing is installed system-wide.</td></tr> <tr><td><code>node.exe</code></td><td>The bundled Node 24 runtime. Nothing is installed system-wide.</td></tr>
<tr><td><code>app\</code></td><td><code>server\</code>, <code>dist\</code> and production <code>node_modules\</code> — the unchanged application.</td></tr> <tr><td><code>app\</code></td><td><code>server\</code>, <code>dist\</code> and production <code>node_modules\</code> — the unchanged application.</td></tr>
<tr><td><code>Stop Luminary.cmd</code></td><td>Stops the server started from this folder.</td></tr> <tr><td><code>Stop Luminary.cmd</code></td><td>Stops the local engine this folder started (<code>Luminary.exe -Stop</code> does the same from the Start menu).</td></tr>
<tr><td><code>version.txt</code></td><td>Version, commit, build time, Node build and SHA-256 of <code>node.exe</code>.</td></tr> <tr><td><code>version.txt</code></td><td>Version, commit, build time, Node build and SHA-256 of <code>node.exe</code>.</td></tr>
</tbody> </tbody>
</table> </table>
@@ -392,10 +392,10 @@
<ol class="steps"> <ol class="steps">
<li>Copy the folder (or the ZIP) to the PC — for example <code>D:\Apps\Luminary</code>.</li> <li>Copy the folder (or the ZIP) to the PC — for example <code>D:\Apps\Luminary</code>.</li>
<li>Double-click <code>Luminary.cmd</code> (or <code>Luminary.vbs</code> for no console window; <code>Luminary.exe</code> in the Go build). Windows SmartScreen may warn because the build is unsigned: <b>More info → Run anyway</b>.</li> <li>Double-click <code>Luminary.cmd</code> (or <code>Luminary.vbs</code> for no console window; <code>Luminary.exe</code> in the Go build). Windows SmartScreen may warn because the build is unsigned: <b>More info → Run anyway</b>.</li>
<li>The first launch creates <code>%LOCALAPPDATA%\Luminary\data</code>, starts the server on a free port and opens the window.</li> <li>The first launch creates <code>%LOCALAPPDATA%\Luminary\data</code>, starts the local engine on a free port and opens the window.</li>
<li>Import a shoot. There is no sign-in screen: the app runs in single-user mode with one local administrator.</li> <li>Import a shoot. There is no sign-in screen: the app runs in single-user mode with one local administrator.</li>
</ol> </ol>
<p>The installer build (<code>Luminary-Setup.exe</code>) does the same into <code>Program Files</code>, adds Start-menu and desktop shortcuts with the Luminary icon, and registers an uninstaller. The data directory is deliberately kept out of <code>Program Files</code>, so uninstalling leaves the catalogue in place.</p> <p>The installer (<code>Luminary-Setup.exe</code>) does the same for your account into <code>%LOCALAPPDATA%\Programs\Luminary</code> — no administrator prompt — adds Start-menu and desktop shortcuts with the Luminary icon, and registers an uninstaller. Its <b>Start Luminary</b> tick, the shortcuts and start-at-login all launch <code>Luminary.exe</code> directly. The data directory is deliberately kept outside the program folder, so uninstalling leaves the catalogue in place.</p>
<h2>Everyday commands</h2> <h2>Everyday commands</h2>
<table> <table>
@@ -404,22 +404,23 @@
<tr><td><code>Luminary.cmd -Status</code></td><td>Prints the running state, the port and the data folder.</td></tr> <tr><td><code>Luminary.cmd -Status</code></td><td>Prints the running state, the port and the data folder.</td></tr>
<tr><td><code>Luminary.cmd -Verify</code></td><td>Checks every file the launcher needs, including the SHA-256 of <code>node.exe</code>. Exit 0 is good.</td></tr> <tr><td><code>Luminary.cmd -Verify</code></td><td>Checks every file the launcher needs, including the SHA-256 of <code>node.exe</code>. Exit 0 is good.</td></tr>
<tr><td><code>Luminary.cmd -Repair</code></td><td>Re-downloads a missing or corrupt <code>node.exe</code> and verifies the hash before installing it.</td></tr> <tr><td><code>Luminary.cmd -Repair</code></td><td>Re-downloads a missing or corrupt <code>node.exe</code> and verifies the hash before installing it.</td></tr>
<tr><td><code>Luminary.cmd -Stop</code></td><td>Stops the server this folder started; refuses to kill an unrelated process on the port.</td></tr> <tr><td><code>Luminary.exe -Stop</code></td><td>Stops the local engine this folder started; refuses to kill an unrelated process on the port. <code>Luminary.cmd -Stop</code> does the same.</td></tr>
<tr><td><code>Luminary.cmd -Browser</code></td><td>Skips the native window and opens the default browser instead.</td></tr> <tr><td><code>Luminary.cmd -Browser</code></td><td>Skips the native window and opens the default browser instead.</td></tr>
</tbody> </tbody>
</table> </table>
<h2>How it behaves</h2> <h2>How it behaves</h2>
<ul> <ul>
<li><b>Window choice</b> — <code>LuminaryWindow.exe</code> (native, own taskbar icon) first, then Edge or Chrome in <code>--app</code> mode, then the default browser.</li> <li><b>Window choice</b> — <code>LuminaryWindow.exe</code> (native, own taskbar icon) first; only if that is missing does it use Chrome, then Edge, in <code>--app</code> mode, and the default browser last. No browser profile or Microsoft account is involved in the native window.</li>
<li><b>Port</b> — the preferred port is tried first; if it is taken the launcher finds a free one and records it, so the shortcut always reaches the right instance.</li> <li><b>Port</b> — the preferred port is tried first; if it is taken the launcher finds a free one and records it, so the shortcut always reaches the right instance.</li>
<li><b>Second launch</b> — if the server is already up and healthy, the launcher reuses it instead of starting another.</li> <li><b>Second launch</b> — if the local engine is already up and healthy, the launcher reuses it instead of starting another.</li>
<li><b>Offline</b> — the engine listens on <code>127.0.0.1</code> only. The launcher waits for it over a direct loopback socket and the window ignores system proxies, so unplugging the network does not stop it starting, importing or editing.</li>
<li><b>Logs</b> — <code>%LOCALAPPDATA%\Luminary\data\logs\server.out.log</code> and <code>server.err.log</code>.</li> <li><b>Logs</b> — <code>%LOCALAPPDATA%\Luminary\data\logs\server.out.log</code> and <code>server.err.log</code>.</li>
<li><b>Read-only media</b> — logs and runtime state fall back to <code>%LOCALAPPDATA%</code> when the bundle folder cannot be written.</li> <li><b>Read-only media</b> — logs and runtime state fall back to <code>%LOCALAPPDATA%</code> when the bundle folder cannot be written.</li>
</ul> </ul>
<div class="note"> <div class="note">
<b>Starting the window directly.</b> Double-clicking <code>LuminaryWindow.exe</code> does not open a signed-out page. It hands off to the launcher, which starts the local server in desktop mode and reopens the window signed in. The launcher remains the recommended entry point — <code>Luminary.cmd</code> or <code>Luminary.vbs</code> (or <code>Luminary.exe</code> when the Go build is used). <b>Starting the window directly.</b> Double-clicking <code>LuminaryWindow.exe</code> does not open a signed-out page. It hands off to the launcher, which starts the local engine in desktop mode and reopens the window signed in. The launcher remains the recommended entry point — <code>Luminary.cmd</code> or <code>Luminary.vbs</code> (or <code>Luminary.exe</code> when the Go build is used).
</div> </div>
<div class="note"> <div class="note">
@@ -427,7 +428,7 @@
</div> </div>
<div class="warn note"> <div class="warn note">
<b>WebView2.</b> The native window uses the Evergreen WebView2 runtime that ships with Windows 10/11. If a machine lacks it, the launcher falls back to an Edge or Chrome app window — the application still runs, only the dedicated window shell is skipped. <b>WebView2.</b> The native window uses the Evergreen WebView2 runtime that ships with Windows 10/11. If a machine lacks it, the launcher falls back to a Chrome or Edge app window — the application still runs, only the dedicated window shell is skipped.
</div> </div>
</section> </section>
@@ -439,7 +440,7 @@
<figure> <figure>
<img src="img/10-import.jpg" alt="The import dialog"> <img src="img/10-import.jpg" alt="The import dialog">
<figcaption><b>Figure 1.</b> The import dialog. The event picker names the destination, the summary counts the batch, and the note confirms the server is ready to demosaic raws.</figcaption> <figcaption><b>Figure 1.</b> The import dialog. The event picker names the destination, the summary counts the batch, and the note confirms the local engine is ready to demosaic raws on this PC.</figcaption>
</figure> </figure>
<h2>Adding files</h2> <h2>Adding files</h2>
@@ -457,14 +458,14 @@
<thead><tr><th style="width:34%">Type</th><th>Behaviour</th></tr></thead> <thead><tr><th style="width:34%">Type</th><th>Behaviour</th></tr></thead>
<tbody> <tbody>
<tr><td>JPEG, PNG, WebP, AVIF</td><td>Decoded in the browser. EXIF camera, lens, ISO, aperture, shutter and focal length are read when present.</td></tr> <tr><td>JPEG, PNG, WebP, AVIF</td><td>Decoded in the browser. EXIF camera, lens, ISO, aperture, shutter and focal length are read when present.</td></tr>
<tr><td>TIFF (.tif, .tiff)</td><td>Decoded on the server into an editable JPEG proxy, because browsers have no TIFF decoder. The original TIFF is stored untouched and the full-resolution proxy drives the editor and export.</td></tr> <tr><td>TIFF (.tif, .tiff)</td><td>Decoded by the local engine (or the team server) into an editable JPEG proxy, because browsers have no TIFF decoder. The original TIFF is stored untouched and the full-resolution proxy drives the editor and export.</td></tr>
<tr><td>Camera raw — CR2, CR3, NEF, ARW, ORF, RW2, RAF, DNG, PEF, SRW, 3FR and 20 more</td><td>Sent to the server, demosaiced with LibRaw, stored as the original plus an editable JPEG proxy and a 16-bit sidecar.</td></tr> <tr><td>Camera raw — CR2, CR3, NEF, ARW, ORF, RW2, RAF, DNG, PEF, SRW, 3FR and 20 more</td><td>Sent to the local engine (or the team server), demosaiced with LibRaw on this PC, stored as the original plus an editable JPEG proxy and a 16-bit sidecar. Nothing is uploaded anywhere.</td></tr>
</tbody> </tbody>
</table> </table>
<p>A progress bar names the file being read. Failures are listed individually with the reason while the successes are kept; an unreadable raw usually means the server is offline or LibRaw does not support that camera.</p> <p>A progress bar names the file being read. Failures are listed individually with the reason while the successes are kept; an unreadable raw usually means the local engine is not running or LibRaw does not support that camera.</p>
<h2>Tethering instead of a card reader</h2> <h2>Tethering instead of a card reader</h2>
<p>An event can watch a folder on the server. Point a capture app or a transfer folder at <code>&lt;data&gt;\tether\&lt;event id&gt;</code>; the open editor polls it, imports each new JPEG, TIFF, WebP or raw through the normal path, and only deletes the file after the client confirms. Closing the tab loses nothing — the files wait in the folder.</p> <p>An event can watch a folder on the engine. Point a capture app or a transfer folder at <code>&lt;data&gt;\tether\&lt;event id&gt;</code>; the open editor polls it, imports each new JPEG, TIFF, WebP or raw through the normal path, and only deletes the file after the client confirms. Closing the tab loses nothing — the files wait in the folder.</p>
<div class="note"> <div class="note">
<b>Try this.</b> Import ten frames, name the event after the shoot, then drag the whole event onto another in the sidebar. The photos move as metadata; no file is copied or re-encoded. <b>Try this.</b> Import ten frames, name the event after the shoot, then drag the whole event onto another in the sidebar. The photos move as metadata; no file is copied or re-encoded.
@@ -483,7 +484,7 @@
</figure> </figure>
<h2>The sidebar</h2> <h2>The sidebar</h2>
<p><b>All photos</b> is the whole catalogue; <b>Trash</b> holds deleted photos until you empty it (restore, delete permanently, or empty all). Each event shows its photo count. <b>+</b> creates an event; drag one event onto another to move its photos; the footer reports whether a server is connected and who you are signed in as.</p> <p><b>All photos</b> is the whole catalogue; <b>Trash</b> holds deleted photos until you empty it (restore, delete permanently, or empty all). Each event shows its photo count. <b>+</b> creates an event; drag one event onto another to move its photos; the footer reports whether a team server is connected and who you are signed in as.</p>
<h2>The filter bar</h2> <h2>The filter bar</h2>
<figure> <figure>
@@ -722,9 +723,9 @@
<tr><td>Sharpen — Detail</td><td>How much fine structure is included; lower values protect smooth areas.</td></tr> <tr><td>Sharpen — Detail</td><td>How much fine structure is included; lower values protect smooth areas.</td></tr>
<tr><td>Noise reduction — Luminance</td><td>Smooths luminance noise at the cost of fine detail.</td></tr> <tr><td>Noise reduction — Luminance</td><td>Smooths luminance noise at the cost of fine detail.</td></tr>
<tr><td>Noise reduction — Detail</td><td>How much texture survives the smoothing.</td></tr> <tr><td>Noise reduction — Detail</td><td>How much texture survives the smoothing.</td></tr>
<tr><td>Denoise</td><td>Detail-preserving pass that runs on the server for difficult high-ISO frames; the result is cached per model, so switching back to a model you already rendered is instant.</td></tr> <tr><td>Denoise</td><td>Detail-preserving pass that runs in the local engine (or the team server) for difficult high-ISO frames; the result is cached per model, so switching back to a model you already rendered is instant.</td></tr>
<tr><td>AI denoise — Model</td><td><b>Guided</b> (default, fastest, keeps the most fine texture), <b>SCUNet</b> (learned model, removes the most grain and smooths more) or <b>NLM</b> (non-local means, between the two). Pick one and press Generate; the model is saved with the photo.</td></tr> <tr><td>AI denoise — Model</td><td><b>Guided</b> (default, fastest, keeps the most fine texture), <b>SCUNet</b> (learned model, removes the most grain and smooths more) or <b>NLM</b> (non-local means, between the two). Pick one and press Generate; the model is saved with the photo.</td></tr>
<tr><td>AI denoise — Amount</td><td>Blends the rendered result into the frame. The server always renders at full strength, so the slider is instant and never re-runs the model.</td></tr> <tr><td>AI denoise — Amount</td><td>Blends the rendered result into the frame. The engine always renders at full strength, so the slider is instant and never re-runs the model.</td></tr>
</tbody> </tbody>
</table> </table>
@@ -854,11 +855,11 @@
<figure> <figure>
<img src="img/08-presets.jpg" alt="The preset rail"> <img src="img/08-presets.jpg" alt="The preset rail">
<figcaption><b>Figure 14.</b> The preset rail with search, category filter, the look variants (Stock, Push +1, Pull −1, Warm split, Cool split) and tiles rendered from your own photo at your current crop.</figcaption> <figcaption><b>Figure 14.</b> The preset rail with search, category filter, the look variants (Stock, Push +1, Pull −1, Warm split, Cool split) and tiles rendered from your own photo at your current crop, tone, colour and white balance.</figcaption>
</figure> </figure>
<h2>Presets</h2> <h2>Presets</h2>
<p>Groups include Essentials, Film, Warm and Cinematic. The variant row re-renders the whole rail a stop brighter or darker, or with the split-tone reversed. Click a tile to apply: it replaces the develop parameters but leaves crop and rotation alone, because those belong to the frame. <b>+</b> saves the current look as your own preset with a rendered preview.</p> <p>Groups include Essentials, Film, Warm and Cinematic. The variant row re-renders the whole rail a stop brighter or darker, or with the split-tone reversed. Click a tile to apply: the look's tone and colour replace the develop parameters, while crop and rotation stay, because those belong to the frame. The white balance you set is kept as the base the look is graded over — the stock's own warmth or coolness is added on top of it, so correct a difficult frame first and the film still sits over that correction. Switching looks swaps that cast instead of stacking one stock's cast on the last one's. Because the look adds its cast to your correction, the Light panel prints both: the look's own cast and the final balance the photo is graded at, right under Temp and Tint. Every tile is rendered over the grade the photo has now, so the thumbnail is what the click produces. <b>+</b> saves the current look as your own preset with a rendered preview.</p>
<h2>History, undo and redo</h2> <h2>History, undo and redo</h2>
<p>Every adjustment is recorded with a label. <b>History</b> in the left rail restores any step; <kbd>⌘ / Ctrl</kbd> + <kbd>Z</kbd> steps back, <kbd>⇧</kbd> + <kbd>⌘ / Ctrl</kbd> + <kbd>Z</kbd> steps forward. History is per photo and saved with the catalogue.</p> <p>Every adjustment is recorded with a label. <b>History</b> in the left rail restores any step; <kbd>⌘ / Ctrl</kbd> + <kbd>Z</kbd> steps back, <kbd>⇧</kbd> + <kbd>⌘ / Ctrl</kbd> + <kbd>Z</kbd> steps forward. History is per photo and saved with the catalogue.</p>
@@ -930,7 +931,7 @@
<table> <table>
<thead><tr><th style="width:26%">Option</th><th>What it does</th></tr></thead> <thead><tr><th style="width:26%">Option</th><th>What it does</th></tr></thead>
<tbody> <tbody>
<tr><td>Format</td><td>JPEG, PNG, WebP or uncompressed 16-bit TIFF. JPEG and WebP expose quality; PNG and TIFF are lossless.</td></tr> <tr><td>Format</td><td>JPEG, PNG, WebP, JPEG XL or uncompressed 16-bit TIFF. JPEG, WebP and JPEG XL expose quality; JPEG XL also has a lossless switch; PNG and TIFF are lossless.</td></tr>
<tr><td>Resize</td><td>Full resolution, a long-edge size in pixels, or a percentage of the cropped frame.</td></tr> <tr><td>Resize</td><td>Full resolution, a long-edge size in pixels, or a percentage of the cropped frame.</td></tr>
<tr><td>Quality</td><td>Encoder quality, 40–100. 90–95 is visually lossless for most photographs.</td></tr> <tr><td>Quality</td><td>Encoder quality, 40–100. 90–95 is visually lossless for most photographs.</td></tr>
<tr><td>File name</td><td>Template with <code>{name}</code>, <code>{date}</code>, <code>{time}</code> and <code>{index}</code>; the first result is previewed underneath.</td></tr> <tr><td>File name</td><td>Template with <code>{name}</code>, <code>{date}</code>, <code>{time}</code> and <code>{index}</code>; the first result is previewed underneath.</td></tr>
@@ -1192,7 +1193,7 @@
<b>If something looks wrong, press <kbd>?</kbd> and compare.</b> The shortcut sheet is generated from the same map the keyboard uses, so if a key is listed there it is live. <b>If something looks wrong, press <kbd>?</kbd> and compare.</b> The shortcut sheet is generated from the same map the keyboard uses, so if a key is listed there it is live.
</div> </div>
<div class="end">Luminary User Guide · Version 1.1 · Screenshots captured from a live 868-photo catalog at 1500 × 940.</div> <div class="end">Luminary User Guide · Version 1.3 · Screenshots captured from a live 868-photo catalog at 1500 × 940.</div>
</section> </section>
<!-- ============================== APPENDIX A ============================== --> <!-- ============================== APPENDIX A ============================== -->
@@ -1214,7 +1215,8 @@
</table> </table>
<h2>Export formats</h2> <h2>Export formats</h2>
<p>JPEG, PNG, WebP and uncompressed 16-bit TIFF, at full resolution, a long edge, or a percentage of the cropped frame. Output dimensions always reflect the crop and rotation; colour space is sRGB, Display P3 or Adobe RGB with a generated ICC profile.</p> <p>JPEG, PNG, WebP, JPEG XL and uncompressed 16-bit TIFF, at full resolution, a long edge, or a percentage of the cropped frame. Output dimensions always reflect the crop and rotation; colour space is sRGB, Display P3 or Adobe RGB with a generated ICC profile.</p>
<p>JPEG XL is exported at 8-bit in sRGB, either lossy (quality 40–100) or lossless, using libjxl compiled to WebAssembly inside the app — the file is encoded on this computer and nothing is uploaded. There is no embedded ICC profile or XMP metadata in a JXL export yet; use JPEG or 16-bit TIFF when you need those. Chrome 155+, Firefox 158+ and Safari 17+ open .jxl files; Microsoft Edge does not display them yet.</p>
<h2>Badges on a card</h2> <h2>Badges on a card</h2>
<table> <table>
+7 -7
View File
@@ -51,8 +51,8 @@ Output:
``` ```
<out>/ <out>/
Luminary-0.5.2-linux-x64.tar.gz portable bundle Luminary-0.5.4-linux-x64.tar.gz portable bundle
Luminary-0.5.2-linux-amd64.deb Ubuntu package, built from the same bundle Luminary-0.5.4-linux-amd64.deb Ubuntu package, built from the same bundle
stage/Luminary/ the unpacked bundle (kept for inspection) stage/Luminary/ the unpacked bundle (kept for inspection)
cache/node-v24.22.2-linux-x64.tar.gz cache/node-v24.22.2-linux-x64.tar.gz
cache/SHASUMS256-v24.22.2.txt cache/SHASUMS256-v24.22.2.txt
@@ -72,7 +72,7 @@ catalog still live in `~/.local/share/luminary`, so removing or upgrading the
package never touches them: package never touches them:
```bash ```bash
sudo apt install ./Luminary-0.5.2-linux-amd64.deb sudo apt install ./Luminary-0.5.4-linux-amd64.deb
luminary # or launch Luminary from the applications menu luminary # or launch Luminary from the applications menu
``` ```
@@ -84,7 +84,7 @@ with `sudo apt remove luminary`; `sudo apt purge luminary` also removes
Or stay portable — nothing installed, nothing to root: Or stay portable — nothing installed, nothing to root:
```bash ```bash
tar -xzf Luminary-0.5.2-linux-x64.tar.gz tar -xzf Luminary-0.5.4-linux-x64.tar.gz
cd Luminary cd Luminary
./luminary # starts desktop mode and opens the app window ./luminary # starts desktop mode and opens the app window
./install.sh # optional: add Luminary to the applications menu ./install.sh # optional: add Luminary to the applications menu
@@ -187,9 +187,9 @@ check (the launcher runs with `LUMINARY_WINDOW=none` during the test).
```bash ```bash
cd <out> cd <out>
sha256sum Luminary-0.5.2-linux-x64.tar.gz sha256sum Luminary-0.5.4-linux-x64.tar.gz
tar -tzf Luminary-0.5.2-linux-x64.tar.gz | grep -E 'luminary$|runtime/bin/node$|app/server/index.mjs$' tar -tzf Luminary-0.5.4-linux-x64.tar.gz | grep -E 'luminary$|runtime/bin/node$|app/server/index.mjs$'
tar -xzf Luminary-0.5.2-linux-x64.tar.gz -C /tmp/luminary-check tar -xzf Luminary-0.5.4-linux-x64.tar.gz -C /tmp/luminary-check
/tmp/luminary-check/Luminary/luminary --verify /tmp/luminary-check/Luminary/luminary --verify
``` ```
+72
View File
@@ -256,6 +256,78 @@ else
check '--status reports stopped' 1 check '--status reports stopped' 1
fi fi
say ''
say 'Offline import (proxy unreachable)'
# Every proxy variable points at a black hole, so a request that consults the
# system proxy fails instead of reaching 127.0.0.1. That is the shape of the
# bug where an import with the network unplugged reported that it could not
# reach the engine: the engine was fine, the request was routed through a proxy.
PROXY_VARS=(HTTP_PROXY HTTPS_PROXY ALL_PROXY http_proxy https_proxy all_proxy GLOBAL_AGENT_HTTP_PROXY)
for var in "${PROXY_VARS[@]}"; do export "$var=http://10.255.255.1:9"; done
unset NO_PROXY no_proxy
check 'app window bypasses proxies' "$(grep -q -- '--no-proxy-server' "$BUNDLE/luminary" && echo 0 || echo 1)"
"$BUNDLE/luminary" >"$WORK_DIR/offline-start.txt" 2>&1
offline_start=$?
check 'launcher starts with the proxy unreachable' "$offline_start" "$(head -n 1 "$WORK_DIR/offline-start.txt")"
OFFLINE_URL=""
if [ -f "$LUMINARY_DATA/runtime.json" ]; then
OFFLINE_URL="http://127.0.0.1:$("$NODE" -p "JSON.parse(require('fs').readFileSync('$LUMINARY_DATA/runtime.json','utf8')).port")"
check 'runtime.json written offline' 0
else
check 'runtime.json written offline' 1 "$LUMINARY_DATA/runtime.json"
fi
if [ -n "$OFFLINE_URL" ]; then
code="$(http GET "$OFFLINE_URL/api/health")"
check 'health answers offline' $([ "$code" = "200" ] && echo 0 || echo 1) "HTTP $code"
# An import is an upload, a decode in the bundle and a preview read. TIFF
# takes the same server path as camera raw, so this exercises the real thing
# without shipping a raw fixture in the bundle.
"$NODE" -e '
const path = require("node:path");
const sharp = require(path.join(process.argv[1], "app", "node_modules", "sharp"));
sharp({ create: { width: 8, height: 8, channels: 3, background: { r: 200, g: 100, b: 50 } } })
.tiff()
.toFile(process.argv[2])
.then(() => process.exit(0))
.catch(() => process.exit(1));
' "$BUNDLE" "$WORK_DIR/offline-smoke.tiff"
check 'prepared a TIFF to import' "$?"
upload_status="$("$NODE" -e '
const fs = require("node:fs");
const [url, file, out] = process.argv.slice(-3);
fetch(url, { method: "POST", headers: { "Content-Type": "image/tiff" }, body: fs.readFileSync(file) })
.then(async (r) => { fs.writeFileSync(out, await r.text()); process.stdout.write(String(r.status)); })
.catch(() => process.stdout.write("0"));
' "$OFFLINE_URL/api/photos/smoke-offline/original?name=offline-smoke.tiff&mime=image%2Ftiff" "$WORK_DIR/offline-smoke.tiff" "$BODY")"
# A new upload is created (201); replacing one answers 200.
case "$upload_status" in
200|201) upload_ok=0 ;;
*) upload_ok=1 ;;
esac
check 'import upload accepted offline' "$upload_ok" "HTTP $upload_status"
preview="$(jget previewUrl)"
check 'decoded proxy offered offline' $([ -n "$preview" ] && echo 0 || echo 1) "$preview"
if [ -n "$preview" ]; then
case "$preview" in
http*) preview_url="$preview" ;;
*) preview_url="$OFFLINE_URL$preview" ;;
esac
code="$(http GET "$preview_url")"
check 'preview readable offline' $([ "$code" = "200" ] && echo 0 || echo 1) "HTTP $code"
fi
fi
"$BUNDLE/luminary" --stop >/dev/null 2>&1
check 'stopped the offline run' 0
for var in "${PROXY_VARS[@]}"; do unset "$var"; done
say '' say ''
say 'Window' say 'Window'
skip 'app window opens' 'visual check; the launcher opened nothing during this run' skip 'app window opens' 'visual check; the launcher opened nothing during this run'
+1 -1
View File
@@ -441,7 +441,7 @@ Updating: stop Luminary, replace app/ and runtime/ from a newer bundle, start
again. The data folder is outside the bundle and is untouched. again. The data folder is outside the bundle and is untouched.
Notes Notes
- The server listens on 127.0.0.1 only. Set HOST=0.0.0.0 when starting it - The local engine listens on 127.0.0.1 only. Set HOST=0.0.0.0 when starting it
directly with node if client proofing galleries must reach other devices. directly with node if client proofing galleries must reach other devices.
- The app window is the browser's own app mode with a private profile, so it - The app window is the browser's own app mode with a private profile, so it
has no tabs or address bar. Some Wayland desktops ignore the requested has no tabs or address bar. Some Wayland desktops ignore the requested
+6 -3
View File
@@ -1,13 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Luminary desktop launcher for Linux. # Luminary desktop launcher for Linux.
# #
# Starts the bundled server in single-user desktop mode on a free loopback port, # Starts the bundled local engine in single-user desktop mode on a free loopback port,
# waits for /api/health, then opens the UI in a chromeless app window (Chrome, # waits for /api/health, then opens the UI in a chromeless app window (Chrome,
# Chromium, Edge, Brave or Vivaldi). Firefox, or the default browser, is the # Chromium, Edge, Brave or Vivaldi). Firefox, or the default browser, is the
# fallback. # fallback.
# #
# ./luminary start and open the window # ./luminary start and open the window
# ./luminary --stop stop the running server # ./luminary --stop stop the running local engine
# ./luminary --status report pid, URL, data folder and health # ./luminary --status report pid, URL, data folder and health
# ./luminary --browser open a normal browser tab instead # ./luminary --browser open a normal browser tab instead
# ./luminary --verify check that this is a complete bundle # ./luminary --verify check that this is a complete bundle
@@ -167,7 +167,7 @@ start() {
pid="$(cat "$PID_FILE" 2>/dev/null)" pid="$(cat "$PID_FILE" 2>/dev/null)"
if ! wait_health "$port"; then if ! wait_health "$port"; then
problem "the server did not answer on /api/health." problem "the local engine did not answer on /api/health."
problem "See $LOG_DIR/server.err.log, or run: cd \"$APP\" && \"$NODE\" server/index.mjs" problem "See $LOG_DIR/server.err.log, or run: cd \"$APP\" && \"$NODE\" server/index.mjs"
return 1 return 1
fi fi
@@ -237,12 +237,15 @@ open_window() {
while IFS= read -r name; do while IFS= read -r name; do
if browser="$(command -v "$name" 2>/dev/null)"; then if browser="$(command -v "$name" 2>/dev/null)"; then
say "Opening the app window with $name" say "Opening the app window with $name"
# --no-proxy-server: the window only ever loads 127.0.0.1, and an
# offline machine cannot resolve the system proxy it would otherwise use.
setsid "$browser" \ setsid "$browser" \
--app="$url" \ --app="$url" \
--user-data-dir="$DATA_DIR/window-profile" \ --user-data-dir="$DATA_DIR/window-profile" \
--class=Luminary \ --class=Luminary \
--no-first-run \ --no-first-run \
--no-default-browser-check \ --no-default-browser-check \
--no-proxy-server \
>/dev/null 2>&1 & >/dev/null 2>&1 &
return 0 return 0
fi fi
+5 -5
View File
@@ -3,8 +3,8 @@
`node linux/build.mjs --skip-build --publish` drops the finished artifacts here: `node linux/build.mjs --skip-build --publish` drops the finished artifacts here:
``` ```
Luminary-0.5.2-linux-x64.tar.gz portable bundle Luminary-0.5.3.1-linux-x64.tar.gz portable bundle
Luminary-0.5.2-linux-amd64.deb Ubuntu package Luminary-0.5.3.1-linux-amd64.deb Ubuntu package
SHA256SUMS.txt SHA256SUMS.txt
``` ```
@@ -16,11 +16,11 @@ Verify a copy with:
```bash ```bash
sha256sum -c SHA256SUMS.txt sha256sum -c SHA256SUMS.txt
tar -tzf Luminary-0.5.2-linux-x64.tar.gz | head tar -tzf Luminary-0.5.3.1-linux-x64.tar.gz | head
dpkg-deb --info Luminary-0.5.2-linux-amd64.deb dpkg-deb --info Luminary-0.5.3.1-linux-amd64.deb
``` ```
On Ubuntu the easiest install is `sudo apt install ./Luminary-0.5.2-linux-amd64.deb`, On Ubuntu the easiest install is `sudo apt install ./Luminary-0.5.3.1-linux-amd64.deb`,
which adds Luminary to the applications menu. The portable route is to extract which adds Luminary to the applications menu. The portable route is to extract
the whole tarball and run `./luminary` from the extracted `Luminary` folder; the whole tarball and run `./luminary` from the extracted `Luminary` folder;
`./install.sh` adds that copy to the applications menu. `./install.sh` adds that copy to the applications menu.
+4 -2
View File
@@ -1,2 +1,4 @@
5e5725d8b918b161d7fd0633049f90fa46d2892ba8930db4230b59c2f556602e Luminary-0.5.2-linux-x64.tar.gz 3b2a7ac1d5b0057ce0d3796b5e2a57024a5d7d655800ed55245c2f00141827fd Luminary-0.5.4-linux-x64.tar.gz
c7a8325e8a1a58880d30cbec167fe1f75feb8877b41fa8857200602e09ac5a96 Luminary-0.5.2-linux-amd64.deb 45043c4c71003ccf210b7ee5ae8c45a58406aa526fa13e7fdb6e26f89b8c52ec Luminary-0.5.4-linux-amd64.deb
895c6c5cffe47a17c18690fb55746d10c225e376721d70f233b10d635e5f2255 Luminary-0.5.4.1-linux-x64.tar.gz
d4aae7f9fb91a3c5eb66de284f8ed39977dd0b73d76e622e94d3b9ec98923e58 Luminary-0.5.4.1-linux-amd64.deb
+5 -5
View File
@@ -26,9 +26,9 @@ What it needs
and no administrator password are needed for day-to-day use. and no administrator password are needed for day-to-day use.
Start, stop and status Start, stop and status
Opening Luminary starts the local server and opens the editor. Opening it Opening Luminary starts the local engine and opens the editor. Opening it
again reuses the running copy instead of starting a second one. again reuses the running copy instead of starting a second one.
- Stop Luminary.command (next to the app in the disk image) stops the server. - Stop Luminary.command (next to the app in the disk image) stops it.
- The same commands are available from a terminal: - The same commands are available from a terminal:
/Applications/Luminary.app/Contents/Resources/launcher.sh --status /Applications/Luminary.app/Contents/Resources/launcher.sh --status
/Applications/Luminary.app/Contents/Resources/launcher.sh --stop /Applications/Luminary.app/Contents/Resources/launcher.sh --stop
@@ -46,13 +46,13 @@ Logs
~/Library/Application Support/Luminary/data/logs/server.err.log ~/Library/Application Support/Luminary/data/logs/server.err.log
Updating Updating
Quit the server (Stop Luminary.command), drag the new Luminary.app over the Stop the local engine (Stop Luminary.command), drag the new Luminary.app over the
old one, and start it again. The data folder is outside the app and is not old one, and start it again. The data folder is outside the app and is not
touched. The catalog migrates itself on first start. touched. The catalog migrates itself on first start.
Notes Notes
- The server listens on 127.0.0.1 only. For proofing galleries that other - The local engine listens on 127.0.0.1 only. For proofing galleries that
devices should reach, run the server yourself with HOST=0.0.0.0. other devices should reach, run it yourself with HOST=0.0.0.0.
- The app window is Chrome or Edge in app mode, using its own profile in the - The app window is Chrome or Edge in app mode, using its own profile in the
data folder, so it does not mix with your normal browsing. Set data folder, so it does not mix with your normal browsing. Set
LUMINARY_WINDOW=browser to open a normal tab instead. LUMINARY_WINDOW=browser to open a normal tab instead.
+2 -2
View File
@@ -44,8 +44,8 @@ Outputs:
``` ```
~/Library/Caches/luminary-macos/ ~/Library/Caches/luminary-macos/
stage/Luminary.app stage/Luminary.app
Luminary-0.5.2-mac-arm64.zip Luminary-0.5.3.1-mac-arm64.zip
Luminary-0.5.2-mac-arm64.dmg Luminary-0.5.3.1-mac-arm64.dmg
cache/ # downloaded node tarballs, icon work cache/ # downloaded node tarballs, icon work
``` ```
+1 -1
View File
@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Stop the Luminary server started by Luminary.app. # Stop the Luminary local engine started by Luminary.app.
# Double-clicking a .command file opens Terminal for as long as this runs. # Double-clicking a .command file opens Terminal for as long as this runs.
set -u set -u
+9 -5
View File
@@ -49,8 +49,10 @@ state_pid() {
sed -n 's/.*"pid"[[:space:]]*:[[:space:]]*\([0-9][0-9]*\).*/\1/p' "$STATE" | head -1 sed -n 's/.*"pid"[[:space:]]*:[[:space:]]*\([0-9][0-9]*\).*/\1/p' "$STATE" | head -1
} }
# --noproxy forces a direct connection: offline, curl would otherwise resolve
# the system proxy/PAC first and every health probe would fail.
healthy() { healthy() {
curl -fs -m 2 "http://127.0.0.1:$1/api/health" >/dev/null 2>&1 curl -fs -m 2 --noproxy '*' "http://127.0.0.1:$1/api/health" >/dev/null 2>&1
} }
# Ask node rather than nc: the bundle always has one, and nc's flags differ # Ask node rather than nc: the bundle always has one, and nc's flags differ
@@ -75,12 +77,14 @@ open_window() {
open -na "Google Chrome" --args \ open -na "Google Chrome" --args \
--app="$url" \ --app="$url" \
--user-data-dir="$DATA/window-profile-chrome" \ --user-data-dir="$DATA/window-profile-chrome" \
--window-size=1500,950 --no-first-run --no-default-browser-check --window-size=1500,950 --no-first-run --no-default-browser-check \
--no-proxy-server
elif [ -d "/Applications/Microsoft Edge.app" ] || [ -d "$HOME/Applications/Microsoft Edge.app" ]; then elif [ -d "/Applications/Microsoft Edge.app" ] || [ -d "$HOME/Applications/Microsoft Edge.app" ]; then
open -na "Microsoft Edge" --args \ open -na "Microsoft Edge" --args \
--app="$url" \ --app="$url" \
--user-data-dir="$DATA/window-profile-edge" \ --user-data-dir="$DATA/window-profile-edge" \
--window-size=1500,950 --no-first-run --no-default-browser-check --window-size=1500,950 --no-first-run --no-default-browser-check \
--no-proxy-server
else else
open "$url" open "$url"
fi fi
@@ -162,7 +166,7 @@ start() {
if ! kill -0 "$pid" 2>/dev/null; then if ! kill -0 "$pid" 2>/dev/null; then
rm -f "$STATE" rm -f "$STATE"
tail_logs tail_logs
dialog "Luminary's server stopped while starting. Log: $LOGS/server.err.log" dialog "Luminary's local engine stopped while starting. Log: $LOGS/server.err.log"
exit 1 exit 1
fi fi
sleep 0.5 sleep 0.5
@@ -232,7 +236,7 @@ Luminary.app launcher
No argument starts the app (or reuses a running copy) and opens the window. No argument starts the app (or reuses a running copy) and opens the window.
--browser open a normal browser tab instead of a Chrome/Edge app window --browser open a normal browser tab instead of a Chrome/Edge app window
--stop stop the server this bundle started --stop stop the local engine this bundle started
--status print version, pid, port, health and the data directory --status print version, pid, port, health and the data directory
--verify check that the bundle is complete --verify check that the bundle is complete
+18 -2
View File
@@ -1,14 +1,15 @@
{ {
"name": "luminary", "name": "luminary",
"version": "0.5.2", "version": "0.5.4.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "luminary", "name": "luminary",
"version": "0.5.2", "version": "0.5.4.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@jsquash/jxl": "^1.3.0",
"exifr": "^7.1.3", "exifr": "^7.1.3",
"libraw-wasm": "^1.6.0", "libraw-wasm": "^1.6.0",
"nodemailer": "^10.6.1", "nodemailer": "^10.6.1",
@@ -1259,6 +1260,15 @@
"@jridgewell/sourcemap-codec": "^1.4.14" "@jridgewell/sourcemap-codec": "^1.4.14"
} }
}, },
"node_modules/@jsquash/jxl": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@jsquash/jxl/-/jxl-1.3.0.tgz",
"integrity": "sha512-IVOPTneyOd9eBAuow+FnCYIP6wkIc7CjrCDnZGiqAPyJ63vMVxv3zoWiucGiZVh6u9vi/l40AkcS9QwkoVSAqA==",
"license": "Apache-2.0",
"dependencies": {
"wasm-feature-detect": "^1.5.1"
}
},
"node_modules/@rolldown/pluginutils": { "node_modules/@rolldown/pluginutils": {
"version": "1.0.0-beta.27", "version": "1.0.0-beta.27",
"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz",
@@ -3003,6 +3013,12 @@
} }
} }
}, },
"node_modules/wasm-feature-detect": {
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/wasm-feature-detect/-/wasm-feature-detect-1.10.1.tgz",
"integrity": "sha512-+wz9+WpMKgQ7H1tm41nJbFwAvwX4DqY0jNY8Blw5Qe6hHg1yhCJ+AqU0R4lgX7p3pyo8irYIl1+mMNoBwSj2Zg==",
"license": "Apache-2.0"
},
"node_modules/why-is-node-running": { "node_modules/why-is-node-running": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz",
+2 -1
View File
@@ -2,7 +2,7 @@
"name": "luminary", "name": "luminary",
"private": true, "private": true,
"license": "MIT", "license": "MIT",
"version": "0.5.2", "version": "0.5.4.1",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
@@ -21,6 +21,7 @@
"build:lens-db": "node scripts/build-lens-db.mjs" "build:lens-db": "node scripts/build-lens-db.mjs"
}, },
"dependencies": { "dependencies": {
"@jsquash/jxl": "^1.3.0",
"exifr": "^7.1.3", "exifr": "^7.1.3",
"libraw-wasm": "^1.6.0", "libraw-wasm": "^1.6.0",
"nodemailer": "^10.6.1", "nodemailer": "^10.6.1",
Binary file not shown.
+6
View File
@@ -122,6 +122,12 @@ function main() {
const sudoLines = SUDO_PASS ? `${SUDO_PASS}\n${SUDO_PASS}\n` : undefined; const sudoLines = SUDO_PASS ? `${SUDO_PASS}\n${SUDO_PASS}\n` : undefined;
const script = [ const script = [
`cd ${REMOTE_PATH} || exit 3`, `cd ${REMOTE_PATH} || exit 3`,
// node_modules is excluded from the rsync, so a new dependency in the
// lockfile would otherwise fail the build on a server that has never
// installed it. Installed as the login user: the checkout belongs to them.
'npm ci --no-audit --no-fund',
'deps=$?',
'[ "$deps" -eq 0 ] || { echo "deploy: remote npm ci failed ($deps)"; exit "$deps"; }',
`${sudo}npm run build`, `${sudo}npm run build`,
'build=$?', 'build=$?',
'[ "$build" -eq 0 ] || { echo "deploy: remote build failed ($build)"; exit "$build"; }', '[ "$build" -eq 0 ] || { echo "deploy: remote build failed ($build)"; exit "$build"; }',
+41 -1
View File
@@ -379,6 +379,26 @@ try {
const lensTintOn = pixelAt(0.625, 0.469); const lensTintOn = pixelAt(0.625, 0.469);
const lensTintOff = pixelAt(0.7, 0.469); const lensTintOff = pixelAt(0.7, 0.469);
// Before / after split: the edit is drawn full-frame, then the untouched
// source is painted over the left slice. Reading the same band either side of
// the line must give the moved slider on the right and the default on the
// left, which is what proves the scissor lands where the drag line sits.
const splitAfter = defaultEdits();
splitAfter.exposure = 2;
renderer.render(splitAfter, { width: w, height: h });
const splitAfterFull = pixelAt(0.75, 0.5);
renderer.render(defaultEdits(), { width: w, height: h });
const splitBeforeFull = pixelAt(0.75, 0.5);
renderer.render(splitAfter, { width: w, height: h });
renderer.render(defaultEdits(), {
width: w,
height: h,
scissor: { x: 0, w: Math.round(w / 2) },
});
const splitLeft = pixelAt(0.25, 0.5);
const splitRight = pixelAt(0.75, 0.5);
const sameRgb = (a, b) => a.every((v, i) => Math.abs(v - b[i]) <= 1);
pre.textContent = 'RESULT ' + JSON.stringify({ pre.textContent = 'RESULT ' + JSON.stringify({
clipPixels, clipPixels,
clipRed: near(clipPixels[0], RED_MARK), clipRed: near(clipPixels[0], RED_MARK),
@@ -437,6 +457,14 @@ try {
cropDetailBounded: Math.abs(cropDetailOff[2] - cropRefOff[2]) <= 3, cropDetailBounded: Math.abs(cropDetailOff[2] - cropRefOff[2]) <= 3,
lensTintAligned: lensTintOn[0] > lensRef[0] + 40, lensTintAligned: lensTintOn[0] > lensRef[0] + 40,
lensTintBounded: Math.abs(lensTintOff[0] - lensRefOff[0]) <= 2, lensTintBounded: Math.abs(lensTintOff[0] - lensRefOff[0]) <= 2,
splitLeft,
splitRight,
splitBeforeFull,
splitAfterFull,
splitShowsBoth:
sameRgb(splitLeft, splitBeforeFull) &&
sameRgb(splitRight, splitAfterFull) &&
!sameRgb(splitAfterFull, splitBeforeFull),
tintStrengthWorks: tintFull[2] > tintCore[2] + 8, tintStrengthWorks: tintFull[2] > tintCore[2] + 8,
tintOffMatches: Math.abs(tintOffPixel[2] - dabSoft[2]) <= 1, tintOffMatches: Math.abs(tintOffPixel[2] - dabSoft[2]) <= 1,
// A hard dab covers the core, and even an 80 % feather stops at the rim. // A hard dab covers the core, and even an 80 % feather stops at the rim.
@@ -702,6 +730,14 @@ async function main() {
); );
return 1; return 1;
} }
if (!result.splitShowsBoth) {
console.error(
'render check FAILED: the before / after split does not follow its drag line ' +
`(left=${JSON.stringify(result.splitLeft)} vs ${JSON.stringify(result.splitBeforeFull)}, ` +
`right=${JSON.stringify(result.splitRight)} vs ${JSON.stringify(result.splitAfterFull)}).`,
);
return 1;
}
if ( if (
!result.dabCoreDarkened || !result.dabCoreDarkened ||
!result.dabSoftCoreDarkened || !result.dabSoftCoreDarkened ||
@@ -722,7 +758,11 @@ async function main() {
return 1; return 1;
} }
console.log( console.log(
'render check PASSED: proxy and sidecar share a row order and the clipping overlay names the channels.', `render check: before / after split left=${JSON.stringify(result.splitLeft)}` +
` right=${JSON.stringify(result.splitRight)}`,
);
console.log(
'render check PASSED: proxy and sidecar share a row order, the clipping overlay names the channels, and the split keeps each side to its own edit.',
); );
return 0; return 0;
} }
+54
View File
@@ -0,0 +1,54 @@
/**
* Runs the camera-to-sRGB conversion off the main thread when it can.
*
* The conversion is CPU-bound and synchronous, so at four parallel imports it
* was the widest serial section left in the pipeline: four 24 MP frames cost
* ~10 s of event-loop time on top of the demosaic. A worker takes that loop off
* the main thread while the decoder pool and zlib keep their own threads.
*
* The frame is shared rather than transferred: `toRgb` allocates both buffers
* on SharedArrayBuffer, so `postMessage` hands over views and the worker writes
* the same memory the encoder will read. A frame that is not shared (a caller
* outside the raw pipeline) stays on this thread instead of being copied.
*/
import { Worker } from 'node:worker_threads';
import { cameraToProxy } from './color.mjs';
function isShared(view) {
return view?.buffer instanceof SharedArrayBuffer;
}
function runInWorker(rgb16, rgb8, matrix) {
return new Promise((resolve, reject) => {
const worker = new Worker(new URL('./color-worker.mjs', import.meta.url), {
workerData: { rgb16, rgb8, matrix },
});
let settled = false;
const finish = (fn, value) => {
if (settled) return;
settled = true;
worker.terminate().catch(() => {});
fn(value);
};
worker.once('message', (message) => {
if (message?.error) finish(reject, new Error(message.error));
else finish(resolve, message?.gain);
});
worker.once('error', (error) => finish(reject, error));
worker.once('exit', (code) => {
// A clean exit arrives after the message; only a crash before it is an error.
if (code !== 0) finish(reject, new Error(`colour worker exited with code ${code}`));
});
});
}
/**
* Applies the camera matrix to the frame in place and resolves with the white
* point gain, exactly like `cameraToProxy`. A worker failure rejects rather
* than re-running the conversion here: the worker may have written part of the
* frame, and applying it again would double the white point.
*/
export async function cameraToProxyAsync(rgb16, rgb8, matrix) {
if (!isShared(rgb16) || !isShared(rgb8)) return cameraToProxy(rgb16, rgb8, matrix);
return runInWorker(rgb16, rgb8, matrix);
}
+17
View File
@@ -0,0 +1,17 @@
/**
* Off-main-thread camera-to-proxy conversion.
*
* `cameraToProxy` is a pixel loop over the whole frame: 2.4 s on a 24 MP decode
* here, and four parallel imports serialised on it. The buffers arrive as
* SharedArrayBuffer views, so the worker mutates the frame in place and nothing
* is copied across the thread boundary.
*/
import { parentPort, workerData } from 'node:worker_threads';
import { cameraToProxy } from './color.mjs';
try {
const gain = cameraToProxy(workerData.rgb16, workerData.rgb8, workerData.matrix);
parentPort.postMessage({ gain });
} catch (error) {
parentPort.postMessage({ error: error instanceof Error ? error.message : String(error) });
}
+14
View File
@@ -107,3 +107,17 @@ export const RAW_WORKERS = Math.max(
/** Idle decoder workers are disposed after this long to release memory. */ /** Idle decoder workers are disposed after this long to release memory. */
export const RAW_IDLE_MS = Number(setting('RAW_IDLE_MS', '90000')); export const RAW_IDLE_MS = Number(setting('RAW_IDLE_MS', '90000'));
/**
* Demosaic setting for Fujifilm X-Trans sensors. LibRaw reads `userQual` as
* Markesteijn passes for X-Trans, and the 3-pass default costs about 50 s on a
* 40 MP frame while 1-pass costs about 9 s. The proxy is downsampled to
* RAW_PREVIEW_EDGE, so the difference does not survive to the editor.
*/
export const RAW_XTRANS_QUALITY = Math.min(
3,
Math.max(1, Number(setting('RAW_XTRANS_QUALITY', '1')) || 1),
);
/** Ceiling on one demosaic, measured from when a worker picks the job up. */
export const RAW_TIMEOUT_MS = Number(setting('RAW_TIMEOUT_MS', '120000'));
+40 -1
View File
@@ -119,7 +119,38 @@ export function resizeRgb16(rgb16, width, height, tw, th) {
* client would have to guess the conversion, and a self-describing sidecar also * client would have to guess the conversion, and a self-describing sidecar also
* keeps working for imports that predate a catalogue migration. * keeps working for imports that predate a catalogue migration.
*/ */
/**
* Deflate settings for the 16-bit sidecar. RLE wins here because the rows are
* Sub-filtered first: a photographic row turns into mostly small byte
* differences, and run-length coding stores them in a few bits each. On a
* 40 MP sidecar this took compression from 2.87 s to 1.10 s and the file from
* 58.47 MB to 58.06 MB; the decoded samples are byte-identical.
*/
const SIDECAR_DEFLATE = { level: 6, strategy: zlib.constants.Z_RLE };
export function encodePng16(rgb16, width, height, matrix = null) { export function encodePng16(rgb16, width, height, matrix = null) {
const raw = png16Rows(rgb16, width, height);
return png16File(zlib.deflateSync(raw, SIDECAR_DEFLATE), width, height, matrix);
}
/**
* The same PNG, with the deflate handed to libuv's thread pool.
*
* A 40 MP sidecar is ~110 MB and takes about five seconds to compress. Run
* synchronously that stalls the entire server for the duration, so four
* parallel imports finished one after another while the event loop was busy;
* the import felt frozen and preview requests queued behind it.
*/
export async function encodePng16Async(rgb16, width, height, matrix = null) {
const raw = png16Rows(rgb16, width, height);
const idat = await new Promise((resolve, reject) => {
zlib.deflate(raw, SIDECAR_DEFLATE, (err, out) => (err ? reject(err) : resolve(out)));
});
return png16File(idat, width, height, matrix);
}
/** Sub-filtered rows: each byte minus the byte six to its left. */
function png16Rows(rgb16, width, height) {
const stride = width * 6; const stride = width * 6;
const raw = Buffer.alloc((stride + 1) * height); const raw = Buffer.alloc((stride + 1) * height);
const row = Buffer.alloc(stride); const row = Buffer.alloc(stride);
@@ -134,7 +165,10 @@ export function encodePng16(rgb16, width, height, matrix = null) {
raw[base + 1 + i] = (row[i] - (i >= 6 ? row[i - 6] : 0)) & 0xff; raw[base + 1 + i] = (row[i] - (i >= 6 ? row[i - 6] : 0)) & 0xff;
} }
} }
const idat = zlib.deflateSync(raw, { level: 6 }); return raw;
}
function png16File(idat, width, height, matrix = null) {
const ihdr = Buffer.alloc(13); const ihdr = Buffer.alloc(13);
ihdr.writeUInt32BE(width, 0); ihdr.writeUInt32BE(width, 0);
ihdr.writeUInt32BE(height, 4); ihdr.writeUInt32BE(height, 4);
@@ -199,7 +233,12 @@ export async function cameraThumb16(png16, width, height, matrix = null) {
const sharp = await loadSharp(); const sharp = await loadSharp();
if (!sharp || width < 1 || height < 1) return null; if (!sharp || width < 1 || height < 1) return null;
try { try {
// `depth: 'ushort'` on the output only sets the container: without asking
// for the rgb16 colourspace, libvips runs the resize on 8-bit pixels and the
// samples come back as their high bytes alone (7 instead of 2000), which
// renders as a near-black tile.
const { data, info } = await sharp(png16) const { data, info } = await sharp(png16)
.toColourspace('rgb16')
.resize({ width, height, fit: 'fill' }) .resize({ width, height, fit: 'fill' })
.raw({ depth: 'ushort' }) .raw({ depth: 'ushort' })
.toBuffer({ resolveWithObject: true }); .toBuffer({ resolveWithObject: true });
+14
View File
@@ -1,3 +1,4 @@
import sharp from 'sharp';
import { describe, expect, it } from 'vitest'; import { describe, expect, it } from 'vitest';
import { cameraThumb16, encodePng16, png16Matrix, resizeRgb16 } from './imaging.mjs'; import { cameraThumb16, encodePng16, png16Matrix, resizeRgb16 } from './imaging.mjs';
@@ -75,6 +76,19 @@ describe('cameraThumb16', () => {
expect(out[25]).toBe(2); // colour type RGB expect(out[25]).toBe(2); // colour type RGB
}); });
it('keeps the full 16-bit samples, not just their high bytes', async () => {
// sharp's raw output is 8-bit unless the pipeline is asked for rgb16, and a
// downconverted thumbnail decodes to 7/15/23 instead of 2000/4000/6000.
const source = encodePng16(flat16(4, 2, [2000, 4000, 6000]), 4, 2, MATRIX);
const out = await cameraThumb16(source, 2, 1);
const { data } = await sharp(out)
.toColourspace('rgb16')
.raw({ depth: 'ushort' })
.toBuffer({ resolveWithObject: true });
const samples = [0, 2, 4].map((at) => data.readUInt16LE(at));
expect(samples).toEqual([2000, 4000, 6000]);
});
it('keeps the camera matrix so the client can convert the samples', async () => { it('keeps the camera matrix so the client can convert the samples', async () => {
const source = encodePng16(flat16(4, 2, [1000, 2000, 3000]), 4, 2, MATRIX); const source = encodePng16(flat16(4, 2, [1000, 2000, 3000]), 4, 2, MATRIX);
const out = await cameraThumb16(source, 2, 1); const out = await cameraThumb16(source, 2, 1);
+5 -1
View File
@@ -2182,6 +2182,10 @@ route('POST', '/api/photos/:id/original', async ({ req, res, params }) => {
const url = new URL(req.url ?? '/', 'http://localhost'); const url = new URL(req.url ?? '/', 'http://localhost');
const name = url.searchParams.get('name') || 'upload'; const name = url.searchParams.get('name') || 'upload';
const drop = url.searchParams.get('drop') === '1'; const drop = url.searchParams.get('drop') === '1';
// The import dialog can ask for an 8-bit import; anything else keeps the
// LUMINARY_16BIT setting. Only `sidecar=0` is meaningful, so the default path
// behaves exactly as before.
const sidecar = url.searchParams.get('sidecar') !== '0';
const mime = normalizePhotoMime(url.searchParams.get('mime') || '', name); const mime = normalizePhotoMime(url.searchParams.get('mime') || '', name);
const ext = (name.split('.').pop() || 'bin').toLowerCase(); const ext = (name.split('.').pop() || 'bin').toLowerCase();
// TIFF is not a raw container, but browsers cannot decode it either. It takes // TIFF is not a raw container, but browsers cannot decode it either. It takes
@@ -2276,7 +2280,7 @@ route('POST', '/api/photos/:id/original', async ({ req, res, params }) => {
if (raw) { if (raw) {
try { try {
const data = await fsp.readFile(target); const data = await fsp.readFile(target);
const decoded = still ? await decodeStill(data) : await decodeRaw(data); const decoded = still ? await decodeStill(data) : await decodeRaw(data, { sidecar });
await writePreview(params.id, decoded.jpeg, decoded.ext); await writePreview(params.id, decoded.jpeg, decoded.ext);
if (decoded.preview16) { if (decoded.preview16) {
await writePreview16(params.id, decoded.preview16.data); await writePreview16(params.id, decoded.preview16.data);
+26 -3
View File
@@ -88,17 +88,40 @@ class LibRawPool {
} }
} }
/** Run `fn` with a decoder instance; the instance returns to the pool after. */ /**
async use(fn) { * Run `fn` with a decoder instance; the instance returns to the pool after.
*
* `timeoutMs` covers only the work, never the wait for a free worker: a job
* that sat in the queue is not slow, and timing it from the call site made
* parallel imports fail in waves. A timed-out worker is still chewing on the
* abandoned job, so it is destroyed rather than handed to the next caller.
*/
async use(fn, { timeoutMs = 0, label = 'LibRaw' } = {}) {
const lib = await this.acquire(); const lib = await this.acquire();
let healthy = true; let healthy = true;
let timer = null;
try { try {
return await fn(lib); if (!timeoutMs) return await fn(lib);
const guard = new Promise((_, reject) => {
timer = setTimeout(
() => reject(new Error(`${label} timed out on this file`)),
timeoutMs,
);
});
try {
return await Promise.race([fn(lib), guard]);
} catch (err) {
if (timer && /timed out/.test(String(err?.message ?? '')) && err instanceof Error) {
healthy = false;
}
throw err;
}
} catch (err) { } catch (err) {
// A dead worker keeps failing, so recycle it instead of handing it back. // A dead worker keeps failing, so recycle it instead of handing it back.
if (/worker|terminated|disposed|memory/i.test(String(err?.message ?? ''))) healthy = false; if (/worker|terminated|disposed|memory/i.test(String(err?.message ?? ''))) healthy = false;
throw err; throw err;
} finally { } finally {
if (timer) clearTimeout(timer);
this.release(lib, healthy); this.release(lib, healthy);
} }
} }
+121 -53
View File
@@ -1,6 +1,14 @@
import { RAW_16BIT, RAW_PREVIEW_EDGE } from './config.mjs'; import { RAW_16BIT, RAW_PREVIEW_EDGE, RAW_TIMEOUT_MS, RAW_XTRANS_QUALITY } from './config.mjs';
import { cameraToProxy, readRgbCam } from './color.mjs'; import { readRgbCam } from './color.mjs';
import { encodePng16, encodeRgb, jpegInfo, loadSharp, resizeRgb16, toJpegProxy } from './imaging.mjs'; import { cameraToProxyAsync } from './color-offload.mjs';
import {
encodePng16Async,
encodeRgb,
jpegInfo,
loadSharp,
resizeRgb16,
toJpegProxy,
} from './imaging.mjs';
import { loadLibRaw, rawPool } from './libraw-pool.mjs'; import { loadLibRaw, rawPool } from './libraw-pool.mjs';
/** Every raw container the pipeline will attempt, grouped by vendor family. */ /** Every raw container the pipeline will attempt, grouped by vendor family. */
@@ -39,15 +47,6 @@ export function isStillName(name = '') {
return SERVER_IMAGE_EXTENSIONS.has(ext); return SERVER_IMAGE_EXTENSIONS.has(ext);
} }
/** Rejects instead of waiting forever when a decoder wedges on one file. */
function withTimeout(promise, ms, message) {
let timer;
const guard = new Promise((_, reject) => {
timer = setTimeout(() => reject(new Error(message)), ms);
});
return Promise.race([promise, guard]).finally(() => clearTimeout(timer));
}
/** True when the buffer starts with a container signature LibRaw can open. */ /** True when the buffer starts with a container signature LibRaw can open. */
export function looksLikeRaw(buffer) { export function looksLikeRaw(buffer) {
if (!buffer || buffer.length < 64) return false; if (!buffer || buffer.length < 64) return false;
@@ -146,11 +145,14 @@ function toRgb(img) {
); );
} }
const rgb = Buffer.alloc(pixelCount * 3); // Both outputs are shared memory: the camera-to-sRGB pass runs in a worker
// (color-offload.mjs) and writes these same bytes, so a 24 MP frame is not
// copied across the thread boundary.
const rgb = Buffer.from(new SharedArrayBuffer(pixelCount * 3));
let rgb16 = null; let rgb16 = null;
if (bits > 8) { if (bits > 8) {
const view = wide instanceof Uint16Array ? wide : src; const view = wide instanceof Uint16Array ? wide : src;
rgb16 = new Uint16Array(pixelCount * 3); rgb16 = new Uint16Array(new SharedArrayBuffer(pixelCount * 3 * 2));
for (let i = 0; i < pixelCount; i++) { for (let i = 0; i < pixelCount; i++) {
const s = i * colors; const s = i * colors;
const r = view[s]; const r = view[s];
@@ -182,91 +184,153 @@ function toRgb(img) {
* matrix metadata. A body LibRaw has no matrix for falls back to the plain sRGB * matrix metadata. A body LibRaw has no matrix for falls back to the plain sRGB
* decode, which is the same result the pipeline produced before. * decode, which is the same result the pipeline produced before.
*/ */
async function demosaic(buffer, cameraNative = true) { /**
* Fujifilm bodies that are *not* X-Trans: the Bayer-sensor GFX and X-A/T100/T200
* lines, plus the old FinePix compacts. Everyone else in the X series uses the
* 6x6 colour filter array.
*/
function isXTrans(make, model) {
if (!/fuji/i.test(String(make ?? ''))) return false;
const m = String(model ?? '').trim();
if (/^(gfx|finepix)/i.test(m)) return false;
if (/^x-(a\d|t100|t200)\b/i.test(m)) return false;
return /^x/i.test(m);
}
/**
* Demosaic one frame. On X-Trans the `userQual` setting counts Markesteijn
* passes, and LibRaw's 3-pass default is the single most expensive thing this
* pipeline does: 49.9 s on a 40 MP X-T5 frame here, against 8.8 s for one pass,
* which pushed every Fuji import into the decode timeout (and, under a parallel
* import, every file at once). The proxy is downsampled to RAW_PREVIEW_EDGE, so
* the extra passes were being thrown away by the resize anyway.
*
* The model is only known after the container is opened, and opening is ~0.2 s,
* so the file is re-opened with the cheaper setting rather than guessing from
* the filename.
*/
async function demosaic(buffer, { cameraNative = true } = {}) {
if ((await rawEngine()) !== 'ready') throw new Error('LibRaw is not installed'); if ((await rawEngine()) !== 'ready') throw new Error('LibRaw is not installed');
return rawPool.use(async (lib) => { return rawPool.use(
async (lib) => {
const settings = cameraNative
? DECODE_SETTINGS
: { ...DECODE_SETTINGS, outputColor: 1, noAutoBright: false };
// LibRaw transfers the buffer to its worker, which detaches it here. Hand it // LibRaw transfers the buffer to its worker, which detaches it here. Hand it
// a copy so the caller's bytes survive for the embedded-preview fallback. // a copy so the caller's bytes survive for the embedded-preview fallback.
await lib.open( await lib.open(Buffer.from(buffer), settings);
Buffer.from(buffer), if (settings.userQual > RAW_XTRANS_QUALITY) {
cameraNative ? DECODE_SETTINGS : { ...DECODE_SETTINGS, outputColor: 1, noAutoBright: false }, const info = await lib.metadata();
); if (isXTrans(info?.camera_make, info?.camera_model)) {
await lib.open(Buffer.from(buffer), { ...settings, userQual: RAW_XTRANS_QUALITY });
}
}
const image = toRgb(await lib.imageData()); const image = toRgb(await lib.imageData());
const rgbCam = cameraNative ? readRgbCam(await lib.metadata(true)) : null; const rgbCam = cameraNative ? readRgbCam(await lib.metadata(true)) : null;
return { ...image, rgbCam }; return { ...image, rgbCam };
}); },
{ timeoutMs: RAW_TIMEOUT_MS, label: 'LibRaw' },
);
} }
const SOI = Buffer.from([0xff, 0xd8, 0xff]); const SOI = Buffer.from([0xff, 0xd8, 0xff]);
const EOI = Buffer.from([0xff, 0xd9]); const EOI = Buffer.from([0xff, 0xd9]);
/** Pull the largest embedded JPEG straight out of a raw container. */ /**
export function extractEmbeddedJpeg(buffer) { * Every embedded JPEG in a raw container, largest first.
let best = null; *
let from = 0; * A single scan can land on a thumbnail's end-of-image and cut the file short:
while (from < buffer.length - 3) { * that produced a "preview" sharp refused to decode, which was then stored as a
const start = buffer.indexOf(SOI, from); * 0x0 JPEG. Callers walk the list and keep the first candidate that really
* decodes.
*/
export function extractEmbeddedJpegs(buffer) {
const starts = [];
let at = 0;
while (starts.length < 64) {
const start = buffer.indexOf(SOI, at);
if (start < 0) break; if (start < 0) break;
const end = buffer.indexOf(EOI, start + 3); starts.push(start);
at = start + 3;
}
const found = [];
for (const start of starts) {
// Several end-of-image markers can follow one start: a preview that carries
// its own EXIF thumbnail ends twice. Take a few candidates per start and let
// the decoder pick, instead of committing to the first marker found.
let from = start + 3;
for (let attempt = 0; attempt < 3; attempt++) {
const end = buffer.indexOf(EOI, from);
if (end < 0) break; if (end < 0) break;
const length = end + 2 - start; if (end + 2 - start > 4096) found.push(buffer.subarray(start, end + 2));
if (length > 4096 && (!best || length > best.length)) best = buffer.subarray(start, end + 2);
from = end + 2; from = end + 2;
} }
return best; }
return found.sort((a, b) => b.length - a.length);
} }
/** Camera preview, preferably the one LibRaw knows the offset and length of. */ /** The largest embedded JPEG, for callers that want one candidate. */
async function embeddedPreview(buffer) { export function extractEmbeddedJpeg(buffer) {
return extractEmbeddedJpegs(buffer)[0] ?? null;
}
/** Camera previews, best first: the one LibRaw knows about, then byte-scanned. */
async function embeddedPreviews(buffer) {
const candidates = [];
if ((await rawEngine()) === 'ready') { if ((await rawEngine()) === 'ready') {
try { try {
const thumb = await withTimeout( const thumb = await rawPool.use(
rawPool.use(async (lib) => { async (lib) => {
await lib.open(Buffer.from(buffer), { useCameraWb: true }); await lib.open(Buffer.from(buffer), { useCameraWb: true });
return lib.thumbnailData(); return lib.thumbnailData();
}), },
12000, { timeoutMs: 20000, label: 'LibRaw preview' },
'LibRaw preview timed out',
); );
if (thumb?.data && thumb.format === 'jpeg' && thumb.data.length > 4096) { if (thumb?.data && thumb.format === 'jpeg' && thumb.data.length > 4096) {
return Buffer.from(thumb.data); candidates.push(Buffer.from(thumb.data));
} }
} catch { } catch {
/* fall through to the byte scan */ /* fall through to the byte scan */
} }
} }
return extractEmbeddedJpeg(buffer); candidates.push(...extractEmbeddedJpegs(buffer));
return candidates;
} }
/** /**
* Convert a raw file into an editable JPEG. LibRaw demosaics where possible and * Convert a raw file into an editable JPEG. LibRaw demosaics where possible and
* falls back to the camera's own embedded preview when it cannot. * falls back to the camera's own embedded preview when it cannot.
*
* `sidecar` writes the 16-bit samples beside the JPEG. It defaults to the
* server setting, and the import dialog can turn it off for one import: an
* 8-bit import decodes exactly the same, it just skips the second encode and the
* tens of megabytes of disk it costs.
*/ */
export async function decodeRaw(buffer) { export async function decodeRaw(buffer, { sidecar = RAW_16BIT } = {}) {
let librawError = null; let librawError = null;
if (looksLikeRaw(buffer)) { if (looksLikeRaw(buffer)) {
try { try {
let frame = await withTimeout(demosaic(buffer, true), 45000, 'LibRaw timed out on this file'); let frame = await demosaic(buffer, { cameraNative: true });
// No usable matrix (an odd body or older engine): decode the familiar sRGB // No usable matrix (an odd body or older engine): decode the familiar sRGB
// way instead of shipping camera samples nobody can convert. // way instead of shipping camera samples nobody can convert.
if (!frame.rgbCam || !frame.rgb16) frame = await withTimeout(demosaic(buffer, false), 45000, 'LibRaw timed out on this file'); if (!frame.rgbCam || !frame.rgb16) frame = await demosaic(buffer, { cameraNative: false });
const { width, height, rgbCam } = frame; const { width, height, rgbCam } = frame;
// Both buffers are rewritten in place: `rgb` becomes the sRGB proxy and // Both buffers are rewritten in place: `rgb` becomes the sRGB proxy and
// `rgb16` the camera-native sidecar, sharing one white point. // `rgb16` the camera-native sidecar, sharing one white point.
if (rgbCam && frame.rgb16) cameraToProxy(frame.rgb16, frame.rgb, rgbCam); if (rgbCam && frame.rgb16) await cameraToProxyAsync(frame.rgb16, frame.rgb, rgbCam);
const { rgb } = frame; const { rgb } = frame;
const encoded = await encodeRgb(rgb, width, height, 92, RAW_PREVIEW_EDGE); const encoded = await encodeRgb(rgb, width, height, 92, RAW_PREVIEW_EDGE);
// The sidecar must match the JPEG pixel for pixel: the editor swaps the // The sidecar must match the JPEG pixel for pixel: the editor swaps the
// two textures at the same uv, so a size disagreement would misalign the // two textures at the same uv, so a size disagreement would misalign the
// whole grade. It is optional -- encoding failures leave the JPEG path. // whole grade. It is optional -- encoding failures leave the JPEG path.
let preview16 = null; let preview16 = null;
if (frame.rgb16 && RAW_16BIT) { if (frame.rgb16 && sidecar) {
try { try {
const scaled = resizeRgb16(frame.rgb16, width, height, encoded.width, encoded.height); const scaled = resizeRgb16(frame.rgb16, width, height, encoded.width, encoded.height);
preview16 = { preview16 = {
// The matrix travels with the samples so the editor knows how to // The matrix travels with the samples so the editor knows how to
// turn camera RGB into sRGB without a second metadata fetch. // turn camera RGB into sRGB without a second metadata fetch.
data: encodePng16(scaled, encoded.width, encoded.height, rgbCam), data: await encodePng16Async(scaled, encoded.width, encoded.height, rgbCam),
width: encoded.width, width: encoded.width,
height: encoded.height, height: encoded.height,
rgbCam, rgbCam,
@@ -290,22 +354,26 @@ export async function decodeRaw(buffer) {
librawError = 'not a recognised raw container'; librawError = 'not a recognised raw container';
} }
const embedded = await embeddedPreview(buffer); // Keep the first candidate that sharp can actually decode. Never store bytes
if (embedded) { // that did not decode: a 0x0 "preview" is an unopenable photo in the catalog.
// A handful of candidates is enough; each rejected one costs a header parse,
// not a full decode.
for (const embedded of (await embeddedPreviews(buffer)).slice(0, 6)) {
const proxy = await toJpegProxy(embedded, RAW_PREVIEW_EDGE); const proxy = await toJpegProxy(embedded, RAW_PREVIEW_EDGE);
if (proxy) { if (!proxy) continue;
const size = await jpegInfo(proxy.data); const size = await jpegInfo(proxy.data);
const width = size?.width || proxy.width;
const height = size?.height || proxy.height;
if (!width || !height) continue;
return { return {
jpeg: proxy.data, jpeg: proxy.data,
width: size?.width || proxy.width, width,
height: size?.height || proxy.height, height,
engine: 'embedded', engine: 'embedded',
ext: proxy.ext, ext: proxy.ext,
note: `LibRaw could not decode this file (${librawError}); using the camera preview.`, note: `LibRaw could not decode this file (${librawError}); using the camera preview.`,
}; };
} }
return { jpeg: embedded, width: 0, height: 0, engine: 'embedded', ext: 'jpg', note: librawError ?? undefined };
}
throw new Error( throw new Error(
`Could not decode this raw file. ${librawError ? `LibRaw said: ${librawError}.` : 'LibRaw is not installed.'}`, `Could not decode this raw file. ${librawError ? `LibRaw said: ${librawError}.` : 'LibRaw is not installed.'}`,
+51
View File
@@ -4,6 +4,7 @@ import { describe, expect, it } from 'vitest';
import { import {
RAW_EXTENSIONS, RAW_EXTENSIONS,
decodeRaw, decodeRaw,
extractEmbeddedJpegs,
decodeStill, decodeStill,
isRawName, isRawName,
isStillName, isStillName,
@@ -52,6 +53,56 @@ describe('raw format coverage', () => {
}); });
}); });
const JPEG_SOI = Buffer.from([0xff, 0xd8, 0xff]);
const JPEG_EOI = Buffer.from([0xff, 0xd9]);
/** A JPEG-shaped run of `total` bytes with no nested markers. */
function jpegBytes(total) {
return Buffer.concat([JPEG_SOI, Buffer.alloc(Math.max(1, total - 5), 0x11), JPEG_EOI]);
}
describe('embedded preview fallback', () => {
it('lists candidates largest first and ignores thumbnail-sized runs', () => {
const small = jpegBytes(9000);
const big = jpegBytes(90000);
const tiny = jpegBytes(1200);
const buffer = Buffer.concat([
Buffer.alloc(128),
small,
Buffer.alloc(32),
big,
Buffer.alloc(32),
tiny,
Buffer.alloc(32),
]);
const lengths = extractEmbeddedJpegs(buffer).map((jpeg) => jpeg.length);
// Splitting candidates at every end-of-image marker can yield over-long
// slices that span two images; those fail to decode and are skipped. What
// matters is that both real previews are offered, largest first, and that
// thumbnail-sized runs are not.
expect(lengths).toEqual([...lengths].sort((a, b) => b - a));
expect(lengths).toContain(big.length);
expect(lengths).toContain(small.length);
expect(lengths).not.toContain(tiny.length);
});
it('does not let a nested EXIF thumbnail truncate the full preview', () => {
// Regression: the scan used to stop at the thumbnail's end-of-image, so the
// "preview" it stored was a cut-off JPEG that sharp refused to decode and
// the import ended up as a 0x0 photo.
const thumb = jpegBytes(6000);
const outer = Buffer.concat([
JPEG_SOI,
Buffer.alloc(2000, 0x11),
thumb,
Buffer.alloc(40000, 0x11),
JPEG_EOI,
]);
const found = extractEmbeddedJpegs(Buffer.concat([Buffer.alloc(64), outer]));
expect(found[0].length).toBe(outer.length);
});
});
describe('TIFF decoding', () => { describe('TIFF decoding', () => {
it('turns a TIFF into a JPEG proxy', async () => { it('turns a TIFF into a JPEG proxy', async () => {
const { default: sharp } = await import('sharp'); const { default: sharp } = await import('sharp');
+60 -5
View File
@@ -71,7 +71,7 @@ import type { MergeResult } from './lib/merge';
import { evictBitmap } from './lib/images'; import { evictBitmap } from './lib/images';
import { importFiles, uid } from './lib/import'; import { importFiles, uid } from './lib/import';
import { PRESETS } from './lib/presets'; import { PRESETS } from './lib/presets';
import { downloadXmp, readXmpFile, xmpToEdits } from './lib/xmp'; import { downloadXmp, readXmpFile, xmpToEdits, xmpToMetadata } from './lib/xmp';
import type { import type {
Edits, Edits,
EventRecord, EventRecord,
@@ -2099,12 +2099,63 @@ export default function App() {
try { try {
const xml = await readXmpFile(); const xml = await readXmpFile();
if (!xml) return; if (!xml) return;
// A sidecar can carry a grade, cataloguing fields, or both. Read the two
// halves independently: a metadata-only file from a DAM must not fail for
// lacking crs: settings, and a grade must not be rejected for lacking
// keywords. Whichever half is present is applied; neither wipes the other.
let edits = target.edits;
let settingsNote = '';
try {
const result = xmpToEdits(xml, target.edits); const result = xmpToEdits(xml, target.edits);
updatePhoto(target.id, { edits: result.edits }, 'Import XMP sidecar'); edits = result.edits;
setToast( settingsNote =
result.source === 'luminary' result.source === 'luminary'
? 'Imported Luminary settings from the sidecar' ? 'Luminary settings'
: `Imported ${result.applied.length} Lightroom setting${result.applied.length === 1 ? '' : 's'}`, : `${result.applied.length} Lightroom setting${result.applied.length === 1 ? '' : 's'}`;
} catch {
settingsNote = '';
}
const meta = xmpToMetadata(xml);
const patch: Partial<PhotoRecord> = {};
const fields: string[] = [];
if (edits !== target.edits) patch.edits = edits;
if (meta.rating !== undefined) {
patch.rating = meta.rating;
fields.push('rating');
}
if (meta.label) {
patch.color = meta.label;
fields.push('label');
}
const keywords = new Set(target.keywords);
for (const word of meta.keywords) keywords.add(word);
if (keywords.size !== target.keywords.length) {
patch.keywords = [...keywords];
fields.push('keywords');
}
const paths = new Set(target.keywordPaths ?? []);
for (const path of meta.keywordPaths) paths.add(path);
if (paths.size !== (target.keywordPaths?.length ?? 0)) {
patch.keywordPaths = [...paths];
fields.push('keyword paths');
}
if (Object.keys(meta.iptc).length > 0) {
patch.iptc = { ...target.iptc, ...meta.iptc };
fields.push('IPTC');
}
if (meta.title && !target.title) patch.title = meta.title;
if (meta.caption) patch.caption = meta.caption;
if (meta.creator) patch.creator = meta.creator;
if (meta.copyright) patch.copyright = meta.copyright;
if (!patch.edits && fields.length === 0) {
throw new Error('That sidecar has no settings or metadata to import');
}
updatePhoto(target.id, patch, 'Import XMP sidecar');
setToast(
[settingsNote, fields.join(', ')].filter(Boolean).join(' · ') || 'Imported the sidecar',
); );
} catch (err) { } catch (err) {
setToast(err instanceof Error ? err.message : 'Could not import the sidecar'); setToast(err instanceof Error ? err.message : 'Could not import the sidecar');
@@ -2516,6 +2567,9 @@ export default function App() {
onVirtualCopy={() => void createVirtualCopy(activePhoto.id, true)} onVirtualCopy={() => void createVirtualCopy(activePhoto.id, true)}
metadataPresets={metadataPresets} metadataPresets={metadataPresets}
keywordLibrary={[...new Set(photos.flatMap((photo) => photo.keywords))].sort()} keywordLibrary={[...new Set(photos.flatMap((photo) => photo.keywords))].sort()}
keywordPathLibrary={[
...new Set(photos.flatMap((photo) => photo.keywordPaths ?? [])),
].sort()}
onSaveSnapshot={(name) => saveSnapshot(activePhoto.id, name)} onSaveSnapshot={(name) => saveSnapshot(activePhoto.id, name)}
onRestoreSnapshot={(snapshot) => restoreSnapshot(activePhoto.id, snapshot)} onRestoreSnapshot={(snapshot) => restoreSnapshot(activePhoto.id, snapshot)}
onDeleteSnapshot={(snapshot) => deleteSnapshot(activePhoto.id, snapshot.id)} onDeleteSnapshot={(snapshot) => deleteSnapshot(activePhoto.id, snapshot.id)}
@@ -2540,6 +2594,7 @@ export default function App() {
initialFiles={pendingFiles} initialFiles={pendingFiles}
existing={photos} existing={photos}
cloud={cloudUser ? { uploadOriginal, push: pushPhoto } : null} cloud={cloudUser ? { uploadOriginal, push: pushPhoto } : null}
local={localMode}
onNeedServer={() => { onNeedServer={() => {
setImportOpen(false); setImportOpen(false);
setCloudError(null); setCloudError(null);
+95 -23
View File
@@ -16,6 +16,7 @@ import type { Preview16 } from '../lib/preview16';
import { useMediaQuery } from '../lib/useMediaQuery'; import { useMediaQuery } from '../lib/useMediaQuery';
import { usePersistentState } from '../lib/usePersistentState'; import { usePersistentState } from '../lib/usePersistentState';
import { solveWhiteBalance } from '../lib/whiteBalance'; import { solveWhiteBalance } from '../lib/whiteBalance';
import { applyPresetEdits } from '../lib/presets';
import { buildAutoMask, type AutoMaskKind } from '../lib/autoMask'; import { buildAutoMask, type AutoMaskKind } from '../lib/autoMask';
import { import {
buildLensCorrection, buildLensCorrection,
@@ -157,6 +158,8 @@ interface Props {
onVirtualCopy: () => void; onVirtualCopy: () => void;
metadataPresets: MetadataPreset[]; metadataPresets: MetadataPreset[];
keywordLibrary: string[]; keywordLibrary: string[];
/** Hierarchical paths already in the library, for metadata suggestions. */
keywordPathLibrary?: string[];
onSaveSnapshot: (name: string) => void; onSaveSnapshot: (name: string) => void;
onRestoreSnapshot: (snapshot: Snapshot) => void; onRestoreSnapshot: (snapshot: Snapshot) => void;
onDeleteSnapshot: (snapshot: Snapshot) => void; onDeleteSnapshot: (snapshot: Snapshot) => void;
@@ -191,6 +194,7 @@ export default function Develop({
onVirtualCopy, onVirtualCopy,
metadataPresets, metadataPresets,
keywordLibrary, keywordLibrary,
keywordPathLibrary = [],
onSaveSnapshot, onSaveSnapshot,
onRestoreSnapshot, onRestoreSnapshot,
onDeleteSnapshot, onDeleteSnapshot,
@@ -276,6 +280,9 @@ export default function Develop({
const [lensCorrection, setLensCorrection] = useState<LensCorrection | null>(null); const [lensCorrection, setLensCorrection] = useState<LensCorrection | null>(null);
const [lensSplit, setLensSplit] = useState(false); const [lensSplit, setLensSplit] = useState(false);
const [lensSplitAt, setLensSplitAt] = useState(0.5); const [lensSplitAt, setLensSplitAt] = useState(0.5);
// The whole edit compared with the untouched source, split by a drag line.
const [splitView, setSplitView] = useState(false);
const [splitAt, setSplitAt] = useState(0.5);
const [lensState, setLensState] = useState<{ loading: boolean; error: string | null }>({ const [lensState, setLensState] = useState<{ loading: boolean; error: string | null }>({
loading: false, loading: false,
error: null, error: null,
@@ -373,11 +380,16 @@ export default function Develop({
onSelect(p.id); onSelect(p.id);
}; };
const moveLensSplit = (e: React.PointerEvent<HTMLButtonElement>) => { // Both splits drag the same way: the handle sits on the line, and its
// percentage follows the pointer across the canvas.
const dragSplit =
(set: (at: number) => void) => (e: React.PointerEvent<HTMLButtonElement>) => {
const rect = e.currentTarget.parentElement?.getBoundingClientRect(); const rect = e.currentTarget.parentElement?.getBoundingClientRect();
if (!rect || rect.width <= 0) return; if (!rect || rect.width <= 0) return;
setLensSplitAt(clampNum((e.clientX - rect.left) / rect.width, 0.02, 0.98)); set(clampNum((e.clientX - rect.left) / rect.width, 0.02, 0.98));
}; };
const moveLensSplit = dragSplit(setLensSplitAt);
const moveSplit = dragSplit(setSplitAt);
const setEdits = useCallback( const setEdits = useCallback(
(patch: Partial<Edits>, label: string) => { (patch: Partial<Edits>, label: string) => {
@@ -546,7 +558,11 @@ export default function Develop({
if (!renderer || !canvas || !bitmap) return; if (!renderer || !canvas || !bitmap) return;
if (stage.w < 40 || stage.h < 40) return; if (stage.w < 40 || stage.h < 40) return;
const activeEdits = showOriginal ? { ...defaultEdits(), crop: edits.crop } : edits; // Holding \ shows the untouched source full-frame; the split paints the same
// render over the left of its drag line, and steps aside while \ is held.
const beforeEdits = { ...defaultEdits(), crop: edits.crop };
const splitOn = splitView && !showOriginal;
const activeEdits = showOriginal ? beforeEdits : edits;
const frame = rotatedBounds(bitmap.width, bitmap.height, edits.crop.angle, edits.crop.quarter); const frame = rotatedBounds(bitmap.width, bitmap.height, edits.crop.angle, edits.crop.quarter);
const content: Rect = cropMode const content: Rect = cropMode
? { x: 0, y: 0, w: 1, h: 1 } ? { x: 0, y: 0, w: 1, h: 1 }
@@ -616,7 +632,7 @@ export default function Develop({
renderer.setImage(bitmap, hdrSource); renderer.setImage(bitmap, hdrSource);
// "Show original" must show the untouched source, not the cleaned proxy. // "Show original" must show the untouched source, not the cleaned proxy.
renderer.setDenoised(showOriginal ? null : denoisedBitmap, activeEdits.aiDenoise.amount / 100); renderer.setDenoised(showOriginal ? null : denoisedBitmap, activeEdits.aiDenoise.amount / 100);
renderer.render(activeEdits, { const frameOpts = {
width: pxW, width: pxW,
height: pxH, height: pxH,
cropPreview: cropMode, cropPreview: cropMode,
@@ -631,11 +647,30 @@ export default function Develop({
upscale: dpr * cap * fitScale * zoomFactor > 1.1, upscale: dpr * cap * fitScale * zoomFactor > 1.1,
clipPreview, clipPreview,
clipping: clipping ?? undefined, clipping: clipping ?? undefined,
};
renderer.render(activeEdits, {
...frameOpts,
lens: showOriginal ? null : lensCorrection, lens: showOriginal ? null : lensCorrection,
lensSplit: lensSplit && !showOriginal ? lensSplitAt : undefined, lensSplit: lensSplit && !splitOn ? lensSplitAt : undefined,
maskView, maskView,
maskStrength: maskStrength / 100, maskStrength: maskStrength / 100,
}); });
if (splitOn) {
// Paint the untouched source over the left half. The scissor is in
// device pixels and the same view is reused, so the halves line up.
renderer.setDenoised(null, 0);
renderer.render(beforeEdits, {
...frameOpts,
histogram: false,
lens: null,
maskView: -1,
clipPreview: false,
scissor: { x: 0, w: Math.round(pxW * splitAt) },
});
// Restore what the rest of the frame and the eyedropper read from.
renderer.setDenoised(denoisedBitmap, edits.aiDenoise.amount / 100);
renderer.setLensCorrection(lensCorrection);
}
histRef.current = renderer.histogram; histRef.current = renderer.histogram;
setHistVersion((v) => v + 1); setHistVersion((v) => v + 1);
} catch (err) { } catch (err) {
@@ -656,6 +691,8 @@ export default function Develop({
lensCorrection, lensCorrection,
lensSplit, lensSplit,
lensSplitAt, lensSplitAt,
splitView,
splitAt,
localMode, localMode,
localSelected, localSelected,
maskOverlay, maskOverlay,
@@ -1611,18 +1648,9 @@ export default function Develop({
const applyPreset = useCallback( const applyPreset = useCallback(
(preset: Preset) => { (preset: Preset) => {
const next: Edits = // The look grades over the photo's current white balance, so a correction
preset.id === 'original' // made first is the base it is applied against.
? { ...defaultEdits(), crop: photo.edits.crop } const next = applyPresetEdits(photo.edits, preset);
: {
...photo.edits,
...preset.edits,
crop: photo.edits.crop,
// The camera profile belongs to the body that produced the raw.
cameraProfile: photo.edits.cameraProfile,
// A strong film response must not leak into the next look.
redscale: preset.edits.redscale ?? 0,
};
onUpdate(photo.id, { edits: next }, `Preset: ${preset.name}`); onUpdate(photo.id, { edits: next }, `Preset: ${preset.name}`);
}, },
[onUpdate, photo.id, photo.edits], [onUpdate, photo.id, photo.edits],
@@ -1740,6 +1768,7 @@ export default function Develop({
onUpdate={(patch) => onUpdate(photo.id, patch)} onUpdate={(patch) => onUpdate(photo.id, patch)}
presets={metadataPresets} presets={metadataPresets}
keywordLibrary={keywordLibrary} keywordLibrary={keywordLibrary}
keywordPathLibrary={keywordPathLibrary}
onSavePreset={onSaveMetadataPreset} onSavePreset={onSaveMetadataPreset}
onDeletePreset={onDeleteMetadataPreset} onDeletePreset={onDeleteMetadataPreset}
/> />
@@ -1801,6 +1830,7 @@ export default function Develop({
'separator', 'separator',
{ label: 'Crop & Straighten', shortcut: 'C', onSelect: () => setCropMode((v) => !v) }, { label: 'Crop & Straighten', shortcut: 'C', onSelect: () => setCropMode((v) => !v) },
{ label: 'Before / After', shortcut: '\\', onSelect: () => setShowOriginal((v) => !v) }, { label: 'Before / After', shortcut: '\\', onSelect: () => setShowOriginal((v) => !v) },
{ label: 'Before / After split', onSelect: () => setSplitView((v) => !v) },
'separator', 'separator',
{ label: 'Copy settings', shortcut: '⌘C', onSelect: onCopy }, { label: 'Copy settings', shortcut: '⌘C', onSelect: onCopy },
{ label: 'Paste settings', shortcut: '⌘V', onSelect: () => onPaste([photo.id]), disabled: !clipboard }, { label: 'Paste settings', shortcut: '⌘V', onSelect: () => onPaste([photo.id]), disabled: !clipboard },
@@ -1884,6 +1914,14 @@ export default function Develop({
> >
Before / After Before / After
</button> </button>
<button
className={`btn ghost small ${splitView ? 'on' : ''}`}
onClick={() => setSplitView((v) => !v)}
aria-pressed={splitView}
title="Compare the edit with the original on either side of a draggable line"
>
Split
</button>
<button <button
className={`btn ghost small ${autoSync ? 'on' : ''}`} className={`btn ghost small ${autoSync ? 'on' : ''}`}
onClick={() => setAutoSync((v) => !v)} onClick={() => setAutoSync((v) => !v)}
@@ -2097,14 +2135,14 @@ export default function Develop({
toggleZoom(e.clientX, e.clientY); toggleZoom(e.clientX, e.clientY);
}} }}
/> />
{lensSplit && lensCorrection && !showOriginal && ( {lensSplit && lensCorrection && !showOriginal && !splitView && (
<div className="lens-split"> <div className="compare-split">
<div className="lens-split-line" style={{ left: `${lensSplitAt * 100}%` }} /> <div className="compare-split-line" style={{ left: `${lensSplitAt * 100}%` }} />
<span className="lens-split-label before">Before</span> <span className="compare-split-label before">Before</span>
<span className="lens-split-label after">After</span> <span className="compare-split-label after">After</span>
<button <button
type="button" type="button"
className="lens-split-handle" className="compare-split-handle"
style={{ left: `${lensSplitAt * 100}%` }} style={{ left: `${lensSplitAt * 100}%` }}
aria-label="Drag to move the lens correction split" aria-label="Drag to move the lens correction split"
title="Drag to compare lens correction" title="Drag to compare lens correction"
@@ -2131,6 +2169,40 @@ export default function Develop({
</button> </button>
</div> </div>
)} )}
{splitView && !showOriginal && (
<div className="compare-split">
<div className="compare-split-line" style={{ left: `${splitAt * 100}%` }} />
<span className="compare-split-label before">Before</span>
<span className="compare-split-label after">After</span>
<button
type="button"
className="compare-split-handle"
style={{ left: `${splitAt * 100}%` }}
aria-label="Drag to move the before / after split"
title="Drag to compare the edit with the original"
onPointerDown={(e) => {
e.preventDefault();
e.currentTarget.setPointerCapture(e.pointerId);
moveSplit(e);
}}
onPointerMove={(e) => {
if (e.currentTarget.hasPointerCapture(e.pointerId)) moveSplit(e);
}}
onPointerUp={(e) => {
if (e.currentTarget.hasPointerCapture(e.pointerId)) {
e.currentTarget.releasePointerCapture(e.pointerId);
}
}}
onPointerCancel={(e) => {
if (e.currentTarget.hasPointerCapture(e.pointerId)) {
e.currentTarget.releasePointerCapture(e.pointerId);
}
}}
>
↔
</button>
</div>
)}
{healMode && bitmap && (() => { {healMode && bitmap && (() => {
const geo = geoRef.current; const geo = geoRef.current;
const view = geo.view; const view = geo.view;
+22 -3
View File
@@ -23,6 +23,7 @@ const FORMATS: { value: ExportFormat; label: string }[] = [
{ value: 'png', label: 'PNG (8-bit)' }, { value: 'png', label: 'PNG (8-bit)' },
{ value: 'webp', label: 'WebP' }, { value: 'webp', label: 'WebP' },
{ value: 'tiff16', label: 'TIFF (16-bit)' }, { value: 'tiff16', label: 'TIFF (16-bit)' },
{ value: 'jxl', label: 'JPEG XL' },
]; ];
/** /**
@@ -360,7 +361,7 @@ export default function ExportModal({ photos, initial, recipes, onSaveRecipe, on
)} )}
</div> </div>
{(opts.format === 'jpeg' || opts.format === 'webp') && ( {(opts.format === 'jpeg' || opts.format === 'webp' || opts.format === 'jxl') && (
<label className="field"> <label className="field">
<span>Quality · {opts.quality}</span> <span>Quality · {opts.quality}</span>
<input <input
@@ -369,11 +370,29 @@ export default function ExportModal({ photos, initial, recipes, onSaveRecipe, on
max={100} max={100}
value={opts.quality} value={opts.quality}
onChange={(e) => patch({ quality: Number(e.target.value) })} onChange={(e) => patch({ quality: Number(e.target.value) })}
disabled={busy} disabled={busy || (opts.format === 'jxl' && opts.jxlLossless === true)}
/> />
</label> </label>
)} )}
{opts.format === 'jxl' && (
<>
<label className="check-row">
<input
type="checkbox"
checked={opts.jxlLossless === true}
onChange={(e) => patch({ jxlLossless: e.target.checked })}
disabled={busy}
/>
Lossless — keeps every pixel and ignores the quality setting
</label>
<p className="muted small">
JPEG XL exports are 8-bit sRGB. Chrome, Firefox and Safari open them; Microsoft Edge
does not yet.
</p>
</>
)}
{sample && <ExportDetailStrip photo={sample} size={previewSize} />} {sample && <ExportDetailStrip photo={sample} size={previewSize} />}
<label className="field"> <label className="field">
@@ -478,7 +497,7 @@ export default function ExportModal({ photos, initial, recipes, onSaveRecipe, on
type="checkbox" type="checkbox"
checked={opts.embedProfile} checked={opts.embedProfile}
onChange={(e) => patch({ embedProfile: e.target.checked })} onChange={(e) => patch({ embedProfile: e.target.checked })}
disabled={opts.format === 'webp' || opts.format === 'png'} disabled={opts.format === 'webp' || opts.format === 'png' || opts.format === 'jxl'}
/> />
Embed {COLOR_SPACE_OPTIONS.find((option) => option.value === (opts.colorSpace ?? 'srgb'))?.label ?? 'sRGB'} profile (JPEG/TIFF) Embed {COLOR_SPACE_OPTIONS.find((option) => option.value === (opts.colorSpace ?? 'srgb'))?.label ?? 'sRGB'} profile (JPEG/TIFF)
</label> </label>
+54 -7
View File
@@ -18,6 +18,8 @@ interface Props {
immichEnabled?: boolean; immichEnabled?: boolean;
onCreateImmichGallery?: (eventId: string) => Promise<EventRecord>; onCreateImmichGallery?: (eventId: string) => Promise<EventRecord>;
cloud?: CloudImport | null; cloud?: CloudImport | null;
/** Desktop bundle: the decoder runs on this PC rather than a team server. */
local?: boolean;
onNeedServer: () => void; onNeedServer: () => void;
} }
@@ -32,6 +34,7 @@ export default function ImportModal({
immichEnabled = false, immichEnabled = false,
onCreateImmichGallery, onCreateImmichGallery,
cloud, cloud,
local = false,
onNeedServer, onNeedServer,
}: Props) { }: Props) {
const startId = initialEventId !== 'all' && initialEventId !== 'unsorted' ? initialEventId : events[0]?.id ?? '__new'; const startId = initialEventId !== 'all' && initialEventId !== 'unsorted' ? initialEventId : events[0]?.id ?? '__new';
@@ -43,6 +46,9 @@ export default function ImportModal({
const [progress, setProgress] = useState<ImportProgress | null>(null); const [progress, setProgress] = useState<ImportProgress | null>(null);
const [failures, setFailures] = useState<string[]>([]); const [failures, setFailures] = useState<string[]>([]);
const [allowDuplicates, setAllowDuplicates] = useState(false); const [allowDuplicates, setAllowDuplicates] = useState(false);
// 16-bit is the default an editor would expect, and it is what a raw import
// should keep unless the whole point is a smaller library.
const [sidecar16, setSidecar16] = useState(true);
const [createGallery, setCreateGallery] = useState(immichEnabled); const [createGallery, setCreateGallery] = useState(immichEnabled);
const [galleryCreated, setGalleryCreated] = useState(false); const [galleryCreated, setGalleryCreated] = useState(false);
const [galleryError, setGalleryError] = useState<string | null>(null); const [galleryError, setGalleryError] = useState<string | null>(null);
@@ -125,7 +131,15 @@ export default function ImportModal({
); );
} }
} }
const result = await importFiles(readyFiles, targetId, [], setProgress, cloud ?? null, controller.signal); const result = await importFiles(
readyFiles,
targetId,
[],
setProgress,
cloud ?? null,
controller.signal,
{ sidecar16 },
);
if (result.photos.length) onImported(result.photos, targetId); if (result.photos.length) onImported(result.photos, targetId);
let published = 0; let published = 0;
@@ -278,7 +292,8 @@ export default function ImportModal({
<strong>Drop photos here</strong> <strong>Drop photos here</strong>
<p className="muted"> <p className="muted">
or click to choose files. JPEG, PNG, WebP, AVIF, TIFF and camera raw (CR2, CR3, NEF, or click to choose files. JPEG, PNG, WebP, AVIF, TIFF and camera raw (CR2, CR3, NEF,
ARW, ORF, RW2, RAF, DNG, PEF…) — raw needs the team server. ARW, ORF, RW2, RAF, DNG, PEF…) — raw needs{' '}
{local ? 'the local engine' : 'the team server'}.
</p> </p>
</div> </div>
<input <input
@@ -329,21 +344,51 @@ export default function ImportModal({
<strong> <strong>
{rawCount} raw file{rawCount === 1 ? '' : 's'} cannot be read by the browser. {rawCount} raw file{rawCount === 1 ? '' : 's'} cannot be read by the browser.
</strong>{' '} </strong>{' '}
They are decoded by the team server, so sign in before importing — or import them later {local
from the library. ? 'They are decoded by the local engine on this PC. Check that Luminary is running, then import again.'
: 'They are decoded by the team server, so sign in before importing — or import them later from the library.'}
{!local && (
<button className="btn primary small banner-action" onClick={onNeedServer} disabled={busy}> <button className="btn primary small banner-action" onClick={onNeedServer} disabled={busy}>
Sign in to the server Sign in to the server
</button> </button>
)}
</div> </div>
)} )}
{rawCount > 0 && cloud && ( {rawCount > 0 && cloud && (
<div className="banner info"> <div className="banner info">
Raw files are demosaiced by the server (LibRaw), a few at a time in parallel. Each file {local
usually takes 2–4 seconds. ? 'Raw files are demosaiced by the Luminary local engine (LibRaw) on this PC, two ' +
'at a time; the rest of your selection waits its turn. A 24 MP raw takes a few ' +
'seconds; a 40 MP compressed Fuji file takes closer to twenty. Nothing leaves ' +
'your computer.'
: 'Raw files are demosaiced by the server (LibRaw), two at a time; the rest of your ' +
'selection waits its turn. A 24 MP raw takes a few seconds; a 40 MP compressed ' +
'Fuji file takes closer to twenty.'}
{' '}A file the engine cannot decode still imports from the camera’s own preview.
</div> </div>
)} )}
{rawCount > 0 && cloud && (
<>
<label className="check-row">
<input
type="checkbox"
checked={sidecar16}
onChange={(e) => setSidecar16(e.target.checked)}
disabled={busy}
/>
Import raws at 16-bit (recommended)
</label>
<p className="muted small">
A 16-bit sidecar keeps every level the decoder read, so recovering shadows and
highlights works from 65,536 steps per channel instead of 256. It costs roughly
25× the JPEG in disk and download. Uncheck to import at 8-bit instead: smaller,
quicker to upload, but graded from the JPEG.
</p>
</>
)}
{progress && ( {progress && (
<div className="progress"> <div className="progress">
<div className="progress-bar"> <div className="progress-bar">
@@ -353,7 +398,9 @@ export default function ImportModal({
/> />
</div> </div>
<div className="muted small"> <div className="muted small">
{progress.done} / {progress.total} {progress.current ? `· ${progress.current}` : ''} {progress.done} / {progress.total}
{progress.waiting ? ` · ${progress.waiting} waiting` : ''}
{progress.current ? ` · ${progress.current}` : ''}
</div> </div>
</div> </div>
)} )}
+1 -1
View File
@@ -101,7 +101,7 @@ LUMINARY
{loadError && ( {loadError && (
<> <>
<span className="join-eyebrow">Invite</span> <span className="join-eyebrow">Invite</span>
<h1>Can’t reach the server</h1> <h1>Can’t reach Luminary</h1>
<p className="muted">{loadError}</p> <p className="muted">{loadError}</p>
<a className="btn ghost wide" href="/"> <a className="btn ghost wide" href="/">
Go to Luminary Go to Luminary
+131 -3
View File
@@ -11,6 +11,8 @@ import {
} from '../lib/denoiseModels'; } from '../lib/denoiseModels';
import type { DenoiseProgress } from '../lib/api'; import type { DenoiseProgress } from '../lib/api';
import { clamp } from '../lib/curves'; import { clamp } from '../lib/curves';
import { estimateKelvin, expressWhiteBalance, wbGainWithLook } from '../lib/whiteBalance';
import { addKeywordPath, removeKeywordPath } from '../lib/keywords';
import type { import type {
CurveChannel, CurveChannel,
Edits, Edits,
@@ -107,6 +109,12 @@ export function BasicPanel({
// come back with neutral values, so Auto WB matched As shot exactly. // come back with neutral values, so Auto WB matched As shot exactly.
const thumbSrc = photo.thumbUrl ?? photo.thumb; const thumbSrc = photo.thumbUrl ?? photo.thumb;
// A look adds its cast to the correction already in the sliders; this shows what
// that leaves the white balance at, so the final balance stays visible.
const lookCast = edits.presetLook && (edits.presetLook.temp || edits.presetLook.tint) ? edits.presetLook : null;
const finalWb = lookCast ? expressWhiteBalance(wbGainWithLook(edits.temp, edits.tint, edits.kelvin, lookCast)) : null;
const signed = (v: number) => (v > 0 ? `+${v}` : String(v));
const auto = async () => { const auto = async () => {
setAutoBusy(true); setAutoBusy(true);
try { try {
@@ -180,6 +188,23 @@ export function BasicPanel({
onChange={(v) => set({ tint: v }, 'Tint')} onChange={(v) => set({ tint: v }, 'Tint')}
track="linear-gradient(90deg,#54b364,#a8b6c6,#c56ad2)" track="linear-gradient(90deg,#54b364,#a8b6c6,#c56ad2)"
/> />
{lookCast && finalWb && (
<div
className="wb-look"
title="The look grades over your white balance, so it adds its own temperature and tint on top. These are the numbers the photo is actually graded at."
>
<span>
Look cast <b>{signed(lookCast.temp)} / {signed(lookCast.tint)}</b>
</span>
<span className="wb-look-final">
Final{' '}
{edits.kelvin != null
? `≈ ${Math.round(estimateKelvin(wbGainWithLook(edits.temp, edits.tint, edits.kelvin, lookCast)) / 10) * 10} K`
: `temp ${signed(finalWb.temp)}`}{' '}
· tint {signed(finalWb.tint)}
</span>
</div>
)}
<div className="subhead"> <div className="subhead">
<span>Tone</span> <span>Tone</span>
@@ -2662,6 +2687,7 @@ export function MetadataPanel({
onUpdate, onUpdate,
presets = [], presets = [],
keywordLibrary = [], keywordLibrary = [],
keywordPathLibrary = [],
onSavePreset, onSavePreset,
onDeletePreset, onDeletePreset,
}: { }: {
@@ -2670,6 +2696,8 @@ export function MetadataPanel({
onUpdate?: (patch: Partial<PhotoRecord>) => void; onUpdate?: (patch: Partial<PhotoRecord>) => void;
presets?: MetadataPreset[]; presets?: MetadataPreset[];
keywordLibrary?: string[]; keywordLibrary?: string[];
/** Existing hierarchical paths in the library, offered as suggestions. */
keywordPathLibrary?: string[];
onSavePreset?: (preset: Omit<MetadataPreset, 'id'>) => void; onSavePreset?: (preset: Omit<MetadataPreset, 'id'>) => void;
onDeletePreset?: (id: string) => void; onDeletePreset?: (id: string) => void;
}) { }) {
@@ -2705,11 +2733,21 @@ export function MetadataPanel({
const patch = (next: Partial<PhotoRecord>) => onUpdate?.(next); const patch = (next: Partial<PhotoRecord>) => onUpdate?.(next);
/**
* One entry point for both kinds of tag: a plain word stays flat, and
* `Nature > Birds` records the path and its ancestors. The leaf is added to
* `keywords` either way, so search and filters keep working on flat terms.
*/
const addKeyword = (raw?: string) => { const addKeyword = (raw?: string) => {
const value = (raw ?? keyword).trim().replace(/,$/, ''); const value = (raw ?? keyword).trim().replace(/,$/, '');
if (!value) return; if (!value) return;
const exists = photo.keywords.some((word) => word.toLowerCase() === value.toLowerCase()); patch(
if (!exists) patch({ keywords: [...photo.keywords, value.slice(0, 48)] }); addKeywordPath(
{ keywords: photo.keywords, keywordPaths: photo.keywordPaths ?? [] },
value,
/[>/|]/.test(value),
),
);
setKeyword(''); setKeyword('');
}; };
@@ -2717,6 +2755,19 @@ export function MetadataPanel({
patch({ keywords: photo.keywords.filter((item) => item !== word) }); patch({ keywords: photo.keywords.filter((item) => item !== word) });
}; };
const removePath = (path: string) => {
patch(
removeKeywordPath(
{ keywords: photo.keywords, keywordPaths: photo.keywordPaths ?? [] },
path,
),
);
};
const patchIptc = (field: keyof NonNullable<PhotoRecord['iptc']>, value: string) => {
patch({ iptc: { ...photo.iptc, [field]: value } });
};
const applyPreset = (id: string) => { const applyPreset = (id: string) => {
setPresetId(id); setPresetId(id);
const preset = presets.find((item) => item.id === id); const preset = presets.find((item) => item.id === id);
@@ -2795,11 +2846,32 @@ export function MetadataPanel({
</button> </button>
))} ))}
</div> </div>
{photo.keywordPaths?.length ? (
<>
<div className="metadata-keywords-head">
<span>Keyword paths</span>
<span className="muted small">{photo.keywordPaths.length}</span>
</div>
<div className="keyword-chips">
{photo.keywordPaths.map((path) => (
<button
key={path}
className="keyword-chip"
onClick={() => removePath(path)}
title="Remove this path and everything under it"
>
{path} <span aria-hidden="true">×</span>
</button>
))}
</div>
</>
) : null}
<div className="keyword-add"> <div className="keyword-add">
<input <input
value={keyword} value={keyword}
list="lumen-keyword-library" list="lumen-keyword-library"
placeholder="Add keyword…" placeholder="Add keyword, or Nature > Birds…"
onChange={(e) => setKeyword(e.target.value)} onChange={(e) => setKeyword(e.target.value)}
onKeyDown={(e) => { onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ',') { if (e.key === 'Enter' || e.key === ',') {
@@ -2816,9 +2888,65 @@ export function MetadataPanel({
{keywordLibrary.map((word) => ( {keywordLibrary.map((word) => (
<option key={word} value={word} /> <option key={word} value={word} />
))} ))}
{keywordPathLibrary.map((path) => (
<option key={`path:${path}`} value={path} />
))}
</datalist> </datalist>
</div> </div>
<div className="metadata-keywords-head">
<span>IPTC</span>
</div>
<label className="field">
<span>Headline</span>
<input
value={photo.iptc?.headline ?? ''}
placeholder="Who, what, where"
onChange={(e) => patchIptc('headline', e.target.value)}
disabled={!onUpdate}
/>
</label>
<div className="field-row">
<label className="field">
<span>Credit</span>
<input
value={photo.iptc?.credit ?? ''}
placeholder="Photographer credit"
onChange={(e) => patchIptc('credit', e.target.value)}
disabled={!onUpdate}
/>
</label>
<label className="field">
<span>Source</span>
<input
value={photo.iptc?.source ?? ''}
placeholder="Agency or client"
onChange={(e) => patchIptc('source', e.target.value)}
disabled={!onUpdate}
/>
</label>
</div>
<div className="field-row">
<label className="field">
<span>City</span>
<input
value={photo.iptc?.city ?? ''}
placeholder="City"
onChange={(e) => patchIptc('city', e.target.value)}
disabled={!onUpdate}
/>
</label>
<label className="field">
<span>Country</span>
<input
value={photo.iptc?.country ?? ''}
placeholder="Country"
onChange={(e) => patchIptc('country', e.target.value)}
disabled={!onUpdate}
/>
</label>
</div>
<div className="metadata-presets"> <div className="metadata-presets">
<select value={presetId} onChange={(e) => applyPreset(e.target.value)} disabled={!presets.length || !onUpdate}> <select value={presetId} onChange={(e) => applyPreset(e.target.value)} disabled={!presets.length || !onUpdate}>
<option value="">Apply metadata preset…</option> <option value="">Apply metadata preset…</option>
+69 -8
View File
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react'; import { useEffect, useRef, useState } from 'react';
import { normalizeEdits } from '../lib/edits'; import { applyPresetEdits } from '../lib/presets';
import { get16BitSource, getBitmap } from '../lib/images'; import { get16BitSource, getBitmap } from '../lib/images';
import { Renderer, rotatedBounds } from '../gl/renderer'; import { Renderer, rotatedBounds } from '../gl/renderer';
import type { PhotoRecord, Preset } from '../types'; import type { PhotoRecord, Preset } from '../types';
@@ -17,17 +17,66 @@ const THUMB_EDGE = 200;
const keyOf = (photoId: string, presetId: string, crop: string, source: string) => const keyOf = (photoId: string, presetId: string, crop: string, source: string) =>
`${photoId}|${presetId}|${crop}|${source}`; `${photoId}|${presetId}|${crop}|${source}`;
/** Stringified grades, cached per edits object so a render loop cannot make this
* cost more than one serialisation. */
const signatures = new WeakMap<object, string>();
function gradeSignature(edits: object): string {
let sig = signatures.get(edits);
if (sig === undefined) {
sig = JSON.stringify(edits);
signatures.set(edits, sig);
}
return sig;
}
/**
* A slider drag produces a new grade every frame. Re-rendering the whole rail
* that often would make the canvas stutter, so the tiles follow the grade a
* moment after it settles.
*
* The timer is keyed on the grade's signature, not on the object: the editor can
* hand down a fresh edits object on every render, and an identity-keyed timer
* would then be reset forever and the rail would never catch up.
*/
function useSettledEdits<T extends object>(edits: T, sig: string, delay: number): T {
const [settled, setSettled] = useState(() => ({ sig, edits }));
useEffect(() => {
if (sig === settled.sig) return;
const timer = window.setTimeout(() => setSettled({ sig, edits }), delay);
return () => window.clearTimeout(timer);
// `edits` is read from the render that changed the signature; restarting on
// a new object with the same grade is exactly what this avoids.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [sig, delay, settled.sig]);
return settled.edits;
}
export function usePresetThumbs(photo: PhotoRecord, presets: Preset[]): Record<string, string> { export function usePresetThumbs(photo: PhotoRecord, presets: Preset[]): Record<string, string> {
const [thumbs, setThumbs] = useState<Record<string, string>>({}); const [thumbs, setThumbs] = useState<Record<string, string>>({});
// Which photo the thumbnails in state belong to; a new photo may not reuse them.
const shownPhoto = useRef(photo.id);
// Preset edits never change after creation, so a stable id list is enough to // Preset edits never change after creation, so a stable id list is enough to
// avoid re-running for every parent render. // avoid re-running for every parent render.
const presetKey = presets.map((p) => p.id).join('|'); const presetKey = presets.map((p) => p.id).join('|');
const crop = photo.edits.crop; // Tiles show the look over the grade the photo has right now, so clicking one
// is what the thumbnail promised. The grade is read once it settles instead of
// on every frame of a slider drag.
const settled = useSettledEdits(photo.edits, gradeSignature(photo.edits), 280);
// Applying a look replaces any cast the last one added, so the current look is
// dropped from the base: tiles keep their images while the photographer clicks
// through looks, and each tile still shows what that click would produce.
const base =
settled.presetLook && (settled.presetLook.temp || settled.presetLook.tint)
? { ...settled, presetLook: { temp: 0, tint: 0 } }
: settled;
const crop = base.crop;
const cropKey = [crop.x, crop.y, crop.w, crop.h, crop.angle, crop.quarter, crop.flipH, crop.flipV].join(','); const cropKey = [crop.x, crop.y, crop.w, crop.h, crop.angle, crop.quarter, crop.flipH, crop.flipV].join(',');
// The preset previews keep the photo's camera profile, so a reprocess or a // The preset previews keep the photo's camera profile, so a reprocess or a
// different profile has to invalidate tiles the same way a crop does. // different profile has to invalidate the tiles the same way the grade does.
const profile = photo.edits.cameraProfile; const profile = base.cameraProfile;
const sourceKey = `${photo.previewVersion ?? 0}|${profile ? profile.matrix.join(',') : ''}`; const gradeKey = JSON.stringify({ ...base, crop: undefined, cameraProfile: undefined });
const sourceKey = `${photo.previewVersion ?? 0}|${profile ? profile.matrix.join(',') : ''}|${gradeKey}`;
useEffect(() => { useEffect(() => {
let alive = true; let alive = true;
@@ -39,7 +88,19 @@ export function usePresetThumbs(photo: PhotoRecord, presets: Preset[]): Record<s
const hit = cache.get(keyOf(photo.id, preset.id, cropKey, sourceKey)); const hit = cache.get(keyOf(photo.id, preset.id, cropKey, sourceKey));
if (hit) known[preset.id] = hit; if (hit) known[preset.id] = hit;
} }
setThumbs(known); // Keep the previous tiles of this photo on screen until their replacements
// render: a grade change must not empty the rail for the five seconds a full
// batch takes.
const samePhoto = shownPhoto.current === photo.id;
shownPhoto.current = photo.id;
setThumbs((prev) => {
const next: Record<string, string> = {};
for (const preset of presets) {
const url = known[preset.id] ?? (samePhoto ? prev[preset.id] : undefined);
if (url) next[preset.id] = url;
}
return next;
});
const pending = presets.filter((p) => !known[p.id]); const pending = presets.filter((p) => !known[p.id]);
if (!pending.length) return; if (!pending.length) return;
@@ -63,7 +124,7 @@ export function usePresetThumbs(photo: PhotoRecord, presets: Preset[]): Record<s
for (const preset of pending) { for (const preset of pending) {
if (!alive) break; if (!alive) break;
try { try {
renderer.render({ ...normalizeEdits(preset.edits), crop, cameraProfile: profile }, { renderer.render(applyPresetEdits(base, preset), {
width, width,
height, height,
upscale: Math.max(width / cropW, height / cropH) > 1.05, upscale: Math.max(width / cropW, height / cropH) > 1.05,
+17 -2
View File
@@ -3,7 +3,7 @@ import type { Preview16 } from '../lib/preview16';
import type { CurvePoint, Edits, GeometryEdits, LocalLayer } from '../types'; import type { CurvePoint, Edits, GeometryEdits, LocalLayer } from '../types';
import { buildSampler, clamp01 } from '../lib/curves'; import { buildSampler, clamp01 } from '../lib/curves';
import { bwFilterRgb, MAX_HEAL_SPOTS, MAX_LOCAL_LAYERS } from '../lib/edits'; import { bwFilterRgb, MAX_HEAL_SPOTS, MAX_LOCAL_LAYERS } from '../lib/edits';
import { wbGainFor } from '../lib/whiteBalance'; import { wbGainWithLook } from '../lib/whiteBalance';
import { buildLocalMasks, maskSignature } from './masks'; import { buildLocalMasks, maskSignature } from './masks';
import { getActiveProofCube, type SoftProofCube } from '../lib/softProof'; import { getActiveProofCube, type SoftProofCube } from '../lib/softProof';
@@ -1875,7 +1875,9 @@ export class Renderer {
g.f('u_srcLod', Math.max(0, Math.min(12, srcLod))); g.f('u_srcLod', Math.max(0, Math.min(12, srcLod)));
g.f('u_pick', -1); g.f('u_pick', -1);
g.v2('u_pickUv', 0, 0); g.v2('u_pickUv', 0, 0);
const wb = wbGainFor(edits.temp, edits.tint, edits.kelvin); // The photographer's correction is the base; an applied look only adds its
// cast on top of it (see applyPresetEdits).
const wb = wbGainWithLook(edits.temp, edits.tint, edits.kelvin, edits.presetLook);
g.v3('u_wbGain', wb[0], wb[1], wb[2]); g.v3('u_wbGain', wb[0], wb[1], wb[2]);
g.f('u_exposure', edits.exposure); g.f('u_exposure', edits.exposure);
g.f('u_recovery', edits.recovery); g.f('u_recovery', edits.recovery);
@@ -2011,6 +2013,12 @@ export class Renderer {
lens?: LensCorrection | null; lens?: LensCorrection | null;
/** 0–1 screen split: left is uncorrected, right is corrected. */ /** 0–1 screen split: left is uncorrected, right is corrected. */
lensSplit?: number; lensSplit?: number;
/**
* Draw only this horizontal slice of the canvas, in device pixels. The
* before/after split renders the edit full-frame, then the untouched
* source over the left side, so both halves share one view and line up.
*/
scissor?: { x: number; w: number };
/** hold the grain pattern still, e.g. while a crop handle is being dragged */ /** hold the grain pattern still, e.g. while a crop handle is being dragged */
freezeGrain?: boolean; freezeGrain?: boolean;
/** paint clipped channels while the exposure control is being dragged */ /** paint clipped channels while the exposure control is being dragged */
@@ -2137,6 +2145,12 @@ export class Renderer {
// Pass 4: detail, effects, grain -> canvas // Pass 4: detail, effects, grain -> canvas
const finishDraw = (target: Target | null, clip = 0) => { const finishDraw = (target: Target | null, clip = 0) => {
const gl2 = this.gl; const gl2 = this.gl;
// Render targets are always complete frames; only the canvas is ever cut.
const scissor = target ? undefined : opts.scissor;
if (scissor) {
gl2.enable(gl2.SCISSOR_TEST);
gl2.scissor(scissor.x, 0, Math.max(1, scissor.w), h);
}
if (target) { if (target) {
gl2.bindFramebuffer(gl2.FRAMEBUFFER, target.fbo); gl2.bindFramebuffer(gl2.FRAMEBUFFER, target.fbo);
gl2.viewport(0, 0, target.w, target.h); gl2.viewport(0, 0, target.w, target.h);
@@ -2213,6 +2227,7 @@ export class Renderer {
this.finish.v2('u_outSize', target ? target.w : w, target ? target.h : h); this.finish.v2('u_outSize', target ? target.w : w, target ? target.h : h);
this.finish.f('u_aspect', w / h); this.finish.f('u_aspect', w / h);
this.drawQuad(); this.drawQuad();
if (scissor) gl2.disable(gl2.SCISSOR_TEST);
}; };
const clipMode = opts.clipPreview const clipMode = opts.clipPreview
+25 -2
View File
@@ -35,6 +35,17 @@ export interface UploadResult {
note?: string | null; note?: string | null;
} }
/**
* True once /api/health reports LUMINARY_LOCAL=1: the engine runs inside this
* app's own folder, so copy must not send users looking for a remote server.
*/
let localEngine = false;
/** Whether this app talks to the engine in its own bundle (desktop mode). */
export function isLocalEngine(): boolean {
return localEngine;
}
export class ApiError extends Error { export class ApiError extends Error {
status: number; status: number;
constructor(message: string, status: number) { constructor(message: string, status: number) {
@@ -48,7 +59,10 @@ export async function request<T>(path: string, init?: RequestInit): Promise<T> {
try { try {
res = await fetch(path, { credentials: 'same-origin', ...init }); res = await fetch(path, { credentials: 'same-origin', ...init });
} catch { } catch {
throw new ApiError('Cannot reach the Luminary server', 0); throw new ApiError(
localEngine ? 'Cannot reach the Luminary local engine' : 'Cannot reach the Luminary server',
0,
);
} }
if (!res.ok) { if (!res.ok) {
let message = `Request failed (${res.status})`; let message = `Request failed (${res.status})`;
@@ -78,6 +92,7 @@ export async function getHealth(): Promise<Health | null> {
const res = await fetch('/api/health', { credentials: 'same-origin' }); const res = await fetch('/api/health', { credentials: 'same-origin' });
if (!res.ok) return null; if (!res.ok) return null;
const body = (await res.json()) as Health; const body = (await res.json()) as Health;
localEngine = body?.local === true;
return body?.ok ? body : null; return body?.ok ? body : null;
} catch { } catch {
return null; return null;
@@ -140,8 +155,16 @@ export function pullProofs(): Promise<ProofSummary[]> {
return request<{ proofs: ProofSummary[] }>('/api/proofs').then((res) => res.proofs ?? []); return request<{ proofs: ProofSummary[] }>('/api/proofs').then((res) => res.proofs ?? []);
} }
export function uploadOriginal(id: string, file: File | Blob, name: string): Promise<UploadResult> { export function uploadOriginal(
id: string,
file: File | Blob,
name: string,
options: { sidecar?: boolean } = {},
): Promise<UploadResult> {
const query = new URLSearchParams({ name, mime: file.type || 'application/octet-stream' }); const query = new URLSearchParams({ name, mime: file.type || 'application/octet-stream' });
// Only an opt-out is sent: an older server ignores the parameter and keeps
// its configured default, and every other upload keeps the shorter URL.
if (options.sidecar === false) query.set('sidecar', '0');
return request<UploadResult>(`/api/photos/${encodeURIComponent(id)}/original?${query}`, { return request<UploadResult>(`/api/photos/${encodeURIComponent(id)}/original?${query}`, {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/octet-stream' }, headers: { 'Content-Type': 'application/octet-stream' },
+1
View File
@@ -82,6 +82,7 @@ const GROUPS: Record<EditSectionId, (keyof Edits)[]> = {
'temp', 'temp',
'tint', 'tint',
'kelvin', 'kelvin',
'presetLook',
'exposure', 'exposure',
'recovery', 'recovery',
'contrast', 'contrast',
+37
View File
@@ -11,6 +11,7 @@ import type {
LocalMaskKind, LocalMaskKind,
LocalPoint, LocalPoint,
LocalStroke, LocalStroke,
IptcFields,
LensCorrections, LensCorrections,
LensProfile, LensProfile,
RasterMask, RasterMask,
@@ -177,6 +178,7 @@ export function defaultEdits(): Edits {
temp: 0, temp: 0,
tint: 0, tint: 0,
kelvin: null, kelvin: null,
presetLook: { temp: 0, tint: 0 },
exposure: 0, exposure: 0,
recovery: 0, recovery: 0,
contrast: 0, contrast: 0,
@@ -511,6 +513,10 @@ export function normalizeEdits(input: Partial<Edits> | undefined | null): Edits
typeof input.kelvin === 'number' && Number.isFinite(input.kelvin) typeof input.kelvin === 'number' && Number.isFinite(input.kelvin)
? clamp(input.kelvin, 1500, 15000) ? clamp(input.kelvin, 1500, 15000)
: null, : null,
presetLook: {
temp: num(input.presetLook?.temp, 0, -100, 100),
tint: num(input.presetLook?.tint, 0, -100, 100),
},
exposure: num(input.exposure, 0, -5, 5), exposure: num(input.exposure, 0, -5, 5),
recovery: num(input.recovery, 0, 0, 100), recovery: num(input.recovery, 0, 0, 100),
contrast: num(input.contrast, 0, -100, 100), contrast: num(input.contrast, 0, -100, 100),
@@ -638,6 +644,31 @@ export function isEdited(edits: Edits): boolean {
return result; return result;
} }
/** Trimmed, capped strings only: IPTC goes into files, so no objects or arrays. */
function textField(value: unknown, max: number): string | undefined {
if (typeof value !== 'string') return undefined;
const trimmed = value.trim();
return trimmed ? trimmed.slice(0, max) : undefined;
}
function sanitiseIptc(input: unknown): IptcFields | undefined {
if (!input || typeof input !== 'object') return undefined;
const raw = input as Record<string, unknown>;
const fields: IptcFields = {
headline: textField(raw.headline, 256),
credit: textField(raw.credit, 128),
source: textField(raw.source, 128),
city: textField(raw.city, 128),
state: textField(raw.state, 128),
country: textField(raw.country, 128),
location: textField(raw.location, 128),
};
const kept = Object.fromEntries(
Object.entries(fields).filter(([, value]) => value !== undefined),
) as IptcFields;
return Object.keys(kept).length > 0 ? kept : undefined;
}
export function normalizePhoto(input: Partial<PhotoRecord> & { id: string }): PhotoRecord { export function normalizePhoto(input: Partial<PhotoRecord> & { id: string }): PhotoRecord {
const edits = normalizeEdits(input.edits); const edits = normalizeEdits(input.edits);
const addedAt = input.addedAt ?? Date.now(); const addedAt = input.addedAt ?? Date.now();
@@ -693,6 +724,12 @@ export function normalizePhoto(input: Partial<PhotoRecord> & { id: string }): Ph
flag: (input.flag ?? 'none') as Flag, flag: (input.flag ?? 'none') as Flag,
color: (input.color ?? '') as ColorLabel, color: (input.color ?? '') as ColorLabel,
keywords: Array.isArray(input.keywords) ? input.keywords : [], keywords: Array.isArray(input.keywords) ? input.keywords : [],
keywordPaths: Array.isArray(input.keywordPaths)
? input.keywordPaths.filter(
(path): path is string => typeof path === 'string' && path.trim().length > 0,
).slice(0, 200)
: undefined,
iptc: sanitiseIptc(input.iptc),
edits, edits,
history: history:
Array.isArray(input.history) && input.history.length Array.isArray(input.history) && input.history.length
+8
View File
@@ -1,6 +1,8 @@
import { describe, expect, it } from 'vitest'; import { describe, expect, it } from 'vitest';
import { outputSize } from '../gl/renderer'; import { outputSize } from '../gl/renderer';
import { defaultEdits } from './edits'; import { defaultEdits } from './edits';
import { buildFileName, DEFAULT_EXPORT } from './export';
import type { PhotoRecord } from '../types';
describe('export output dimensions', () => { describe('export output dimensions', () => {
it('matches the source for an uncropped image', () => { it('matches the source for an uncropped image', () => {
@@ -19,6 +21,12 @@ describe('export output dimensions', () => {
expect(outputSize(edits, 4000, 3000)).toEqual({ w: 4950, h: 4950 }); expect(outputSize(edits, 4000, 3000)).toEqual({ w: 4950, h: 4950 });
}); });
it('writes the JPEG XL extension for a JXL export', () => {
const photo = { name: 'DSCF1234.RAF', addedAt: Date.now() } as PhotoRecord;
const name = buildFileName('{name}', photo, 0, { ...DEFAULT_EXPORT, format: 'jxl' });
expect(name).toBe('DSCF1234.jxl');
});
it('applies the crop after the rotated frame is calculated', () => { it('applies the crop after the rotated frame is calculated', () => {
const edits = defaultEdits(); const edits = defaultEdits();
edits.crop.angle = 45; edits.crop.angle = 45;
+41 -12
View File
@@ -1,6 +1,7 @@
import type { Edits, PhotoRecord } from '../types'; import type { Edits, PhotoRecord } from '../types';
import { get16BitSource, getBitmap } from './images'; import { get16BitSource, getBitmap } from './images';
import { normalizeEdits } from './edits'; import { normalizeEdits } from './edits';
import { photoMetadataAttributes, photoMetadataElements } from './xmp';
import { buildLensCorrection } from './lensEngine'; import { buildLensCorrection } from './lensEngine';
import { outputSize, Renderer } from '../gl/renderer'; import { outputSize, Renderer } from '../gl/renderer';
import { getDenoisedBitmap } from './images'; import { getDenoisedBitmap } from './images';
@@ -8,8 +9,9 @@ import { createZipBlob, zipFileName } from './zip';
import { profileFor, type OutputColorSpace } from './icc'; import { profileFor, type OutputColorSpace } from './icc';
import { convertFloatPixels, convertImageData } from './colorSpace'; import { convertFloatPixels, convertImageData } from './colorSpace';
import { encodeTiff16 } from './tiff'; import { encodeTiff16 } from './tiff';
import { encodeJxl } from './jxl';
export type ExportFormat = 'jpeg' | 'png' | 'webp' | 'tiff16'; export type ExportFormat = 'jpeg' | 'png' | 'webp' | 'tiff16' | 'jxl';
export type ResizeMode = 'none' | 'longEdge' | 'percent'; export type ResizeMode = 'none' | 'longEdge' | 'percent';
export type WatermarkPosition = 'br' | 'bl' | 'tr' | 'tl' | 'center'; export type WatermarkPosition = 'br' | 'bl' | 'tr' | 'tl' | 'center';
@@ -27,6 +29,8 @@ export interface ExportOptions {
zip: boolean; zip: boolean;
/** Extra capture sharpening applied only to the exported pixels. */ /** Extra capture sharpening applied only to the exported pixels. */
outputSharpen: number; outputSharpen: number;
/** JPEG XL only: keep every pixel instead of using the quality slider. */
jxlLossless?: boolean;
/** Write title/caption/creator/copyright/keywords into the file. */ /** Write title/caption/creator/copyright/keywords into the file. */
metadata: boolean; metadata: boolean;
/** Embed the generated sRGB ICC profile in JPEG/TIFF files. */ /** Embed the generated sRGB ICC profile in JPEG/TIFF files. */
@@ -56,6 +60,7 @@ export const DEFAULT_EXPORT: ExportOptions = {
nameTemplate: '{name}', nameTemplate: '{name}',
zip: true, zip: true,
outputSharpen: 0, outputSharpen: 0,
jxlLossless: false,
metadata: true, metadata: true,
embedProfile: true, embedProfile: true,
watermark: { enabled: false, text: '', position: 'br', opacity: 55, size: 4 }, watermark: { enabled: false, text: '', position: 'br', opacity: 55, size: 4 },
@@ -66,6 +71,7 @@ const MIME: Record<ExportFormat, string> = {
png: 'image/png', png: 'image/png',
webp: 'image/webp', webp: 'image/webp',
tiff16: 'image/tiff', tiff16: 'image/tiff',
jxl: 'image/jxl',
}; };
const EXT: Record<ExportFormat, string> = { const EXT: Record<ExportFormat, string> = {
@@ -73,6 +79,7 @@ const EXT: Record<ExportFormat, string> = {
png: 'png', png: 'png',
webp: 'webp', webp: 'webp',
tiff16: 'tif', tiff16: 'tif',
jxl: 'jxl',
}; };
function download(blob: Blob, filename: string) { function download(blob: Blob, filename: string) {
@@ -178,6 +185,12 @@ export async function renderPhotoBlob(
if (opts.watermark.enabled && opts.watermark.text.trim()) { if (opts.watermark.enabled && opts.watermark.text.trim()) {
output = paintWatermark(output, photo, opts); output = paintWatermark(output, photo, opts);
} }
if (opts.format === 'jxl') {
return encodeJxl(readPixels(output), {
quality: opts.quality,
lossless: opts.jxlLossless === true,
});
}
const mime = MIME[opts.format]; const mime = MIME[opts.format];
let blob = await new Promise<Blob | null>((resolve) => let blob = await new Promise<Blob | null>((resolve) =>
output.toBlob(resolve, mime, Math.min(1, Math.max(0.1, opts.quality / 100))), output.toBlob(resolve, mime, Math.min(1, Math.max(0.1, opts.quality / 100))),
@@ -197,6 +210,20 @@ export async function renderPhotoBlob(
} }
} }
/**
* The render canvas holds a WebGL context, so its pixels have to be drawn into
* a 2D canvas before an encoder can read them.
*/
function readPixels(source: HTMLCanvasElement): ImageData {
const canvas = document.createElement('canvas');
canvas.width = source.width;
canvas.height = source.height;
const ctx = canvas.getContext('2d', { willReadFrequently: true });
if (!ctx) throw new Error('Could not read the export pixels');
ctx.drawImage(source, 0, 0);
return ctx.getImageData(0, 0, canvas.width, canvas.height);
}
function convertCanvas(source: HTMLCanvasElement, space: OutputColorSpace) { function convertCanvas(source: HTMLCanvasElement, space: OutputColorSpace) {
const canvas = document.createElement('canvas'); const canvas = document.createElement('canvas');
canvas.width = source.width; canvas.width = source.width;
@@ -246,18 +273,20 @@ function paintWatermark(source: HTMLCanvasElement, photo: PhotoRecord, opts: Exp
return canvas; return canvas;
} }
function xmlEscape(value: string) { /**
return value * The XMP packet embedded in an exported file.
.replace(/&/g, '&amp;') *
.replace(/</g, '&lt;') * Built from the same helpers the sidecar writer uses, so a JPEG and its .xmp
.replace(/>/g, '&gt;') * cannot drift: rating, colour label, keywords, the `lr:` hierarchy and the
.replace(/"/g, '&quot;'); * IPTC core all travel with the file.
} */
function buildXmp(photo: PhotoRecord) { function buildXmp(photo: PhotoRecord) {
const title = photo.title || photo.name; return `<?xpacket begin="\ufeff" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:lr="http://ns.adobe.com/lightroom/1.0/"${photoMetadataAttributes(
const keywords = photo.keywords.map((word) => `<rdf:li>${xmlEscape(word)}</rdf:li>`).join(''); photo,
return `<?xpacket begin="\ufeff" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"><dc:title><rdf:Alt><rdf:li xml:lang="x-default">${xmlEscape(title)}</rdf:li></rdf:Alt></dc:title><dc:description><rdf:Alt><rdf:li xml:lang="x-default">${xmlEscape(photo.caption ?? '')}</rdf:li></rdf:Alt></dc:description><dc:creator><rdf:Seq><rdf:li>${xmlEscape(photo.creator ?? '')}</rdf:li></rdf:Seq></dc:creator><dc:rights><rdf:Alt><rdf:li xml:lang="x-default">${xmlEscape(photo.copyright ?? '')}</rdf:li></rdf:Alt></dc:rights><dc:subject><rdf:Bag>${keywords}</rdf:Bag></dc:subject></rdf:Description></rdf:RDF></x:xmpmeta><?xpacket end="w"?>`.slice(0, 65000); )}>${photoMetadataElements(photo)}</rdf:Description></rdf:RDF></x:xmpmeta><?xpacket end="w"?>`.slice(
0,
65000,
);
} }
function appSegment(marker: number, header: Uint8Array, payload: Uint8Array): Uint8Array | null { function appSegment(marker: number, header: Uint8Array, payload: Uint8Array): Uint8Array | null {
+105 -9
View File
@@ -10,6 +10,8 @@ export interface ImportProgress {
done: number; done: number;
total: number; total: number;
current: string; current: string;
/** Files that have not started yet, so a long queue reads as working. */
waiting?: number;
} }
export interface ImportResult { export interface ImportResult {
@@ -20,13 +22,44 @@ export interface ImportResult {
/** Provided by the app when a Luminary server is connected. */ /** Provided by the app when a Luminary server is connected. */
export interface CloudImport { export interface CloudImport {
uploadOriginal: (id: string, file: File, name: string) => Promise<UploadResult>; uploadOriginal: (
id: string,
file: File,
name: string,
options?: { sidecar?: boolean },
) => Promise<UploadResult>;
push: (photo: PhotoRecord) => Promise<PhotoRecord>; push: (photo: PhotoRecord) => Promise<PhotoRecord>;
} }
/** Files imported at once; the server bounds how many raws decode in parallel. */ export interface ImportOptions {
/**
* Keep the 16-bit sidecar for raws in this import. On by default: the editor
* grades the decoded samples instead of 256-level JPEG pixels. Turning it off
* makes each raw import smaller and quicker, at the cost of an 8-bit grade.
*/
sidecar16?: boolean;
}
/** Files imported at once when a Luminary server is connected. */
const IMPORT_CONCURRENCY = 4; const IMPORT_CONCURRENCY = 4;
/**
* Raws and TIFFs are decoded by the server, which is where the work piles up, so
* this window is about one thing: how long a single upload request stays open.
*
* Measured on a 12-core server with 40 MP X-Trans RAFs through the real decode
* path: one file 28.4 s, two at once 44.4-45.4 s each, four at once 87.4-102.4 s
* each. Parallel X-Trans decodes barely scale here, so four-wide made every
* request about 1.5 minutes long and still finished sixteen files slower than
* two-wide (about 410 s against 360 s). Anything sitting in front of the server
* with a 60 s read timeout - the nginx default - answers 504 while the origin
* carries on decoding, which looks like a failed import of the files that were
* still in flight. Two keeps a request at ~45 s and is faster overall; Bayer
* files lose a little (8 NEFs took 20.8 s two at a time, 17.4 s four at a time)
* in exchange for every raw import staying inside a proxy's patience.
*/
const RAW_IMPORT_CONCURRENCY = 2;
export function uid(): string { export function uid(): string {
if (typeof crypto !== 'undefined' && 'randomUUID' in crypto) return crypto.randomUUID(); if (typeof crypto !== 'undefined' && 'randomUUID' in crypto) return crypto.randomUUID();
return `p_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`; return `p_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
@@ -44,6 +77,31 @@ function mapLimit<T>(items: T[], limit: number, fn: (item: T, index: number) =>
return Promise.all(runners); return Promise.all(runners);
} }
/**
* A counting semaphore. `acquire()` resolves with a release function, so a slot
* is returned even when the guarded work throws or the import is cancelled.
* Waiters are served in order.
*/
function createSemaphore(slots: number) {
let free = Math.max(1, slots);
const waiting: (() => void)[] = [];
return {
async acquire(): Promise<() => void> {
if (free > 0) free -= 1;
else await new Promise<void>((resolve) => waiting.push(resolve));
let released = false;
return () => {
if (released) return;
released = true;
const next = waiting.shift();
// Hand the slot straight over, so it is never briefly up for grabs.
if (next) next();
else free += 1;
};
},
};
}
function formatShutter(time: unknown): string | undefined { function formatShutter(time: unknown): string | undefined {
if (typeof time !== 'number' || !Number.isFinite(time) || time <= 0) return undefined; if (typeof time !== 'number' || !Number.isFinite(time) || time <= 0) return undefined;
if (time >= 1) return `${Math.round(time * 10) / 10}s`; if (time >= 1) return `${Math.round(time * 10) / 10}s`;
@@ -127,9 +185,10 @@ async function importRaw(
defaults: CameraLensDefault[], defaults: CameraLensDefault[],
/** TIFF goes through the same proxy path but is not a raw container. */ /** TIFF goes through the same proxy path but is not a raw container. */
raw = true, raw = true,
sidecar16 = true,
): Promise<PhotoRecord> { ): Promise<PhotoRecord> {
const id = uid(); const id = uid();
const upload = await cloud.uploadOriginal(id, file, file.name); const upload = await cloud.uploadOriginal(id, file, file.name, { sidecar: sidecar16 });
const previewUrl = upload.previewUrl ?? `/api/photos/${id}/preview`; const previewUrl = upload.previewUrl ?? `/api/photos/${id}/preview`;
const res = await fetch(previewUrl, { credentials: 'same-origin' }); const res = await fetch(previewUrl, { credentials: 'same-origin' });
if (!res.ok) throw new Error('The server could not produce a preview for this raw file'); if (!res.ok) throw new Error('The server could not produce a preview for this raw file');
@@ -137,8 +196,10 @@ async function importRaw(
const bitmap = await createImageBitmap(blob, { imageOrientation: 'from-image' }); const bitmap = await createImageBitmap(blob, { imageOrientation: 'from-image' });
const thumb = await makeThumb(bitmap); const thumb = await makeThumb(bitmap);
const { meta, takenAt } = await readMeta(file); const { meta, takenAt } = await readMeta(file);
const width = upload.width ?? bitmap.width; // `??` is wrong here: the server reports 0 for a dimension it could not read,
const height = upload.height ?? bitmap.height; // and 0 is not nullish, so a failed decode produced a 0x0 catalog record.
const width = upload.width || bitmap.width;
const height = upload.height || bitmap.height;
const edits = editsForImport(meta, defaults); const edits = editsForImport(meta, defaults);
bitmap.close(); bitmap.close();
@@ -232,7 +293,9 @@ export async function importFiles(
onProgress?: (p: ImportProgress) => void, onProgress?: (p: ImportProgress) => void,
cloud?: CloudImport | null, cloud?: CloudImport | null,
signal?: AbortSignal, signal?: AbortSignal,
options: ImportOptions = {},
): Promise<ImportResult> { ): Promise<ImportResult> {
const sidecar16 = options.sidecar16 !== false;
const result: ImportResult = { photos: [], failed: [] }; const result: ImportResult = { photos: [], failed: [] };
const images = files.filter(isSupportedFile); const images = files.filter(isSupportedFile);
const total = images.length; const total = images.length;
@@ -241,14 +304,43 @@ export async function importFiles(
const collected: { index: number; photo: PhotoRecord }[] = []; const collected: { index: number; photo: PhotoRecord }[] = [];
const defaults = await loadCameraLensDefaults().catch(() => []); const defaults = await loadCameraLensDefaults().catch(() => []);
let done = 0; let done = 0;
let active = 0;
// A wide selection spends most of its time inside a narrow window: without a
// waiting count the dialog would show "4 / 16" and no sign of the other 12.
const report = (current: string) =>
onProgress?.({ done, total, current, waiting: Math.max(0, total - done - active) });
const rawSlots = createSemaphore(RAW_IMPORT_CONCURRENCY);
await mapLimit(images, cloud ? IMPORT_CONCURRENCY : 2, async (file, index) => { await mapLimit(images, cloud ? IMPORT_CONCURRENCY : 2, async (file, index) => {
if (signal?.aborted) return; if (signal?.aborted) return;
try {
const viaServer = isRawFile(file) || isTiffFile(file); const viaServer = isRawFile(file) || isTiffFile(file);
// Camera JPEGs and PNGs stay this wide, because the browser decodes them
// locally and they are seconds apart at worst. A raw holds one of a couple
// of server slots first, so the upload window can stay wide for the network
// while the decode window stays as narrow as the decoder pool.
const release = viaServer ? await rawSlots.acquire() : null;
try {
// The import may have been cancelled while this file queued for a slot.
if (signal?.aborted) return;
// Report before the work starts, not only when it finishes. A 40 MP raw
// takes seconds, and four of them finish together: because progress was
// only emitted in `finally`, the bar stayed hidden until the first batch
// completed and then jumped to 4.
active += 1;
report(file.name);
try {
const photo = viaServer const photo = viaServer
? cloud ? cloud
? await importRaw(file, eventId, keywords, cloud, defaults, isRawFile(file)) ? await importRaw(
file,
eventId,
keywords,
cloud,
defaults,
isRawFile(file),
sidecar16,
)
: (() => { : (() => {
throw new Error('Raw files need the Luminary server. Sign in, then import again.'); throw new Error('Raw files need the Luminary server. Sign in, then import again.');
})() })()
@@ -260,8 +352,12 @@ export async function importFiles(
reason: err instanceof Error ? err.message : 'Unsupported image format', reason: err instanceof Error ? err.message : 'Unsupported image format',
}); });
} finally { } finally {
active -= 1;
done += 1; done += 1;
onProgress?.({ done, total, current: file.name }); report(file.name);
}
} finally {
release?.();
} }
}); });
@@ -269,6 +365,6 @@ export async function importFiles(
collected.sort((a, b) => a.index - b.index); collected.sort((a, b) => a.index - b.index);
result.photos = collected.map((c) => c.photo); result.photos = collected.map((c) => c.photo);
result.cancelled = Boolean(signal?.aborted); result.cancelled = Boolean(signal?.aborted);
onProgress?.({ done: total, total, current: '' }); onProgress?.({ done: total, total, current: '', waiting: 0 });
return result; return result;
} }
+82
View File
@@ -0,0 +1,82 @@
/**
* JPEG XL export (8-bit sRGB), encoded by libjxl compiled to WebAssembly.
*
* The codec is imported on demand: it is roughly 1.4 MB of wasm plus glue, and
* most sessions never export a JXL. Only the single-threaded build is used —
* the app is not cross-origin isolated, so the multithreaded glue would fall
* back anyway, and its worker entry points cannot be bundled.
*
* The glue resolves its wasm relative to its own module URL, which a bundler
* rewrites; `locateFile` points it at the URL Vite actually emitted.
*/
import jxlWasm from '@jsquash/jxl/codec/enc/jxl_enc.wasm?url';
export interface JxlOptions {
/** 1–100, the same number the modal's quality slider shows. */
quality: number;
lossless: boolean;
}
interface JxlEncodeOptions {
effort: number;
quality: number;
lossless: boolean;
progressive: boolean;
epf: number;
lossyPalette: boolean;
decodingSpeedTier: number;
photonNoiseIso: number;
lossyModular: boolean;
}
interface JxlModule {
encode(data: BufferSource, width: number, height: number, options: JxlEncodeOptions): Uint8Array | null;
}
let encoder: Promise<JxlModule> | null = null;
function loadEncoder(): Promise<JxlModule> {
if (!encoder) {
encoder = (async () => {
const [{ default: factory }, { initEmscriptenModule }] = await Promise.all([
import('@jsquash/jxl/codec/enc/jxl_enc.js'),
import('@jsquash/jxl/utils.js'),
]);
const module = await initEmscriptenModule(factory as never, undefined, {
locateFile: (path: string) => (path.endsWith('jxl_enc.wasm') ? jxlWasm : path),
});
return module as unknown as JxlModule;
})().catch((error) => {
// A failed load must not poison every later export.
encoder = null;
throw error;
});
}
return encoder;
}
export async function encodeJxl(image: ImageData, options: JxlOptions): Promise<Blob> {
const module = await loadEncoder();
const lossless = options.lossless === true;
const quality = Math.min(100, Math.max(1, Math.round(options.quality || 90)));
const result = module.encode(image.data, image.width, image.height, {
quality: lossless ? 100 : quality,
lossless,
// libjxl defaults to effort 7, which is a long wait single-threaded on a
// 45 MP frame. 5 keeps a batch moving and costs little for photographs.
effort: 5,
progressive: false,
epf: -1,
lossyPalette: false,
decodingSpeedTier: 0,
photonNoiseIso: 0,
lossyModular: false,
});
if (!result || !result.byteLength) throw new Error('JPEG XL encoding failed');
// A fresh buffer: the encoder returns a view that may over-allocate, and a
// Blob must not keep the wasm heap alive.
const bytes = new Uint8Array(result.byteLength);
bytes.set(result);
return new Blob([bytes], { type: 'image/jxl' });
}
+99
View File
@@ -0,0 +1,99 @@
import { describe, expect, it } from 'vitest';
import {
addKeywordPath,
collectKeywordPaths,
keywordTree,
normalizeKeywordPath,
pathAncestors,
pathLeaf,
pathsUnder,
removeKeywordPath,
} from './keywords';
const empty = { keywords: [] as string[], keywordPaths: [] as string[] };
describe('keyword paths', () => {
it('normalises every separator to the Lightroom form', () => {
expect(normalizeKeywordPath('Nature>Birds>Robin')).toBe('Nature > Birds > Robin');
expect(normalizeKeywordPath('Nature/Birds / Robin ')).toBe('Nature > Birds > Robin');
expect(normalizeKeywordPath('Nature | Birds')).toBe('Nature > Birds');
expect(normalizeKeywordPath(' ')).toBe('');
});
it('reads the leaf and the ancestor chain', () => {
expect(pathLeaf('Nature > Birds > Robin')).toBe('Robin');
expect(pathAncestors('Nature > Birds > Robin')).toEqual([
'Nature',
'Nature > Birds',
'Nature > Birds > Robin',
]);
});
it('records ancestors and puts the leaf in the flat list', () => {
const next = addKeywordPath(empty, 'Nature > Birds > Robin');
expect(next.keywordPaths).toEqual([
'Nature',
'Nature > Birds',
'Nature > Birds > Robin',
]);
expect(next.keywords).toEqual(['Robin']);
});
it('keeps a plain word flat', () => {
const next = addKeywordPath(empty, 'Robin', false);
expect(next.keywords).toEqual(['Robin']);
expect(next.keywordPaths).toEqual([]);
});
it('does not duplicate on case alone', () => {
const first = addKeywordPath(empty, 'Nature > Birds');
const second = addKeywordPath(first, 'nature > birds');
expect(second.keywordPaths).toEqual(['Nature', 'Nature > Birds']);
expect(second.keywords).toEqual(['Birds']);
});
it('removes a subtree and the leaves it stranded', () => {
const full = addKeywordPath(addKeywordPath(empty, 'Nature > Birds > Robin'), 'Nature > Birds > Wren');
const next = removeKeywordPath(full, 'Nature > Birds');
expect(next.keywordPaths).toEqual(['Nature']);
// Robin and Wren came only from the removed branch, Birds was the node.
expect(next.keywords).toEqual([]);
});
it('keeps a leaf that another path still uses', () => {
const both = addKeywordPath(addKeywordPath(empty, 'Nature > Birds > Robin'), 'Garden > Robin');
const next = removeKeywordPath(both, 'Nature > Birds');
expect(next.keywords).toEqual(['Robin']);
expect(next.keywordPaths).toEqual(['Nature', 'Garden', 'Garden > Robin']);
});
it('collects suggestions once, sorted', () => {
const rows = [
{ keywordPaths: ['Nature > Birds', 'Nature'] },
{ keywordPaths: ['nature', 'Places > Coast'] },
{},
];
expect(collectKeywordPaths(rows)).toEqual(['Nature', 'Nature > Birds', 'Places > Coast']);
});
it('builds a tree with parents before children', () => {
const tree = keywordTree(['Nature > Birds > Robin', 'Nature > Plants', 'Places']);
expect(tree.map((node) => node.name)).toEqual(['Nature', 'Places']);
const nature = tree[0];
expect(nature.path).toBe('Nature');
expect(nature.children.map((node) => node.name)).toEqual(['Birds', 'Plants']);
expect(nature.children[0].children.map((node) => node.name)).toEqual(['Robin']);
expect(nature.children[0].children[0].path).toBe('Nature > Birds > Robin');
});
it('expands a node to everything under it', () => {
const paths = ['Nature', 'Nature > Birds', 'Nature > Birds > Robin', 'Places > Coast'];
expect(pathsUnder(paths, 'Nature > Birds')).toEqual([
'Nature > Birds',
'Nature > Birds > Robin',
]);
expect(pathsUnder(paths, 'Places')).toEqual(['Places > Coast']);
// A prefix that is not a path boundary must not match.
expect(pathsUnder(paths, 'Nat')).toEqual([]);
});
});
+181
View File
@@ -0,0 +1,181 @@
/**
* Hierarchical keywords, stored so other software can still read them.
*
* A flat keyword list is portable but useless past a few hundred terms; a tree
* is useful but has no agreed storage format. Lightroom's answer is to write
* both: `dc:subject` carries the leaf terms, `lr:hierarchicalSubject` carries
* the full paths. This module keeps the same pair in the catalog:
*
* keywords ['Robin'] <- what search and filters use
* keywordPaths ['Nature > Birds > Robin'] <- where it sits
*
* Ancestors are included in `keywordPaths` the way Lightroom does, so a path is
* never a dangling leaf and importing a sidecar cannot invent a parent.
*
* The separator is `>` with spaces because that is the convention every DAM
* reads and writes; a user typing `Nature>Birds` gets normalised.
*/
export const KEYWORD_SEPARATOR = ' > ';
const MAX_DEPTH = 6;
const MAX_SEGMENT = 48;
export interface KeywordPaths {
keywords: string[];
keywordPaths: string[];
}
/** Split a typed path into clean segments. Accepts `>`, `/` and `|`. */
export function pathSegments(input: string): string[] {
return input
.split(/\s*(?:>|\/|\|)\s*/)
.map((part) => part.trim())
.filter(Boolean)
.slice(0, MAX_DEPTH)
.map((part) => part.slice(0, MAX_SEGMENT));
}
/** Canonical `A > B > C` form for a typed or imported path. */
export function normalizeKeywordPath(input: string): string {
return pathSegments(input).join(KEYWORD_SEPARATOR);
}
/** The leaf term of a path, which is what `keywords` stores. */
export function pathLeaf(path: string): string {
const segments = pathSegments(path);
return segments[segments.length - 1] ?? '';
}
/** `A > B > C` → `['A', 'A > B', 'A > B > C']`. */
export function pathAncestors(path: string): string[] {
const segments = pathSegments(path);
return segments.map((_, index) => segments.slice(0, index + 1).join(KEYWORD_SEPARATOR));
}
function sameKey(a: string, b: string) {
return a.toLowerCase() === b.toLowerCase();
}
function addUnique(list: string[], value: string) {
if (!value) return;
if (list.some((item) => sameKey(item, value))) return;
list.push(value);
}
/**
* Add a typed path (or a plain keyword) to a photo's pair of lists.
*
* A plain word stays flat; anything with a separator also records its
* ancestors. The leaf always lands in `keywords`, so a photo tagged
* `Nature > Birds > Robin` still matches a search for "Robin".
*/
export function addKeywordPath(
current: KeywordPaths,
input: string,
asPath = input.includes('>') || input.includes('/') || input.includes('|'),
): KeywordPaths {
const keywords = [...current.keywords];
const keywordPaths = [...current.keywordPaths];
const normalized = normalizeKeywordPath(input);
if (!normalized) return { keywords, keywordPaths };
addUnique(keywords, pathLeaf(normalized));
if (asPath) {
for (const ancestor of pathAncestors(normalized)) addUnique(keywordPaths, ancestor);
}
return { keywords, keywordPaths };
}
/**
* Remove a path and everything under it, then drop leaves that nothing refers
* to any more. Removing `Birds` must not leave `Robin` behind as a keyword with
* no tree above it, which is how hierarchies rot.
*/
export function removeKeywordPath(current: KeywordPaths, path: string): KeywordPaths {
const target = normalizeKeywordPath(path);
if (!target) return current;
const removed = current.keywordPaths.filter(
(entry) => entry === target || entry.startsWith(`${target}${KEYWORD_SEPARATOR}`),
);
const keywordPaths = current.keywordPaths.filter((entry) => !removed.includes(entry));
// Every leaf the removal takes with it: the node's own and its descendants'.
const goneLeaves = new Set(removed.map((entry) => pathLeaf(entry).toLowerCase()));
goneLeaves.add(pathLeaf(target).toLowerCase());
const stillUsed = new Set(keywordPaths.map((entry) => pathLeaf(entry).toLowerCase()));
const keywords = current.keywords.filter(
(word) => stillUsed.has(word.toLowerCase()) || !goneLeaves.has(word.toLowerCase()),
);
return { keywords, keywordPaths };
}
/** Every path in a library, sorted, for suggestions. */
export function collectKeywordPaths(rows: { keywordPaths?: string[] }[]): string[] {
// Case-insensitive dedupe, first spelling wins: "nature" and "Nature" are
// one suggestion, not two entries that look like a bug.
const seen = new Map<string, string>();
for (const row of rows) {
for (const path of row.keywordPaths ?? []) {
const normalized = normalizeKeywordPath(path);
const key = normalized.toLowerCase();
if (normalized && !seen.has(key)) seen.set(key, normalized);
}
}
return [...seen.values()].sort((a, b) => a.localeCompare(b));
}
export interface KeywordNode {
/** Segment name, e.g. "Birds". */
name: string;
/** Full path, e.g. "Nature > Birds". */
path: string;
children: KeywordNode[];
}
function insert(nodes: KeywordNode[], segments: string[], prefix: string[] = []) {
const [head, ...rest] = segments;
if (!head) return;
// The path is this node's own, built from the prefix above it -- not the
// whole path being inserted, which would rename every parent to its deepest
// descendant.
const selfPath = [...prefix, head];
let node = nodes.find((entry) => entry.name.toLowerCase() === head.toLowerCase());
if (!node) {
node = { name: head, path: selfPath.join(KEYWORD_SEPARATOR), children: [] };
nodes.push(node);
}
if (rest.length > 0) insert(node.children, rest, selfPath);
}
/** Paths → a tree for rendering. Sorted, with parents before children. */
export function keywordTree(paths: string[]): KeywordNode[] {
const roots: KeywordNode[] = [];
for (const path of paths) {
const segments = pathSegments(path);
if (segments.length === 0) continue;
if (segments.length === 1) {
// A flat keyword appears as its own root, with no children.
if (!roots.some((node) => node.name.toLowerCase() === segments[0].toLowerCase())) {
roots.push({ name: segments[0], path: segments[0], children: [] });
}
continue;
}
insert(roots, segments);
}
const sort = (nodes: KeywordNode[]) => {
nodes.sort((a, b) => a.name.localeCompare(b.name));
for (const node of nodes) sort(node.children);
};
sort(roots);
return roots;
}
/** Every path at or under `root`, so tagging a parent tags its children. */
export function pathsUnder(paths: string[], root: string): string[] {
const target = normalizeKeywordPath(root);
if (!target) return [];
return paths.filter(
(path) => path === target || path.startsWith(`${target}${KEYWORD_SEPARATOR}`),
);
}
+77 -2
View File
@@ -1,6 +1,12 @@
import { describe, expect, it } from 'vitest'; import { describe, expect, it } from 'vitest';
import { applyFilmVariant, FILM_PRESETS, PRESETS, PRESET_CATEGORIES } from './presets'; import {
import { normalizeEdits } from './edits'; applyFilmVariant,
applyPresetEdits,
FILM_PRESETS,
PRESETS,
PRESET_CATEGORIES,
} from './presets';
import { defaultEdits, normalizeEdits } from './edits';
describe('preset library', () => { describe('preset library', () => {
it('ships an extensive, uniquely identified catalogue', () => { it('ships an extensive, uniquely identified catalogue', () => {
@@ -44,6 +50,21 @@ describe('preset library', () => {
expect(redscale.some((preset) => preset.film?.process === 'E-6')).toBe(true); expect(redscale.some((preset) => preset.film?.process === 'E-6')).toBe(true);
}); });
it('keeps a user preset a full recipe rather than a cast', () => {
const base = { ...defaultEdits(), temp: -24, tint: 9 };
const custom = {
id: 'my-look',
name: 'My look',
group: 'User presets',
custom: true,
edits: { temp: 30, contrast: 12 },
};
const next = applyPresetEdits(base, custom);
expect(next.temp).toBe(30);
expect(next.presetLook).toEqual({ temp: 0, tint: 0 });
expect(next.contrast).toBe(12);
});
it('derives push/pull variants for film stocks only', () => { it('derives push/pull variants for film stocks only', () => {
const stock = FILM_PRESETS[0]; const stock = FILM_PRESETS[0];
expect(applyFilmVariant(stock, 'push').id).toBe(`${stock.id}::push`); expect(applyFilmVariant(stock, 'push').id).toBe(`${stock.id}::push`);
@@ -52,3 +73,57 @@ describe('preset library', () => {
expect(applyFilmVariant(look!, 'push')).toBe(look); expect(applyFilmVariant(look!, 'push')).toBe(look);
}); });
}); });
describe('looks over the photo’s own grade', () => {
const graded = () => ({ ...defaultEdits(), temp: -24, tint: 9 });
it('keeps the white balance already set and layers the look’s cast on it', () => {
const stock = FILM_PRESETS.find((preset) => (preset.edits.temp ?? 0) !== 0)!;
const next = applyPresetEdits(graded(), stock);
expect(next.temp).toBe(-24);
expect(next.tint).toBe(9);
expect(next.presetLook).toEqual({
temp: stock.edits.temp ?? 0,
tint: stock.edits.tint ?? 0,
});
// The look still sets its own tone and colour.
expect(next.contrast).toBe(stock.edits.contrast);
});
it('replaces the previous look’s cast instead of stacking it', () => {
const warm = FILM_PRESETS.find((preset) => (preset.edits.temp ?? 0) > 10)!;
const cool = FILM_PRESETS.find((preset) => (preset.edits.temp ?? 0) < -10)!;
const once = applyPresetEdits(graded(), warm);
const twice = applyPresetEdits(once, cool);
expect(twice.temp).toBe(-24);
expect(twice.tint).toBe(9);
expect(twice.presetLook).toEqual({ temp: cool.edits.temp ?? 0, tint: cool.edits.tint ?? 0 });
});
it('leaves the white balance alone for a preset with no cast of its own', () => {
const plain = PRESETS.find(
(preset) =>
preset.id !== 'original' &&
!preset.film &&
preset.edits.temp === undefined &&
preset.edits.tint === undefined,
)!;
const next = applyPresetEdits(graded(), plain);
expect(next.temp).toBe(-24);
expect(next.tint).toBe(9);
expect(next.presetLook).toEqual({ temp: 0, tint: 0 });
});
it('clears the grade and the cast with the original', () => {
const applied = applyPresetEdits(graded(), FILM_PRESETS[0]);
const original = applyPresetEdits(applied, {
id: 'original',
name: 'Original',
group: 'Essentials',
edits: {},
});
expect(original.temp).toBe(0);
expect(original.tint).toBe(0);
expect(original.presetLook).toEqual({ temp: 0, tint: 0 });
});
});
+39
View File
@@ -1,4 +1,5 @@
import type { BwFilter, Edits, Preset } from '../types'; import type { BwFilter, Edits, Preset } from '../types';
import { defaultEdits, normalizeEdits } from './edits';
const identity = () => [ const identity = () => [
{ x: 0, y: 0 }, { x: 0, y: 0 },
@@ -2925,6 +2926,44 @@ export const PRESETS: Preset[] = ([
: preset; : preset;
}); });
/**
* Applies a look over the grade the photo already has.
*
* White balance is the base the look is graded against: the look's own Temp and
* Tint become a cast in `presetLook` on top of the correction already made,
* instead of overwriting it. Storing the cast apart also means switching looks
* replaces it rather than stacking one stock's warmth on the last one's, and
* the preview tiles can show exactly what the click will produce. A user preset
* is a recipe copied from a photo, so it still replaces the whole grade, and
* "original" clears it.
*/
export function applyPresetEdits(base: Edits, preset: Preset): Edits {
if (preset.id === 'original') {
return { ...defaultEdits(), crop: base.crop, cameraProfile: base.cameraProfile };
}
const { temp = 0, tint = 0, ...look } = preset.edits;
const next: Edits = {
...base,
...look,
crop: base.crop,
// The camera profile belongs to the body that produced the raw.
cameraProfile: base.cameraProfile,
// A strong film response must not leak into the next look.
redscale: look.redscale ?? 0,
};
if (preset.custom) {
// A recipe keeps the white balance it was saved with.
next.temp = temp;
next.tint = tint;
} else {
next.temp = base.temp;
next.tint = base.tint;
next.kelvin = base.kelvin;
next.presetLook = { temp, tint };
}
return normalizeEdits(next);
}
/* ------------------------------------------------------------- film variants */ /* ------------------------------------------------------------- film variants */
export type FilmVariant = 'base' | 'push' | 'pull' | 'warm' | 'cool'; export type FilmVariant = 'base' | 'push' | 'pull' | 'warm' | 'cool';
+66 -1
View File
@@ -1,5 +1,48 @@
import { describe, expect, it } from 'vitest'; import { describe, expect, it } from 'vitest';
import { kelvinGains, wbGainFor, WB_REFERENCE_KELVIN } from './whiteBalance'; import {
estimateKelvin,
expressWhiteBalance,
kelvinGains,
wbGainFor,
wbGainWithLook,
WB_REFERENCE_KELVIN,
} from './whiteBalance';
describe('expressWhiteBalance', () => {
it('recovers the sliders that produced a correction', () => {
for (const [temp, tint] of [
[30, -12],
[-55, 40],
[0, 0],
[80, 60],
]) {
const back = expressWhiteBalance(wbGainFor(temp, tint, null));
expect(back.temp).toBeCloseTo(temp, 0);
expect(back.tint).toBeCloseTo(tint, 0);
}
});
it('reads a look cast as the balance it leaves behind', () => {
const look = { temp: 35, tint: -8 };
const gain = wbGainWithLook(-20, 10, null, look);
const back = expressWhiteBalance(gain);
// The recovered pair reproduces the same gain the look left on the photo, to
// within what whole-number sliders can express.
const again = wbGainFor(back.temp, back.tint, null);
expect(again[0]).toBeCloseTo(gain[0], 2);
expect(again[1]).toBeCloseTo(gain[1], 2);
expect(again[2]).toBeCloseTo(gain[2], 2);
// Warm cast over a cool correction lands near the sum of the two.
expect(back.temp).toBeGreaterThan(11);
expect(back.temp).toBeLessThan(19);
});
it('estimates the Kelvin of an absolute balance', () => {
expect(estimateKelvin(kelvinGains(3200))).toBeGreaterThan(3100);
expect(estimateKelvin(kelvinGains(3200))).toBeLessThan(3300);
expect(estimateKelvin(kelvinGains(WB_REFERENCE_KELVIN))).toBeCloseTo(WB_REFERENCE_KELVIN, -2);
});
});
describe('absolute white balance', () => { describe('absolute white balance', () => {
it('is neutral at the daylight reference', () => { it('is neutral at the daylight reference', () => {
@@ -32,4 +75,26 @@ describe('absolute white balance', () => {
expect(luma).toBeCloseTo(1, 4); expect(luma).toBeCloseTo(1, 4);
} }
}); });
it('grades a look’s cast over the correction already made', () => {
const corrected = wbGainFor(-30, 0, null);
const withLook = wbGainWithLook(-30, 0, null, { temp: 20, tint: 0 });
// The look warms the corrected frame without throwing the correction away.
expect(withLook[0]).toBeGreaterThan(corrected[0]);
expect(withLook[2]).toBeLessThan(corrected[2]);
// Adding the two offsets is what the sliders would do by hand.
const summed = wbGainFor(-10, 0, null);
expect(withLook[0]).toBeCloseTo(summed[0], 2);
expect(withLook[2]).toBeCloseTo(summed[2], 2);
const luma = 0.2126 * withLook[0] + 0.7152 * withLook[1] + 0.0722 * withLook[2];
expect(luma).toBeCloseTo(1, 4);
});
it('leaves the gain untouched when the look has no cast', () => {
expect(wbGainWithLook(0, 0, null, { temp: 0, tint: 0 })).toEqual(wbGainFor(0, 0, null));
// An absolute Kelvin correction is still the base for the cast.
const kelvin = wbGainFor(0, 0, 3200);
const warmed = wbGainWithLook(0, 0, 3200, { temp: 12, tint: 0 });
expect(warmed[0]).toBeGreaterThan(kelvin[0]);
});
}); });
+68
View File
@@ -108,6 +108,74 @@ export function wbGainFor(
return gain.map((v) => v / norm) as [number, number, number]; return gain.map((v) => v / norm) as [number, number, number];
} }
/**
* The white balance with an applied look's cast layered over it.
*
* The correction the photographer already made stays the base: a look's
* Temp/Tint is a cast added on top, not a replacement for it. Keeping the two
* separate (see `Edits['presetLook']`) also lets switching looks swap the cast
* instead of stacking one stock's warmth on the last one's. Normalised again
* so the look changes colour, not exposure.
*/
export function wbGainWithLook(
temp: number,
tint: number,
kelvin: number | null,
look: { temp: number; tint: number } | null | undefined,
): [number, number, number] {
const base = wbGainFor(temp, tint, kelvin);
if (!look || (!look.temp && !look.tint)) return base;
const cast = wbGainFor(look.temp, look.tint, null);
const gain: [number, number, number] = [base[0] * cast[0], base[1] * cast[1], base[2] * cast[2]];
const luma = 0.2126 * gain[0] + 0.7152 * gain[1] + 0.0722 * gain[2];
const norm = Math.max(0.05, luma);
return gain.map((v) => v / norm) as [number, number, number];
}
/**
* The Temp/Tint pair that reproduces a gain vector.
*
* A look layers its cast over the correction, so the two sliders no longer show
* what the photo is graded at. Inverting the gains (ratios only, so the shared
* luma normalisation drops out) gives the pair that would: `r/b` is fixed by
* temperature alone, then green carries the tint.
*/
export function expressWhiteBalance(
gain: readonly number[],
): { temp: number; tint: number } {
const [r, g, b] = gain;
if (![r, g, b].every((v) => Number.isFinite(v) && v > 0)) return { temp: 0, tint: 0 };
// r/b = (1 + 0.3t) / (1 − 0.26t)
const t = (r - b) / (T_R * b + T_B * r);
// g/r = (1 − 0.16i) / ((1 + 0.3t)(1 + 0.06i))
const d = 1 + T_R * t;
const a = g / r;
const i = (1 - a * d) / (TINT_CROSS * a * d + T_TINT);
return {
temp: Math.round(clampRange(t * 100, -100, 100)),
tint: Math.round(clampRange(i * 100, -100, 100)),
};
}
/**
* The Kelvin setting whose black-body balance best matches a gain vector's red
* to blue ratio. Used to report a look's cast on the absolute-Kelvin control.
*/
export function estimateKelvin(gain: readonly number[]): number {
const target = Math.log(Math.max(1e-4, gain[0]) / Math.max(1e-4, gain[2]));
let best = WB_REFERENCE_KELVIN;
let bestErr = Infinity;
for (let k = 1500; k <= 12000; k += 25) {
const [r, , b] = kelvinGains(k);
const err = Math.abs(Math.log(r / b) - target);
if (err < bestErr) {
bestErr = err;
best = k;
}
}
return best;
}
/** /**
* Temperature and tint that make a sampled source colour neutral. * Temperature and tint that make a sampled source colour neutral.
* `sample` is the untouched (sRGB-encoded) source pixel, 0–1 per channel. * `sample` is the untouched (sRGB-encoded) source pixel, 0–1 per channel.
+76 -1
View File
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest'; import { describe, expect, it } from 'vitest';
import { defaultEdits, defaultLocalLayer, normalizeEdits } from './edits'; import { defaultEdits, defaultLocalLayer, normalizeEdits } from './edits';
import { editsToXmp, xmpFileName, xmpToEdits } from './xmp'; import { editsToXmp, xmpFileName, xmpToEdits, xmpToMetadata } from './xmp';
describe('xmp sidecars', () => { describe('xmp sidecars', () => {
it('round-trips every develop field exactly', () => { it('round-trips every develop field exactly', () => {
@@ -55,3 +55,78 @@ describe('xmp sidecars', () => {
expect(xmpFileName('no-extension')).toBe('no-extension.xmp'); expect(xmpFileName('no-extension')).toBe('no-extension.xmp');
}); });
}); });
describe('xmp metadata', () => {
const photo = {
name: 'DSC0123.ARW',
meta: {},
rating: 4,
color: 'green' as const,
keywords: ['Birds', 'Robin'],
keywordPaths: ['Nature', 'Nature > Birds', 'Nature > Birds > Robin'],
iptc: {
headline: 'Dawn chorus',
credit: 'B. Hursey',
source: 'Field notes',
city: 'Bristol',
state: 'Somerset',
country: 'UK',
location: 'Ashton Court',
},
title: 'Robin at dawn',
caption: 'First light, heavy frost',
creator: 'Brian Hursey',
copyright: '© 2026 Brian Hursey',
};
it('writes rating, label, keywords, hierarchy and IPTC, and reads them back', () => {
const xml = editsToXmp(defaultEdits(), photo);
expect(xml).toContain('xmp:Rating="4"');
expect(xml).toContain('xmp:Label="Green"');
expect(xml).toContain('<lr:hierarchicalSubject>');
expect(xml).toContain('photoshop:City="Bristol"');
expect(xml).toContain('Iptc4xmpCore:Location="Ashton Court"');
const meta = xmpToMetadata(xml);
expect(meta.rating).toBe(4);
expect(meta.label).toBe('green');
expect(meta.keywords).toEqual(['Birds', 'Robin']);
expect(meta.keywordPaths).toEqual([
'Nature',
'Nature > Birds',
'Nature > Birds > Robin',
]);
expect(meta.iptc).toEqual(photo.iptc);
expect(meta.title).toBe('Robin at dawn');
expect(meta.caption).toBe('First light, heavy frost');
expect(meta.creator).toBe('Brian Hursey');
expect(meta.copyright).toBe('© 2026 Brian Hursey');
});
it('reads a sidecar written by Lightroom', () => {
const xml = `<?xpacket begin=""?><x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmlns:lr="http://ns.adobe.com/lightroom/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmp:Rating="2" xmp:Label="Red" photoshop:Headline="Press day" photoshop:Country="Ireland"><dc:subject><rdf:Bag><rdf:li>Portrait</rdf:li><rdf:li>Maya</rdf:li></rdf:Bag></dc:subject><lr:hierarchicalSubject><rdf:Bag><rdf:li>People &gt; Portrait</rdf:li></rdf:Bag></lr:hierarchicalSubject></rdf:Description></rdf:RDF></x:xmpmeta>`;
const meta = xmpToMetadata(xml);
expect(meta.rating).toBe(2);
expect(meta.label).toBe('red');
expect(meta.keywords).toEqual(['Portrait', 'Maya']);
expect(meta.keywordPaths).toEqual(['People > Portrait']);
expect(meta.iptc.headline).toBe('Press day');
expect(meta.iptc.country).toBe('Ireland');
// Nothing the file does not carry is invented.
expect(meta.iptc.city).toBeUndefined();
expect(meta.caption).toBeUndefined();
});
it('stays quiet when the file has no metadata', () => {
const meta = xmpToMetadata(editsToXmp(defaultEdits()));
expect(meta.rating).toBeUndefined();
expect(meta.label).toBeUndefined();
expect(meta.keywords).toEqual([]);
expect(meta.keywordPaths).toEqual([]);
expect(meta.iptc).toEqual({});
});
it('rejects a file that is not a sidecar', () => {
expect(() => xmpToMetadata('<html></html>')).toThrow(/not an XMP/);
});
});
+184 -6
View File
@@ -1,6 +1,60 @@
import type { Edits, PhotoRecord } from '../types'; import type { ColorLabel, Edits, IptcFields, PhotoRecord } from '../types';
import { normalizeEdits } from './edits'; import { normalizeEdits } from './edits';
/**
* Everything a sidecar carries besides the develop settings: rating, label,
* keywords (flat and hierarchical) and the IPTC core.
*
* `dc:subject` and `lr:hierarchicalSubject` are written as a pair, the way
* Lightroom does: the leaves in the first, the full paths in the second. A
* reader that only understands one of them still gets something usable, and a
* library round-tripped through another editor keeps its tree.
*/
export type XmpPhotoFields = Partial<
Pick<
PhotoRecord,
| 'name'
| 'meta'
| 'rating'
| 'color'
| 'keywords'
| 'keywordPaths'
| 'iptc'
| 'title'
| 'caption'
| 'creator'
| 'copyright'
>
>;
/** Lightroom's label names, which are what other software reads. */
const LABEL_NAMES: Record<Exclude<ColorLabel, ''>, string> = {
red: 'Red',
yellow: 'Yellow',
green: 'Green',
blue: 'Blue',
purple: 'Purple',
};
const LABEL_VALUES: Record<string, Exclude<ColorLabel, ''>> = {
red: 'red',
yellow: 'yellow',
green: 'green',
blue: 'blue',
purple: 'purple',
};
/** IPTC field → the XMP property that carries it. */
const IPTC_ATTRS: [keyof IptcFields, string][] = [
['headline', 'photoshop:Headline'],
['credit', 'photoshop:Credit'],
['source', 'photoshop:Source'],
['city', 'photoshop:City'],
['state', 'photoshop:State'],
['country', 'photoshop:Country'],
['location', 'Iptc4xmpCore:Location'],
];
/** /**
* Lightroom-compatible XMP sidecars. * Lightroom-compatible XMP sidecars.
* *
@@ -105,7 +159,70 @@ export function xmpFileName(name: string) {
return `${name.replace(/\.[^.]+$/, '') || 'photo'}.xmp`; return `${name.replace(/\.[^.]+$/, '') || 'photo'}.xmp`;
} }
export function editsToXmp(edits: Edits, photo?: Pick<PhotoRecord, 'name' | 'meta'>): string { /** Rating, colour label and IPTC, as XMP attributes on the Description. */
export function photoMetadataAttributes(photo?: XmpPhotoFields): string {
if (!photo) return '';
const attrs: string[] = [];
const rating = Math.round(photo.rating ?? 0);
if (rating > 0) attrs.push(`xmp:Rating="${Math.max(0, Math.min(5, rating))}"`);
const label = photo.color ? LABEL_NAMES[photo.color] : '';
if (label) attrs.push(`xmp:Label="${label}"`);
const iptc = photo.iptc ?? {};
for (const [field, property] of IPTC_ATTRS) {
const value = iptc[field];
if (typeof value === 'string' && value.trim()) {
attrs.push(`${property}="${escapeXml(value.trim())}"`);
}
}
return attrs.length ? ` ${attrs.join(' ')}` : '';
}
/** Title, caption, creator, rights, keywords and the hierarchy, as elements. */
export function photoMetadataElements(photo?: XmpPhotoFields): string {
const parts: string[] = [];
const title = photo?.title?.trim() || photo?.name?.trim() || 'Luminary edit';
parts.push(
`<dc:title><rdf:Alt><rdf:li xml:lang="x-default">${escapeXml(title)}</rdf:li></rdf:Alt></dc:title>`,
);
if (photo?.caption?.trim()) {
parts.push(
`<dc:description><rdf:Alt><rdf:li xml:lang="x-default">${escapeXml(
photo.caption.trim(),
)}</rdf:li></rdf:Alt></dc:description>`,
);
}
if (photo?.creator?.trim()) {
parts.push(
`<dc:creator><rdf:Seq><rdf:li>${escapeXml(photo.creator.trim())}</rdf:li></rdf:Seq></dc:creator>`,
);
}
if (photo?.copyright?.trim()) {
parts.push(
`<dc:rights><rdf:Alt><rdf:li xml:lang="x-default">${escapeXml(
photo.copyright.trim(),
)}</rdf:li></rdf:Alt></dc:rights>`,
);
}
const keywords = (photo?.keywords ?? []).filter((word) => word && word.trim());
if (keywords.length) {
parts.push(
`<dc:subject><rdf:Bag>${keywords
.map((word) => `<rdf:li>${escapeXml(word)}</rdf:li>`)
.join('')}</rdf:Bag></dc:subject>`,
);
}
const paths = (photo?.keywordPaths ?? []).filter((path) => path && path.trim());
if (paths.length) {
parts.push(
`<lr:hierarchicalSubject><rdf:Bag>${paths
.map((path) => `<rdf:li>${escapeXml(path)}</rdf:li>`)
.join('')}</rdf:Bag></lr:hierarchicalSubject>`,
);
}
return parts.join('');
}
export function editsToXmp(edits: Edits, photo?: XmpPhotoFields): string {
const normalized = normalizeEdits(edits); const normalized = normalizeEdits(edits);
const attrs = CRS_FIELDS.map( const attrs = CRS_FIELDS.map(
([name, read]) => `crs:${name}="${num(read(normalized))}"`, ([name, read]) => `crs:${name}="${num(read(normalized))}"`,
@@ -113,16 +230,15 @@ export function editsToXmp(edits: Edits, photo?: Pick<PhotoRecord, 'name' | 'met
attrs.push(`crs:ConvertToGrayscale="${normalized.bw ? 'True' : 'False'}"`); attrs.push(`crs:ConvertToGrayscale="${normalized.bw ? 'True' : 'False'}"`);
if (normalized.kelvin != null) attrs.push(`crs:Temperature="${Math.round(normalized.kelvin)}"`); if (normalized.kelvin != null) attrs.push(`crs:Temperature="${Math.round(normalized.kelvin)}"`);
attrs.push(`lum:Settings="${escapeXml(base64Encode(JSON.stringify(normalized)))}"`); attrs.push(`lum:Settings="${escapeXml(base64Encode(JSON.stringify(normalized)))}"`);
const label = photo ? escapeXml(photo.name) : 'Luminary edit';
return [ return [
'<?xpacket begin="\ufeff" id="W5M0MpCehiHzreSzNTczkc9d"?>', '<?xpacket begin="\ufeff" id="W5M0MpCehiHzreSzNTczkc9d"?>',
'<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Luminary">', '<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Luminary">',
' <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">', ' <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">',
` <rdf:Description rdf:about="" xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/" xmlns:lum="${LUM_NS}"`, ` <rdf:Description rdf:about="" xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/" xmlns:lum="${LUM_NS}" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:lr="http://ns.adobe.com/lightroom/1.0/"`,
' crs:Version="15.0" crs:ProcessVersion="15.4" crs:HasSettings="True"', ' crs:Version="15.0" crs:ProcessVersion="15.4" crs:HasSettings="True"',
` ${attrs.join('\n ')}>`, ` ${attrs.join('\n ')}${photoMetadataAttributes(photo)}>`,
` <dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"><rdf:Alt><rdf:li xml:lang="x-default">${label}</rdf:li></rdf:Alt></dc:title>`, ` ${photoMetadataElements(photo)}`,
' </rdf:Description>', ' </rdf:Description>',
' </rdf:RDF>', ' </rdf:RDF>',
'</x:xmpmeta>', '</x:xmpmeta>',
@@ -202,6 +318,68 @@ export function xmpToEdits(xml: string, base: Edits): XmpImport {
return { edits: normalizeEdits(next), source: 'lightroom', applied }; return { edits: normalizeEdits(next), source: 'lightroom', applied };
} }
export interface XmpMetadata {
rating?: number;
label?: Exclude<ColorLabel, ''>;
keywords: string[];
keywordPaths: string[];
iptc: IptcFields;
title?: string;
caption?: string;
creator?: string;
copyright?: string;
}
/** `<dc:subject><rdf:Bag><rdf:li>…` → the items, unescaped. */
function bagItems(xml: string, tag: string): string[] {
const block = new RegExp(`<${tag}\\b[^>]*>([\\s\\S]*?)</${tag}>`).exec(xml);
if (!block) return [];
return [...block[1].matchAll(/<rdf:li\b[^>]*>([\s\S]*?)<\/rdf:li>/g)]
.map((match) => unescapeXml(match[1].trim()))
.filter(Boolean);
}
/**
* Read the metadata half of a sidecar: rating, label, keywords, hierarchy and
* IPTC. Separate from `xmpToEdits` because a photographer may want the
* cataloguing fields from a file whose grade they do not want to adopt.
*
* Returns the fields the file actually carries; the caller decides what to
* overwrite, so an empty sidecar cannot wipe a photo's existing metadata.
*/
export function xmpToMetadata(xml: string): XmpMetadata {
if (!/<x:xmpmeta|<rdf:RDF/i.test(xml)) {
throw new Error('That file is not an XMP sidecar');
}
const attrs = attributes(xml);
const ratingRaw = attrs.get('xmp:Rating');
const ratingValue = ratingRaw === undefined ? NaN : Number(ratingRaw);
const rating = Number.isFinite(ratingValue)
? Math.max(0, Math.min(5, Math.round(ratingValue)))
: undefined;
const label = LABEL_VALUES[(attrs.get('xmp:Label') ?? '').toLowerCase()];
const iptc: IptcFields = {};
for (const [field, property] of IPTC_ATTRS) {
const value = attrs.get(property);
if (value) iptc[field] = value.slice(0, 256);
}
return {
rating,
label,
keywords: bagItems(xml, 'dc:subject'),
keywordPaths: bagItems(xml, 'lr:hierarchicalSubject'),
iptc,
title: bagItems(xml, 'dc:title')[0],
caption: bagItems(xml, 'dc:description')[0],
creator: bagItems(xml, 'dc:creator')[0],
copyright: bagItems(xml, 'dc:rights')[0],
};
}
/** Opens the OS picker and returns the sidecar text, or null when cancelled. */ /** Opens the OS picker and returns the sidecar text, or null when cancelled. */
export function readXmpFile(): Promise<string | null> { export function readXmpFile(): Promise<string | null> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
+29 -8
View File
@@ -1650,6 +1650,27 @@ figcaption {
margin-top: 2px; margin-top: 2px;
} }
/* The look's cast and the balance it leaves the photo at, under Temp/Tint. */
.wb-look {
display: flex;
flex-wrap: wrap;
gap: 2px 10px;
margin: 1px 0 5px;
font-size: 10.5px;
color: var(--muted);
}
.wb-look b {
color: #d9d9e2;
font-weight: 600;
font-variant-numeric: tabular-nums;
}
.wb-look-final {
margin-left: auto;
font-variant-numeric: tabular-nums;
}
.row { .row {
display: grid; display: grid;
grid-template-columns: 74px 1fr 44px; grid-template-columns: 74px 1fr 44px;
@@ -5073,14 +5094,14 @@ figcaption {
border-top: 1px solid var(--line); border-top: 1px solid var(--line);
} }
.lens-split { .compare-split {
position: absolute; position: absolute;
inset: 0; inset: 0;
pointer-events: none; pointer-events: none;
z-index: 3; z-index: 3;
} }
.lens-split-line { .compare-split-line {
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
@@ -5089,7 +5110,7 @@ figcaption {
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 10px rgba(0, 0, 0, 0.45); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 10px rgba(0, 0, 0, 0.45);
} }
.lens-split-handle { .compare-split-handle {
position: absolute; position: absolute;
top: 50%; top: 50%;
display: flex; display: flex;
@@ -5111,14 +5132,14 @@ figcaption {
touch-action: none; touch-action: none;
} }
.lens-split-handle:hover, .compare-split-handle:hover,
.lens-split-handle:focus-visible { .compare-split-handle:focus-visible {
background: var(--accent); background: var(--accent);
border-color: #fff; border-color: #fff;
outline: none; outline: none;
} }
.lens-split-label { .compare-split-label {
position: absolute; position: absolute;
top: 10px; top: 10px;
padding: 2px 6px; padding: 2px 6px;
@@ -5130,11 +5151,11 @@ figcaption {
text-transform: uppercase; text-transform: uppercase;
} }
.lens-split-label.before { .compare-split-label.before {
left: 10px; left: 10px;
} }
.lens-split-label.after { .compare-split-label.after {
right: 10px; right: 10px;
} }
+31
View File
@@ -167,6 +167,13 @@ export interface Edits {
* the demosaiced proxy is assumed to be balanced for. * the demosaiced proxy is assumed to be balanced for.
*/ */
kelvin: number | null; kelvin: number | null;
/**
* White-balance cast of an applied look (film stock or preset), kept apart
* from `temp`/`tint`. A look grades on top of the correction already made,
* so an adjusted white balance stays the base it is applied against instead
* of being replaced by the look's own cast.
*/
presetLook: { temp: number; tint: number };
exposure: number; exposure: number;
/** pulls clipped highlights back into range without shifting hue */ /** pulls clipped highlights back into range without shifting hue */
recovery: number; recovery: number;
@@ -241,6 +248,21 @@ export interface Edits {
crop: CropState; crop: CropState;
} }
/** IPTC core fields, written to XMP so a catalog is readable elsewhere. */
export interface IptcFields {
/** Single-line summary, the "who/what" a picture desk reads first. */
headline?: string;
/** Who gets the credit for the image. */
credit?: string;
/** Agency or organisation that supplied it. */
source?: string;
city?: string;
state?: string;
country?: string;
/** Sublocation inside the city. */
location?: string;
}
export interface PhotoMeta { export interface PhotoMeta {
camera?: string; camera?: string;
lens?: string; lens?: string;
@@ -269,6 +291,8 @@ export interface MetadataPreset {
creator?: string; creator?: string;
copyright?: string; copyright?: string;
keywords: string[]; keywords: string[];
keywordPaths?: string[];
iptc?: IptcFields;
} }
export interface SmartCollection { export interface SmartCollection {
@@ -305,6 +329,13 @@ export interface PhotoRecord {
flag: Flag; flag: Flag;
color: ColorLabel; color: ColorLabel;
keywords: string[]; keywords: string[];
/**
* Full hierarchical paths (`A > B > C`). The leaf of each is also in
* `keywords`, so search and filters do not need to know about the tree.
*/
keywordPaths?: string[];
/** IPTC core, edited in the Metadata panel and written to XMP. */
iptc?: IptcFields;
title?: string; title?: string;
caption?: string; caption?: string;
creator?: string; creator?: string;
+1
View File
@@ -0,0 +1 @@
/// <reference types="vite/client" />
+22 -13
View File
@@ -37,8 +37,10 @@ not assumed:
| `node.exe` (v24.22.2) | only Windows system DLLs (`KERNEL32`, `ADVAPI32`, `WS2_32`, `CRYPT32`, `USER32`, …) — statically linked C runtime, so **no Visual C++ Redistributable** | | `node.exe` (v24.22.2) | only Windows system DLLs (`KERNEL32`, `ADVAPI32`, `WS2_32`, `CRYPT32`, `USER32`, …) — statically linked C runtime, so **no Visual C++ Redistributable** |
| `libvips-42.dll` + `sharp` | the Universal C Runtime (`api-ms-win-crt-*`), included in Windows 10/11; older Windows needs KB2999226 | | `libvips-42.dll` + `sharp` | the Universal C Runtime (`api-ms-win-crt-*`), included in Windows 10/11; older Windows needs KB2999226 |
| `libraw.wasm` | a browser with WebAssembly | | `libraw.wasm` | a browser with WebAssembly |
| launcher (`.cmd`/`.vbs`) | Windows PowerShell 5.1, included in Windows 10/11 | | `Luminary.exe` launcher | only Windows system DLLs; no PowerShell, no Windows Script Host |
| Develop module | a current browser with WebGL2 (Edge, Chrome, Firefox) | | launcher (`.cmd`/`.vbs` fallback) | Windows PowerShell 5.1, included in Windows 10/11 |
| `LuminaryWindow.exe` | the Microsoft Edge WebView2 runtime that ships with Windows 10/11 (window engine only; no browser UI, profile or account) |
| Develop module | WebGL2, provided by WebView2 (or by the fallback browser) |
So: a clean Windows 10/11 x64 machine, a browser, and ~250 MB where the data So: a clean Windows 10/11 x64 machine, a browser, and ~250 MB where the data
folder lives. No VC++ redist, no .NET, no admin prompt. The setup exe installs folder lives. No VC++ redist, no .NET, no admin prompt. The setup exe installs
@@ -88,8 +90,8 @@ Output:
``` ```
<out>/ <out>/
Luminary-0.5.2-win-x64.zip the portable deliverable Luminary-0.5.4-win-x64.zip the portable deliverable
installer/Luminary-0.5.2-win-x64-setup.exe the per-user installer installer/Luminary-0.5.4-win-x64-setup.exe the per-user installer
stage/Luminary/ the unpacked bundle (kept for inspection) stage/Luminary/ the unpacked bundle (kept for inspection)
cache/node-v24.22.2-win-x64.exe pinned runtime, reused next time cache/node-v24.22.2-win-x64.exe pinned runtime, reused next time
cache/SHASUMS256-v24.22.2.txt cache/SHASUMS256-v24.22.2.txt
@@ -143,7 +145,7 @@ runs them from there, so no root install is needed. Install it yourself with
<https://nsis.sourceforge.io>. Compile by hand with: <https://nsis.sourceforge.io>. Compile by hand with:
```bash ```bash
makensis -DAPP_VERSION=0.5.2 -DAPP_VERSION4=0.5.2.0 \ makensis -DAPP_VERSION=0.5.4 -DAPP_VERSION4=0.5.4.0 \
-DSOURCE_DIR="$PWD/stage/Luminary" windows/installer.nsi -DSOURCE_DIR="$PWD/stage/Luminary" windows/installer.nsi
``` ```
@@ -158,7 +160,7 @@ running copy works without killing every `node.exe` on the machine.
Silent install and uninstall, for a script or a school lab image: Silent install and uninstall, for a script or a school lab image:
```bat ```bat
Luminary-0.5.2-win-x64-setup.exe /S Luminary-0.5.4-win-x64-setup.exe /S
"%LOCALAPPDATA%\Programs\Luminary\Uninstall.exe" /S "%LOCALAPPDATA%\Programs\Luminary\Uninstall.exe" /S
``` ```
@@ -283,9 +285,9 @@ Full behaviour, edge cases and the test checklist: [launcher/DESIGN.md](launcher
```bash ```bash
cd <out> cd <out>
sha256sum Luminary-0.5.2-win-x64.zip sha256sum Luminary-0.5.4-win-x64.zip
unzip -t Luminary-0.5.2-win-x64.zip | tail -1 unzip -t Luminary-0.5.4-win-x64.zip | tail -1
unzip -l Luminary-0.5.2-win-x64.zip | grep -E 'node.exe|Luminary\.(exe|cmd|vbs)|app/server/index.mjs' unzip -l Luminary-0.5.4-win-x64.zip | grep -E 'node.exe|Luminary\.(exe|cmd|vbs)|app/server/index.mjs'
``` ```
On Windows, the real test is the checklist in `launcher/DESIGN.md` §15, On Windows, the real test is the checklist in `launcher/DESIGN.md` §15,
@@ -342,8 +344,15 @@ then replaces `node.exe`. It refuses while Luminary is running. Set
fall back to a system Node 24+ in the meantime. fall back to a system Node 24+ in the meantime.
- No tray icon and no auto-update in this version (both are launcher features, - No tray icon and no auto-update in this version (both are launcher features,
not app changes). not app changes).
- Loopback only by default; set `HOST=0.0.0.0` for LAN proofing galleries. - Loopback only by default: the local engine is a background service on this
- The PowerShell launcher cannot clean up after a server crash; a stale PC that listens on `127.0.0.1`. Set `HOST=0.0.0.0` only for LAN proofing
galleries.
- Fully offline: the app, the catalog and the start-up wait are local. The
launcher probes `127.0.0.1` over plain TCP, which never consults the system
proxy or DNS, so a disconnected network, VPN or proxy setting cannot stop it
from starting. Only `-Repair` (downloading `node.exe`) and the optional Immich
sync use the network.
- The PowerShell launcher cannot clean up after the local engine crashes; a stale
`runtime.json` is simply ignored on the next start. `runtime.json` is simply ignored on the next start.
- The setup exe cannot be executed on the Linux build host. It is verified by - The setup exe cannot be executed on the Linux build host. It is verified by
unpacking it and comparing the SHA-256 of every payload file with the staged unpacking it and comparing the SHA-256 of every payload file with the staged
@@ -360,11 +369,11 @@ then replaces `node.exe`. It refuses while Luminary is running. Set
| "Luminary needs Windows 10 or 11" (exit 4) | the launcher read `CurrentBuild` below 10240. The app targets Windows 10/11; there is no Windows 7/8 build | | "Luminary needs Windows 10 or 11" (exit 4) | the launcher read `CurrentBuild` below 10240. The app targets Windows 10/11; there is no Windows 7/8 build |
| "The Universal C Runtime is missing" | Windows 8.1 without KB2999226 — install <https://support.microsoft.com/help/2999226> or use Windows 10/11 | | "The Universal C Runtime is missing" | Windows 8.1 without KB2999226 — install <https://support.microsoft.com/help/2999226> or use Windows 10/11 |
| "The data drive has only … GB free" | free space before starting; catalogs and previews grow in `%LOCALAPPDATA%` | | "The data drive has only … GB free" | free space before starting; catalogs and previews grow in `%LOCALAPPDATA%` |
| "did not answer on /api/health" | `logs\server.err.log`; run `node app\server\index.mjs` from `app\` to see the failure | | "did not answer on /api/health" | `logs\server.err.log`; run `node app\server\index.mjs` from `app\` to see the failure. This is not a network error: start-up only talks to `127.0.0.1`, so a disconnected machine starts the same way |
| Browser opens an error page | the port was taken between the check and the spawn; start again | | Browser opens an error page | the port was taken between the check and the spawn; start again |
| RAW import fails | `app\node_modules\@img\sharp-win32-x64` must contain a `.node` binary; RAW decode itself is wasm | | RAW import fails | `app\node_modules\@img\sharp-win32-x64` must contain a `.node` binary; RAW decode itself is wasm |
| `node.exe failed its SHA-256 check` | delete `<out>/cache` and rebuild (the download was truncated) | | `node.exe failed its SHA-256 check` | delete `<out>/cache` and rebuild (the download was truncated) |
| A sign-in screen appears | the server was started without `LUMINARY_LOCAL=1`, or it is the normal server, not the bundle | | A sign-in screen appears | the local engine was started without `LUMINARY_LOCAL=1`, or this is the full multi-user edition, not the desktop bundle |
| Opens as a normal tab | Edge/Chrome not found, or `-Browser` / `LUMINARY_WINDOW=browser` was used | | Opens as a normal tab | Edge/Chrome not found, or `-Browser` / `LUMINARY_WINDOW=browser` was used |
| Build refuses `--out` | the path is inside the repo; choose one outside | | Build refuses `--out` | the path is inside the repo; choose one outside |
| SmartScreen on first run | unsigned build: "More info" → "Run anyway" (same for the setup exe) | | SmartScreen on first run | unsigned build: "More info" → "Run anyway" (same for the setup exe) |
+2 -2
View File
@@ -40,9 +40,9 @@ second implementation to drift.
``` ```
repo=https://git.maple-street.net/bhursey/luminary.git repo=https://git.maple-street.net/bhursey/luminary.git
tag=v0.5.2 tag=v0.5.4
commit=fb43ca8f1c2d… # full sha commit=fb43ca8f1c2d… # full sha
version=0.5.2 # package.json version, checked after fetch version=0.5.4 # package.json version, checked after fetch
node=v24.22.2 node=v24.22.2
``` ```
+64
View File
@@ -144,6 +144,70 @@ try {
Check '/api/sync answers' $false $_.Exception.Message Check '/api/sync answers' $false $_.Exception.Message
} }
Say ''
Say 'Offline import (proxy unreachable)'
# The failure this guards against: with the network down, anything that asks
# Windows for its proxy/PAC cannot reach 127.0.0.1, so the launcher gave up on
# a healthy engine and the app window reported that it could not reach it.
$launcherText = Get-Content -LiteralPath $launcher -Raw
Check 'health probe uses a direct socket' ($launcherText -match 'TcpClient')
Check 'health probe avoids the proxy stack' ($launcherText -notmatch 'Invoke-WebRequest')
Check 'app window bypasses proxies' ($launcherText -match '--no-proxy-server')
# The import the page performs, run with every proxy variable pointing at a
# black hole: upload, decode in the bundle, read the preview back.
$probe = Join-Path $dataDir 'offline-import.cjs'
Set-Content -LiteralPath $probe -Encoding ASCII -Value @'
const fs = require('node:fs');
const path = require('node:path');
const [bundle, base, dir] = process.argv.slice(2);
const sharp = require(path.join(bundle, 'app', 'node_modules', 'sharp'));
(async () => {
const file = path.join(dir, 'offline-smoke.tiff');
await sharp({ create: { width: 8, height: 8, channels: 3, background: { r: 200, g: 100, b: 50 } } })
.tiff()
.toFile(file);
const health = await fetch(base + '/api/health');
const upload = await fetch(
base + '/api/photos/smoke-offline/original?name=offline-smoke.tiff&mime=image%2Ftiff',
{ method: 'POST', headers: { 'Content-Type': 'image/tiff' }, body: fs.readFileSync(file) },
);
const body = await upload.json().catch(() => ({}));
let preview = 0;
if (body.previewUrl) {
const target = String(body.previewUrl).startsWith('http') ? body.previewUrl : base + body.previewUrl;
preview = (await fetch(target)).status;
}
process.stdout.write(JSON.stringify({ health: health.status, upload: upload.status, preview }));
})().catch((error) => {
process.stdout.write(JSON.stringify({ error: String(error) }));
process.exit(1);
});
'@
$proxyNames = @('HTTP_PROXY', 'HTTPS_PROXY', 'ALL_PROXY', 'http_proxy', 'https_proxy', 'all_proxy')
$noProxyNames = @('NO_PROXY', 'no_proxy')
$saved = @{}
foreach ($name in $proxyNames + $noProxyNames) {
$saved[$name] = [Environment]::GetEnvironmentVariable($name, 'Process')
}
try {
foreach ($name in $proxyNames) { Set-Item -Path "env:$name" -Value 'http://10.255.255.1:9' }
foreach ($name in $noProxyNames) { Remove-Item -Path "env:$name" -ErrorAction SilentlyContinue }
$offline = (& $nodeExe $probe $Bundle $url $dataDir | Out-String).Trim()
} finally {
foreach ($name in $proxyNames + $noProxyNames) {
if ($saved[$name]) { Set-Item -Path "env:$name" -Value $saved[$name] }
else { Remove-Item -Path "env:$name" -ErrorAction SilentlyContinue }
}
}
$offlineResult = $null
try { $offlineResult = $offline | ConvertFrom-Json } catch { }
Check 'engine answers with the proxy unreachable' ($null -ne $offlineResult -and $offlineResult.health -eq 200) $(if ($offlineResult) { "health $($offlineResult.health)" } else { $offline })
# A new upload is created (201); replacing one answers 200.
Check 'import upload accepted offline' ($null -ne $offlineResult -and $offlineResult.upload -in @(200, 201)) $(if ($offlineResult) { "upload $($offlineResult.upload)" } else { '' })
Check 'preview decodes offline' ($null -ne $offlineResult -and $offlineResult.preview -eq 200) $(if ($offlineResult) { "preview $($offlineResult.preview)" } else { '' })
Say '' Say ''
Say 'Window (WebView2)' Say 'Window (WebView2)'
if (-not (Test-Path -LiteralPath $windowExe)) { if (-not (Test-Path -LiteralPath $windowExe)) {
+24 -7
View File
@@ -445,6 +445,19 @@ function writeVersion(bundle, pkg, launcher, nodeVersion, nodeHash, nodeSize) {
function writeBundleReadme(bundle, info) { function writeBundleReadme(bundle, info) {
const start = info.launcher === 'go' ? 'Luminary.exe' : 'Luminary.cmd (or Luminary.vbs for no console window)'; const start = info.launcher === 'go' ? 'Luminary.exe' : 'Luminary.cmd (or Luminary.vbs for no console window)';
const windowLine = info.nativeWindow
? 'Window: opens in its own window: no browser, no tabs, no address bar, and\n' +
' no Edge profile or Microsoft account'
: 'Window: opens in a chromeless Edge/Chrome window; "Luminary.cmd -Browser"\n' +
' for a normal tab';
const windowRequirement = info.nativeWindow
? ' - The Microsoft Edge WebView2 runtime, which Windows 10 and 11 install with\n' +
' Edge. It is the window engine only: no browser is opened and no Edge\n' +
' profile, account or synced settings are used. If it is missing the window\n' +
' says so and links to the one-time download.\n' +
' - WebGL2 for the Develop module (WebView2 provides it).'
: ' - A current browser (Edge, Chrome or Firefox) with WebGL2 for the Develop\n' +
' module.';
const body = `Luminary ${info.version} for Windows (x64) — portable bundle const body = `Luminary ${info.version} for Windows (x64) — portable bundle
================================================= =================================================
@@ -456,13 +469,13 @@ Logs: logs\\server.out.log and logs\\server.err.log
Check: "Luminary.cmd -Verify" lists the files a complete bundle needs Check: "Luminary.cmd -Verify" lists the files a complete bundle needs
Repair: "Luminary.cmd -Repair" downloads node.exe again and verifies its sha256 Repair: "Luminary.cmd -Repair" downloads node.exe again and verifies its sha256
Sign-in: none — single-user desktop mode, no account setup Sign-in: none — single-user desktop mode, no account setup
Window: opens in its own window (native when bundled, else chromeless Edge/Chrome); Network: not needed — the app and its service run on this PC, so it starts
"Luminary.cmd -Browser" for a normal tab and runs with the network disconnected
${windowLine}
Requirements Requirements
- Windows 10 or 11, 64-bit. - Windows 10 or 11, 64-bit.
- A current browser (Edge, Chrome or Firefox) with WebGL2 for the Develop ${windowRequirement}
module.
- Nothing else. Node.js is included as node.exe, and no .NET, Visual C++ - Nothing else. Node.js is included as node.exe, and no .NET, Visual C++
Redistributable, admin rights or installer is needed. Redistributable, admin rights or installer is needed.
- About 250 MB free where the data folder lives. - About 250 MB free where the data folder lives.
@@ -490,8 +503,9 @@ Notes
opens signed in. It is not meant for several people sharing one Windows opens signed in. It is not meant for several people sharing one Windows
login with separate accounts. login with separate accounts.
- The bundle is unsigned, so SmartScreen may ask once ("More info" -> "Run anyway"). - The bundle is unsigned, so SmartScreen may ask once ("More info" -> "Run anyway").
- The server listens on 127.0.0.1 only. Set HOST=0.0.0.0 before starting if - The local engine listens on 127.0.0.1 only: it is a background service on
client proofing galleries must be reachable from other devices on the LAN. this PC. Set HOST=0.0.0.0 before starting only if client proofing galleries
must be reachable from other devices on the LAN.
- RAW decoding uses the bundled libraw WebAssembly; sharp's Windows prebuilt - RAW decoding uses the bundled libraw WebAssembly; sharp's Windows prebuilt
binary is included, so there is nothing else to install. binary is included, so there is nothing else to install.
`; `;
@@ -651,6 +665,9 @@ async function fetchMakensis(outDir) {
const root = path.join(outDir, 'tools', 'nsis'); const root = path.join(outDir, 'tools', 'nsis');
mkdirSync(debs, { recursive: true }); mkdirSync(debs, { recursive: true });
rmSync(root, { recursive: true, force: true }); rmSync(root, { recursive: true, force: true });
// dpkg-deb -x creates the destination itself but not its parents, and a
// fresh --out has no tools/ yet.
mkdirSync(root, { recursive: true });
for (const name of [`nsis_${packVersion}_amd64.deb`, `nsis-common_${packVersion}_all.deb`]) { for (const name of [`nsis_${packVersion}_amd64.deb`, `nsis-common_${packVersion}_all.deb`]) {
const file = path.join(debs, name); const file = path.join(debs, name);
if (!existsSync(file)) { if (!existsSync(file)) {
@@ -776,7 +793,7 @@ async function main() {
} }
const info = writeVersion(bundle, pkg, launcher, options.node, node.hash, statSync(bundledNode).size); const info = writeVersion(bundle, pkg, launcher, options.node, node.hash, statSync(bundledNode).size);
writeBundleReadme(bundle, { ...info, launcher }); writeBundleReadme(bundle, { ...info, launcher, nativeWindow: Boolean(options.webview2) });
const zipPath = path.join(options.out, `Luminary-${pkg.version}-win-x64.zip`); const zipPath = path.join(options.out, `Luminary-${pkg.version}-win-x64.zip`);
rmSync(zipPath, { force: true }); rmSync(zipPath, { force: true });
+28 -17
View File
@@ -81,12 +81,27 @@ VIAddVersionKey "LegalCopyright" "MIT licensed"
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Show the Windows readme" !define MUI_FINISHPAGE_SHOWREADME_TEXT "Show the Windows readme"
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!if /FileExists "${SOURCE_DIR}/Luminary.vbs" ; The native launcher first: it needs no Windows Script Host (which group
!define MUI_FINISHPAGE_RUN "$INSTDIR\Luminary.vbs" ; policy can disable, leaving "Start Luminary" doing nothing) and opens no
; console. The .vbs, then the .cmd, are only fallbacks for old bundles.
!if /FileExists "${SOURCE_DIR}/Luminary.exe"
!define APP_LAUNCH "$INSTDIR\Luminary.exe"
!else !else
!define MUI_FINISHPAGE_RUN "$INSTDIR\Luminary.cmd" !if /FileExists "${SOURCE_DIR}/Luminary.vbs"
!define APP_LAUNCH "$INSTDIR\Luminary.vbs"
!else
!define APP_LAUNCH "$INSTDIR\Luminary.cmd"
!endif
!endif !endif
!define MUI_FINISHPAGE_RUN "${APP_LAUNCH}"
!define MUI_FINISHPAGE_RUN_TEXT "Start ${APP_NAME}" !define MUI_FINISHPAGE_RUN_TEXT "Start ${APP_NAME}"
; MUI starts the finish-page target with Exec, which hands the path straight to
; CreateProcess. That only works for a real executable: when the bundle ships
; the PowerShell launcher (no Go toolchain at build time) the target is
; Luminary.vbs, and CreateProcess cannot start a script, so the ticked "Start
; Luminary" box closed the installer and nothing opened. ExecShell goes through
; the shell, so the exe, the .vbs and the .cmd all start.
!define MUI_FINISHPAGE_RUN_FUNCTION "StartLuminaryOnFinish"
!insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_WELCOME
!if /FileExists "${SOURCE_DIR}/LICENSE" !if /FileExists "${SOURCE_DIR}/LICENSE"
@@ -106,6 +121,10 @@ LangString DESC_Main ${LANG_ENGLISH} "The editor, film looks, bundled Node runti
LangString DESC_Desktop ${LANG_ENGLISH} "Put a Luminary shortcut on the desktop." LangString DESC_Desktop ${LANG_ENGLISH} "Put a Luminary shortcut on the desktop."
LangString DESC_Startup ${LANG_ENGLISH} "Start Luminary in the background when you sign in to Windows." LangString DESC_Startup ${LANG_ENGLISH} "Start Luminary in the background when you sign in to Windows."
Function StartLuminaryOnFinish
ExecShell "open" "${APP_LAUNCH}"
FunctionEnd
Function .onInit Function .onInit
; The launcher refuses these too, but the installer should say so before it ; The launcher refuses these too, but the installer should say so before it
; copies 250 MB onto an unsupported PC. ; copies 250 MB onto an unsupported PC.
@@ -143,12 +162,12 @@ Section "Luminary (required)" SEC_MAIN
WriteUninstaller "$INSTDIR\Uninstall.exe" WriteUninstaller "$INSTDIR\Uninstall.exe"
CreateDirectory "$SMPROGRAMS\Luminary" CreateDirectory "$SMPROGRAMS\Luminary"
!if /FileExists "${SOURCE_DIR}/Luminary.vbs" CreateShortCut "$SMPROGRAMS\Luminary\Luminary.lnk" "${APP_LAUNCH}" "" "$INSTDIR\Luminary.ico" 0
CreateShortCut "$SMPROGRAMS\Luminary\Luminary.lnk" "$INSTDIR\Luminary.vbs" "" "$INSTDIR\Luminary.ico" 0 !if /FileExists "${SOURCE_DIR}/Luminary.exe"
CreateShortCut "$SMPROGRAMS\Luminary\Stop Luminary.lnk" "$INSTDIR\Luminary.exe" "-Stop" "$INSTDIR\Luminary.ico" 0
!else !else
CreateShortCut "$SMPROGRAMS\Luminary\Luminary.lnk" "$INSTDIR\Luminary.cmd" "" "$INSTDIR\Luminary.ico" 0
!endif
CreateShortCut "$SMPROGRAMS\Luminary\Stop Luminary.lnk" "$INSTDIR\Stop Luminary.cmd" "" "$INSTDIR\Luminary.ico" 0 CreateShortCut "$SMPROGRAMS\Luminary\Stop Luminary.lnk" "$INSTDIR\Stop Luminary.cmd" "" "$INSTDIR\Luminary.ico" 0
!endif
CreateShortCut "$SMPROGRAMS\Luminary\Luminary data folder.lnk" "$LOCALAPPDATA\Luminary\data" "" "$INSTDIR\Luminary.ico" 0 CreateShortCut "$SMPROGRAMS\Luminary\Luminary data folder.lnk" "$LOCALAPPDATA\Luminary\data" "" "$INSTDIR\Luminary.ico" 0
WriteRegStr HKCU "${APP_KEY}" "InstallDir" "$INSTDIR" WriteRegStr HKCU "${APP_KEY}" "InstallDir" "$INSTDIR"
@@ -168,19 +187,11 @@ Section "Luminary (required)" SEC_MAIN
SectionEnd SectionEnd
Section "Desktop shortcut" SEC_DESKTOP Section "Desktop shortcut" SEC_DESKTOP
!if /FileExists "${SOURCE_DIR}/Luminary.vbs" CreateShortCut "$DESKTOP\Luminary.lnk" "${APP_LAUNCH}" "" "$INSTDIR\Luminary.ico" 0
CreateShortCut "$DESKTOP\Luminary.lnk" "$INSTDIR\Luminary.vbs" "" "$INSTDIR\Luminary.ico" 0
!else
CreateShortCut "$DESKTOP\Luminary.lnk" "$INSTDIR\Luminary.cmd" "" "$INSTDIR\Luminary.ico" 0
!endif
SectionEnd SectionEnd
Section "Start Luminary when I sign in" SEC_STARTUP Section "Start Luminary when I sign in" SEC_STARTUP
!if /FileExists "${SOURCE_DIR}/Luminary.vbs" WriteRegStr HKCU "${RUN_KEY}" "Luminary" '"${APP_LAUNCH}"'
WriteRegStr HKCU "${RUN_KEY}" "Luminary" '"$INSTDIR\Luminary.vbs"'
!else
WriteRegStr HKCU "${RUN_KEY}" "Luminary" '"$INSTDIR\Luminary.cmd"'
!endif
SectionEnd SectionEnd
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+7 -2
View File
@@ -142,8 +142,13 @@ create data dir → create log dir → pick port → spawn node.exe (hidden)
second or third attempt). second or third attempt).
- The PowerShell launcher checks `$process.HasExited` first, so a crash reports - The PowerShell launcher checks `$process.HasExited` first, so a crash reports
the log instead of waiting the full timeout. the log instead of waiting the full timeout.
- The browser is opened only after health succeeds; opening earlier shows a - The probe is a raw HTTP request over TCP to `127.0.0.1`, in both launchers,
connection error on slow machines. and never `Invoke-WebRequest` or a proxy-aware HTTP client. WinINET resolves
the system proxy (a PAC script or WPAD) before it looks at the URL, which can
block for far longer than the request timeout on a machine with no network;
the server was healthy the whole time, but every probe timed out and the
launcher reported that Luminary had not started. Start-up must never depend on
a connection, a proxy setting or DNS.
Logs are append-only: `logs\server.out.log` and `logs\server.err.log` from the Logs are append-only: `logs\server.out.log` and `logs\server.err.log` from the
child, `logs\launcher.log` from the Go launcher. They fall back to child, `logs\launcher.log` from the Go launcher. They fall back to
+69 -18
View File
@@ -3,15 +3,15 @@
This is the no-toolchain launcher: it ships in every bundle and is what This is the no-toolchain launcher: it ships in every bundle and is what
Luminary.exe replaces when a Go build is available. It owns the three things Luminary.exe replaces when a Go build is available. It owns the three things
the server deliberately does not do for itself: Luminary's local engine deliberately does not do for itself:
1. Pick a free loopback port and pass it as PORT. 1. Pick a free loopback port and pass it as PORT.
2. Start node.exe hidden with LUMINARY_DATA outside the bundle. 2. Start node.exe hidden with LUMINARY_DATA outside the bundle.
3. Wait for /api/health before opening the browser. 3. Wait for /api/health before opening the browser.
Usage: Usage:
Luminary.ps1 start (or reuse) the server and open the browser Luminary.ps1 start (or reuse) the local engine and open the browser
Luminary.ps1 -Stop stop the server started from this folder Luminary.ps1 -Stop stop the local engine started from this folder
Luminary.ps1 -Status report what is running and where the data lives Luminary.ps1 -Status report what is running and where the data lives
Luminary.ps1 -Verify list the files the bundle must contain Luminary.ps1 -Verify list the files the bundle must contain
Luminary.ps1 -Repair re-download node.exe and check it against version.txt Luminary.ps1 -Repair re-download node.exe and check it against version.txt
@@ -96,11 +96,34 @@ function Read-Runtime {
try { return Get-Content -Raw -LiteralPath $runtimeFile | ConvertFrom-Json } catch { return $null } try { return Get-Content -Raw -LiteralPath $runtimeFile | ConvertFrom-Json } catch { return $null }
} }
# Loopback liveness probe.
#
# Invoke-WebRequest goes through WinINET, which resolves the system proxy (a PAC
# script or WPAD) before it looks at the URL. On a machine with no network that
# lookup can block for far longer than -TimeoutSec, so every probe timed out and
# the launcher killed a healthy local engine: the app "would not start" offline.
# A raw request over TCP to 127.0.0.1 uses no proxy, DNS or certificate store, so
# start-up behaves the same with or without a connection.
function Test-Health([int]$port) { function Test-Health([int]$port) {
$client = $null
try { try {
$response = Invoke-WebRequest -UseBasicParsing -TimeoutSec 2 -Uri ("http://127.0.0.1:{0}/api/health" -f $port) $client = New-Object System.Net.Sockets.TcpClient
return ($response.StatusCode -eq 200) $connect = $client.ConnectAsync([System.Net.IPAddress]::Loopback, $port)
} catch { return $false } if (-not $connect.Wait(2000)) { return $false }
$client.ReceiveTimeout = 3000
$stream = $client.GetStream()
$request = [System.Text.Encoding]::ASCII.GetBytes((
"GET /api/health HTTP/1.0`r`nHost: 127.0.0.1:{0}`r`nConnection: close`r`n`r`n" -f $port))
$stream.Write($request, 0, $request.Length)
$stream.Flush()
$reader = New-Object System.IO.StreamReader($stream, [System.Text.Encoding]::ASCII)
$status = $reader.ReadLine()
return ($status -match '^HTTP/1\.[01] 200\b')
} catch {
return $false
} finally {
if ($client) { $client.Close() }
}
} }
function Test-Process([int]$processId) { function Test-Process([int]$processId) {
@@ -133,8 +156,20 @@ function Open-Browser([string]$url) {
# Edge is part of Windows 10/11, so a chromeless app window costs no extra # Edge is part of Windows 10/11, so a chromeless app window costs no extra
# runtime. Chrome is the second choice; anything else falls back to a tab. # runtime. Chrome is the second choice; anything else falls back to a tab.
# Chrome first, then Edge: both are Chromium, but Edge's first run asks for a
# Microsoft account and starts syncing settings, which reads as an unwanted
# browser taking over the machine.
function Find-AppWindowBrowser { function Find-AppWindowBrowser {
$candidates = @() $candidates = @()
if ($env:LOCALAPPDATA) {
$candidates += (Join-Path $env:LOCALAPPDATA 'Google\Chrome\Application\chrome.exe')
}
if ($env:ProgramFiles) {
$candidates += (Join-Path $env:ProgramFiles 'Google\Chrome\Application\chrome.exe')
}
if (${env:ProgramFiles(x86)}) {
$candidates += (Join-Path ${env:ProgramFiles(x86)} 'Google\Chrome\Application\chrome.exe')
}
if (${env:ProgramFiles(x86)}) { if (${env:ProgramFiles(x86)}) {
$candidates += (Join-Path ${env:ProgramFiles(x86)} 'Microsoft\Edge\Application\msedge.exe') $candidates += (Join-Path ${env:ProgramFiles(x86)} 'Microsoft\Edge\Application\msedge.exe')
} }
@@ -143,13 +178,6 @@ function Find-AppWindowBrowser {
} }
if ($env:LOCALAPPDATA) { if ($env:LOCALAPPDATA) {
$candidates += (Join-Path $env:LOCALAPPDATA 'Microsoft\Edge\Application\msedge.exe') $candidates += (Join-Path $env:LOCALAPPDATA 'Microsoft\Edge\Application\msedge.exe')
$candidates += (Join-Path $env:LOCALAPPDATA 'Google\Chrome\Application\chrome.exe')
}
if ($env:ProgramFiles) {
$candidates += (Join-Path $env:ProgramFiles 'Google\Chrome\Application\chrome.exe')
}
if (${env:ProgramFiles(x86)}) {
$candidates += (Join-Path ${env:ProgramFiles(x86)} 'Google\Chrome\Application\chrome.exe')
} }
foreach ($candidate in $candidates) { foreach ($candidate in $candidates) {
if ($candidate -and (Test-Path -LiteralPath $candidate)) { return $candidate } if ($candidate -and (Test-Path -LiteralPath $candidate)) { return $candidate }
@@ -183,12 +211,16 @@ function Open-App([string]$url) {
$profile = Join-Path (Get-DataDir) 'window-profile' $profile = Join-Path (Get-DataDir) 'window-profile'
try { try {
New-Item -ItemType Directory -Force -Path $profile | Out-Null New-Item -ItemType Directory -Force -Path $profile | Out-Null
# --no-proxy-server: the window only ever loads 127.0.0.1. A proxy or PAC
# script set on the machine must not be able to intercept (or stall) it
# when the network is down.
Start-Process -FilePath $exe -ArgumentList @( Start-Process -FilePath $exe -ArgumentList @(
"--app=$url", "--app=$url",
"--user-data-dir=$profile", "--user-data-dir=$profile",
'--window-size=1500,950', '--window-size=1500,950',
'--no-first-run', '--no-first-run',
'--no-default-browser-check', '--no-default-browser-check',
'--no-proxy-server',
'--disable-features=Translate' '--disable-features=Translate'
) | Out-Null ) | Out-Null
} catch { } catch {
@@ -207,6 +239,25 @@ function Get-WindowsBuild {
# node.exe ships with it (and -Repair re-downloads it), libvips needs only the # node.exe ships with it (and -Repair re-downloads it), libvips needs only the
# Universal C Runtime that Windows 10/11 already has, and no admin rights are # Universal C Runtime that Windows 10/11 already has, and no admin rights are
# involved. Verified against the PE imports of node.exe and libvips-42.dll. # involved. Verified against the PE imports of node.exe and libvips-42.dll.
# The architecture of the machine, not of this process. Started from a 32-bit
# parent - the setup's finish page, or a SysWOW64 shell - a 64-bit PC still
# reports PROCESSOR_ARCHITECTURE=x86; the real value is in the WOW64 copy, and
# Is64BitOperatingSystem settles it.
function Get-MachineArch {
$arch = $env:PROCESSOR_ARCHITEW6432
if (-not $arch) { $arch = $env:PROCESSOR_ARCHITECTURE }
$is64 = $false
try { $is64 = [Environment]::Is64BitOperatingSystem } catch { }
if (-not $arch) { $arch = if ($is64) { 'AMD64' } else { 'x86' } }
if ($is64) {
if ($arch -eq 'x86') { $arch = 'AMD64' }
} elseif ($arch -eq 'AMD64' -or $arch -eq 'ARM64') {
# The OS says 32-bit; believe it rather than a stale variable.
$arch = 'x86'
}
return $arch
}
function Test-Platform { function Test-Platform {
$problems = @() $problems = @()
$notes = @() $notes = @()
@@ -216,7 +267,7 @@ function Test-Platform {
$problems += ("Luminary needs Windows 10 or 11. This PC reports build {0}." -f $build) $problems += ("Luminary needs Windows 10 or 11. This PC reports build {0}." -f $build)
} }
$arch = $env:PROCESSOR_ARCHITECTURE $arch = Get-MachineArch
if ($arch -and $arch -ne 'AMD64' -and $arch -ne 'ARM64') { if ($arch -and $arch -ne 'AMD64' -and $arch -ne 'ARM64') {
$problems += ("Luminary ships a 64-bit runtime; this PC reports '{0}'." -f $arch) $problems += ("Luminary ships a 64-bit runtime; this PC reports '{0}'." -f $arch)
} elseif ($arch -eq 'ARM64') { } elseif ($arch -eq 'ARM64') {
@@ -489,7 +540,7 @@ if ($Status) {
Write-Host 'Luminary is not running.' Write-Host 'Luminary is not running.'
} }
$platform = Test-Platform $platform = Test-Platform
Write-Host ("System: Windows build {0}, {1}" -f (Get-WindowsBuild), $env:PROCESSOR_ARCHITECTURE) Write-Host ("System: Windows build {0}, {1}" -f (Get-WindowsBuild), (Get-MachineArch))
foreach ($note in $platform.notes) { Write-Host ("Note: {0}" -f $note) } foreach ($note in $platform.notes) { Write-Host ("Note: {0}" -f $note) }
foreach ($problem in $platform.problems) { Write-Host ("Problem: {0}" -f $problem) } foreach ($problem in $platform.problems) { Write-Host ("Problem: {0}" -f $problem) }
$node = Resolve-Node $node = Resolve-Node
@@ -534,7 +585,7 @@ if ($running) {
} }
if (Test-Process ([int]$runtime.pid)) { if (Test-Process ([int]$runtime.pid)) {
$logNote = Join-Path (Get-DataDir) 'logs' $logNote = Join-Path (Get-DataDir) 'logs'
Show-ErrorDialog ("Luminary has been starting for over two minutes and is not answering on port {0}.`n`nSee {1} for the server log." -f $runtime.port, $logNote) Show-ErrorDialog ("Luminary has been starting for over two minutes and is not answering on its local port {0}.`n`nSee {1} for the log." -f $runtime.port, $logNote)
exit 1 exit 1
} }
} }
@@ -598,7 +649,7 @@ $logsOut = Get-LogDir $dataDir
$port = Find-Port $port = Find-Port
$url = "http://127.0.0.1:$port" $url = "http://127.0.0.1:$port"
# The server reads these from the environment; nothing is written into app\. # The local engine reads these from the environment; nothing is written into app\.
$env:PORT = "$port" $env:PORT = "$port"
$env:HOST = '127.0.0.1' $env:HOST = '127.0.0.1'
$env:NODE_ENV = 'production' $env:NODE_ENV = 'production'
@@ -640,7 +691,7 @@ while ((Get-Date) -lt $deadline) {
$tail = '' $tail = ''
if (Test-Path -LiteralPath $errLog) { $tail = (Get-Content -LiteralPath $errLog -Tail 20) -join "`n" } if (Test-Path -LiteralPath $errLog) { $tail = (Get-Content -LiteralPath $errLog -Tail 20) -join "`n" }
Write-Host 'Luminary did not answer on /api/health.' Write-Host "Luminary's local engine did not answer."
if ($tail) { Write-Host $tail } if ($tail) { Write-Host $tail }
if (-not $process.HasExited) { & taskkill.exe /PID $process.Id /T /F | Out-Null } if (-not $process.HasExited) { & taskkill.exe /PID $process.Id /T /F | Out-Null }
Remove-Item -LiteralPath $runtimeFile -Force -ErrorAction SilentlyContinue Remove-Item -LiteralPath $runtimeFile -Force -ErrorAction SilentlyContinue
+1 -1
View File
@@ -1,4 +1,4 @@
@echo off @echo off
rem Stop the Luminary server started from this folder. rem Stop the Luminary local engine started from this folder.
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Luminary.ps1" -Stop powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Luminary.ps1" -Stop
pause pause
+29 -13
View File
@@ -9,8 +9,8 @@
// //
// Usage: // Usage:
// //
// Luminary.exe start (or reuse) the server and open the browser // Luminary.exe start (or reuse) the local engine and open the browser
// Luminary.exe -stop stop the server started from this folder // Luminary.exe -stop stop the local engine started from this folder
// Luminary.exe -repair re-download node.exe and verify it against version.txt // Luminary.exe -repair re-download node.exe and verify it against version.txt
// //
// The design and the edge cases are described in ../DESIGN.md. // The design and the edge cases are described in ../DESIGN.md.
@@ -58,7 +58,17 @@ var (
user32 = syscall.NewLazyDLL("user32.dll") user32 = syscall.NewLazyDLL("user32.dll")
messageBoxW = user32.NewProc("MessageBoxW") messageBoxW = user32.NewProc("MessageBoxW")
client = &http.Client{Timeout: 2 * time.Second} // Health is a loopback call: no proxy, no DNS, no internet. The default
// transport honours HTTP_PROXY, so a stale corporate proxy or PAC script
// would make every probe fail and the launcher would kill a server that was
// already answering.
client = &http.Client{
Timeout: 2 * time.Second,
Transport: &http.Transport{
Proxy: nil,
DialContext: (&net.Dialer{Timeout: 2 * time.Second}).DialContext,
},
}
downloadClient = &http.Client{Timeout: 10 * time.Minute} downloadClient = &http.Client{Timeout: 10 * time.Minute}
nodePinRE = regexp.MustCompile(`^node\s+v?(\d+\.\d+\.\d+)\s+win-x64(?:\s+sha256\s+([0-9a-f]{64}))?(?:\s+size\s+(\d+))?`) nodePinRE = regexp.MustCompile(`^node\s+v?(\d+\.\d+\.\d+)\s+win-x64(?:\s+sha256\s+([0-9a-f]{64}))?(?:\s+size\s+(\d+))?`)
) )
@@ -222,8 +232,8 @@ func run() error {
time.Sleep(pollEvery) time.Sleep(pollEvery)
} }
if processAlive(info.PID) { if processAlive(info.PID) {
return fmt.Errorf("Luminary is already starting (pid %d) but is not answering on port %d. "+ return fmt.Errorf("Luminary is already starting (pid %d) but is not answering on its "+
"See %s.", info.PID, info.Port, filepath.Join(dataDirectory(), "logs", "server.err.log")) "local port %d. See %s.", info.PID, info.Port, filepath.Join(dataDirectory(), "logs", "server.err.log"))
} }
} }
} }
@@ -291,7 +301,7 @@ func run() error {
// code is deliberately ignored: "Stop" force-kills the child. // code is deliberately ignored: "Stop" force-kills the child.
_ = cmd.Wait() _ = cmd.Wait()
removeRuntime() removeRuntime()
writeLog("launcher.log", "server exited") writeLog("launcher.log", "local engine exited")
return nil return nil
} }
time.Sleep(pollEvery) time.Sleep(pollEvery)
@@ -299,8 +309,8 @@ func run() error {
_ = cmd.Process.Kill() _ = cmd.Process.Kill()
removeRuntime() removeRuntime()
return fmt.Errorf("Luminary did not answer on %s within %s; see %s", return fmt.Errorf("Luminary's local engine did not answer within %s; see %s",
healthPath, startupWait, filepath.Join(logDir, "server.err.log")) startupWait, filepath.Join(logDir, "server.err.log"))
} }
// --- runtime resolution ------------------------------------------------------- // --- runtime resolution -------------------------------------------------------
@@ -572,8 +582,10 @@ func openBrowser(url string) {
_ = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start() _ = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
} }
// Edge ships with Windows 10/11, so a chromeless app window costs no extra // Chrome comes first, then Edge: both are Chromium and cost no extra runtime,
// runtime. Chrome is the second choice; anything else falls back to a tab. // but starting Edge prompts for the Microsoft account and settings sync, which
// reads as an unwanted browser taking over the machine. Anything else falls
// back to a normal tab.
func findAppBrowser() string { func findAppBrowser() string {
candidates := []string{} candidates := []string{}
add := func(dir string, rest ...string) { add := func(dir string, rest ...string) {
@@ -581,12 +593,12 @@ func findAppBrowser() string {
candidates = append(candidates, filepath.Join(append([]string{dir}, rest...)...)) candidates = append(candidates, filepath.Join(append([]string{dir}, rest...)...))
} }
} }
for _, key := range []string{"ProgramFiles(x86)", "ProgramFiles", "LOCALAPPDATA"} {
add(os.Getenv(key), "Microsoft", "Edge", "Application", "msedge.exe")
}
for _, key := range []string{"LOCALAPPDATA", "ProgramFiles", "ProgramFiles(x86)"} { for _, key := range []string{"LOCALAPPDATA", "ProgramFiles", "ProgramFiles(x86)"} {
add(os.Getenv(key), "Google", "Chrome", "Application", "chrome.exe") add(os.Getenv(key), "Google", "Chrome", "Application", "chrome.exe")
} }
for _, key := range []string{"ProgramFiles(x86)", "ProgramFiles", "LOCALAPPDATA"} {
add(os.Getenv(key), "Microsoft", "Edge", "Application", "msedge.exe")
}
for _, candidate := range candidates { for _, candidate := range candidates {
if info, err := os.Stat(candidate); err == nil && info.Size() > 0 { if info, err := os.Stat(candidate); err == nil && info.Size() > 0 {
return candidate return candidate
@@ -621,12 +633,16 @@ func openApp(url string) {
openBrowser(url) openBrowser(url)
return return
} }
// --no-proxy-server: the window only ever loads 127.0.0.1, so a proxy or
// PAC script on the machine must not intercept or stall it when the
// network is down.
cmd := exec.Command(exe, cmd := exec.Command(exe,
"--app="+url, "--app="+url,
"--user-data-dir="+profile, "--user-data-dir="+profile,
"--window-size=1500,950", "--window-size=1500,950",
"--no-first-run", "--no-first-run",
"--no-default-browser-check", "--no-default-browser-check",
"--no-proxy-server",
"--disable-features=Translate", "--disable-features=Translate",
) )
if err := cmd.Start(); err != nil { if err := cmd.Start(); err != nil {
+9 -8
View File
@@ -7,8 +7,8 @@ app never looks in this folder.
| File | What to do with it | | File | What to do with it |
| --- | --- | | --- | --- |
| `Luminary-<version>-win-x64-setup.exe` | Copy to the Windows PC and run it. Per-user install, no admin prompt: Start-menu shortcuts, optional desktop shortcut and start-at-login, and an uninstaller that keeps `%LOCALAPPDATA%\Luminary\data`. | | `Luminary-<version>-win-x64-setup.exe` | Copy to the Windows PC and run it. Per-user install, no admin prompt: Start-menu shortcuts, optional desktop shortcut and start-at-login, and an uninstaller that keeps `%LOCALAPPDATA%\Luminary\data`. |
| `Luminary-<version>-win-x64.zip` | The portable alternative: extract, then run `Luminary.cmd` (or `Luminary.vbs`) from the extracted `Luminary` folder. `README-windows.txt` inside the zip is the end-user guide. | | `Luminary-<version>-win-x64.zip` | The portable alternative: extract, then run `Luminary.exe` from the extracted `Luminary` folder. `README-windows.txt` inside the zip is the end-user guide. |
| `LuminaryWindow.exe` inside the zip | optional native window (WebView2); the launcher uses it automatically when present, and starting it directly forwards to the launcher | | `LuminaryWindow.exe` inside the zip | the app window (WebView2): no browser is opened, so it cannot pull in an Edge profile or Microsoft account. The launcher uses it automatically, and starting it directly forwards to the launcher |
| `SHA256SUMS.txt` | Check a copy did not corrupt: `certutil -hashfile Luminary-<version>-win-x64-setup.exe SHA256` | | `SHA256SUMS.txt` | Check a copy did not corrupt: `certutil -hashfile Luminary-<version>-win-x64-setup.exe SHA256` |
## Rebuilding this folder ## Rebuilding this folder
@@ -24,7 +24,7 @@ stages and zips **outside** the checkout (`~/.cache/luminary-windows`, or
artifact. Old versions are not deleted, so remove the ones you no longer ship. artifact. Old versions are not deleted, so remove the ones you no longer ship.
Add `--webview2 <path to LuminaryWindow.exe>` for the native window; without it Add `--webview2 <path to LuminaryWindow.exe>` for the native window; without it
the zip is about half the size (49 MB) and uses the Edge/Chrome app window. the zip is about 65 MB smaller and falls back to an Edge/Chrome app window.
## Before a deploy ## Before a deploy
@@ -35,8 +35,9 @@ publish only when you are actually shipping a build.
## What a Windows user needs ## What a Windows user needs
Windows 10/11 x64 and a current browser (Edge, Chrome or Firefox) with WebGL2. Windows 10/11 x64. Node.js, .NET and the Visual C++ Redistributable are **not**
Node.js, .NET and the Visual C++ Redistributable are **not** required — they are required — they are bundled or part of Windows. The app window uses the
bundled or part of Windows. The native window needs the Microsoft Edge WebView2 Microsoft Edge WebView2 runtime, which Windows 10/11 install with Edge; it is
runtime, which Windows 10/11 already has alongside Edge. See `../README.md` for the window engine only, so no browser window, profile or account is used. The
the import-level audit. Develop module needs WebGL2, which WebView2 provides. See `../README.md` for the
import-level audit.
+9 -1
View File
@@ -1,2 +1,10 @@
e81cbe4001bef43f79a2200acecc5dafbcf6c3c04dc2f6db4685f1f0b3ba3cdc Luminary-0.5.2-win-x64.zip b33e3d8b595aa3ff20b0898f3adea639e02afe9eb54c4fba5dd09ec07e041a0c Luminary-0.5.1-win-x64-setup.exe
22b8943d1ca3bed3ef115530831947e4e03f6a45317ec6b35c10e871fad22a9a Luminary-0.5.1-win-x64.zip
c95ae4d21dfd80cd6206fc3f276c1d1d6afa61f55d48e6646f65784b483ca590 Luminary-0.5.2-win-x64-setup.exe c95ae4d21dfd80cd6206fc3f276c1d1d6afa61f55d48e6646f65784b483ca590 Luminary-0.5.2-win-x64-setup.exe
e81cbe4001bef43f79a2200acecc5dafbcf6c3c04dc2f6db4685f1f0b3ba3cdc Luminary-0.5.2-win-x64.zip
3e5a120b6d7483e0bdc6fb9091cf02e4bbab49e57e4d39c433521fb6ddf44b5a Luminary-0.5.3.1-win-x64-setup.exe
f4cd3e4a40dc79d9fb9d0d3dc627f317d33955cc9d6c77c5ee5f8bcb843b9a58 Luminary-0.5.3.1-win-x64.zip
97cceb61bba34733013d21e1fe240f39da790843694e1390f6266aa128f1c456 Luminary-0.5.4-win-x64-setup.exe
16d033a863345542a07e65bb3914f63d35432fe7b88c33cc65f9d7634428ab98 Luminary-0.5.4-win-x64.zip
44ba60f6bebf5a43e1f8bd2e9beba1b8636e59dc8d07ae9d43096d3b09992e53 Luminary-0.5.4.1-win-x64-setup.exe
2e2ebfcee53edfcb14a58a5535fd384dd99f6c7a386de7f9c59419e8fe6c7969 Luminary-0.5.4.1-win-x64.zip