commit cd52a2f82f590d7a2caee9add4c3150e00ffa452 Author: Brian Hursey Date: Mon Nov 23 15:19:25 2026 +0000 Initial commit: Luminary photo catalog and RAW editor Browser-based photo catalog with an optional team server (SQLite + LibRaw). Local database, uploaded photos, build output and dependencies are gitignored. 🤖 Generated with Codebuff Co-Authored-By: Codebuff diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c71fdab --- /dev/null +++ b/.dockerignore @@ -0,0 +1,14 @@ +node_modules +dist +.git +docs +.gitignore +server/data +.check +.smoke +*.log +.DS_Store +README.md +Dockerfile +.dockerignore +docker-compose.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ead9722 --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +node_modules/ +dist/ + +# Local SQLite database and uploaded photo files +server/data/ + +# Local env / secrets +.env +.env.* +!.env.example + +# Local scratch output +.check/ +.smoke/ +*.log +.DS_Store diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f552e44 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,52 @@ +# syntax=docker/dockerfile:1 + +# ---------------------------------------------------------------- dependencies +FROM node:24-bookworm-slim AS deps +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci + +# ---------------------------------------------------------------------- build +FROM deps AS build +WORKDIR /app +COPY tsconfig.json vite.config.ts index.html ./ +COPY src ./src +# Vite copies public/ into dist/, so the served PDF (in-app Guide link) needs it here. +COPY public ./public +RUN npm run build + +# ------------------------------------------------------- production node_modules +FROM node:24-bookworm-slim AS prod-deps +WORKDIR /app +ENV NODE_ENV=production +COPY package.json package-lock.json ./ +RUN npm ci --omit=dev && npm cache clean --force + +# -------------------------------------------------------------------- runtime +FROM node:24-bookworm-slim AS runtime +WORKDIR /app +ENV NODE_ENV=production \ + PORT=8787 \ + HOST=0.0.0.0 \ + LUMINARY_DATA=/data + +COPY --from=prod-deps /app/node_modules ./node_modules +COPY package.json ./ +COPY server ./server +COPY --from=build /app/dist ./dist + +# Fail the build, not the first request, if the guide or the UI is missing. +RUN test -f dist/index.html && test -f dist/luminary-user-guide.pdf + +# The catalog lives on a volume; it must be writable by the unprivileged user. +RUN mkdir -p /data && chown -R node:node /data /app +USER node + +EXPOSE 8787 +VOLUME ["/data"] + +# node is guaranteed present, so no curl/wget needed in the image. +HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \ + CMD node -e "fetch('http://127.0.0.1:'+(process.env.PORT||8787)+'/api/health').then((r)=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))" + +CMD ["node", "server/index.mjs"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..d298647 --- /dev/null +++ b/README.md @@ -0,0 +1,295 @@ +# Luminary + +A browser-based photo catalog and editor built for a small team: events, ratings, +filtering, and a non-destructive RAW-capable develop module. + +Two ways to run it: + +| Mode | Storage | Raw support | +| --- | --- | --- | +| Browser only (`npm run dev`) | IndexedDB on this device | No — raw files need the server | +| Team server (`npm run server` + `npm run dev`) | SQLite + files on disk under `server/data` | Yes — LibRaw demosaic for all vendors | + +## Quick start + +```bash +npm install + +# browser-only library +npm run dev # http://localhost:5173 + +# with the team server (enables raw + sharing) +LUMINARY_INVITE=our-team npm run server # http://localhost:8787 +npm run dev # proxies /api to the server +``` + +Open the **Local only / Sign in** pill in the top bar. The first account becomes +the admin. After that, invite people from **Administration → Invites**: each link +is single-use, can be locked to an email address, expires automatically and can +be revoked. Setting `LUMINARY_INVITE` also enables a shared code for people who +prefer to register from the sign-in panel. Until you sign in, the app keeps +working exactly as it did before — entirely local. + +### Production + +```bash +npm run build # type-checks, then bundles into dist/ +npm start # serves dist/ and the API from one process +``` + +### Docker + +The image builds the UI and runs one Node process that serves both the app and +the API. Only `/data` needs to persist. + +```bash +docker build -t luminary . +docker run -d --name luminary \ + -p 8787:8787 \ + -e LUMINARY_INVITE=our-team \ + -v lumenroom-data:/data \ + luminary +``` + +The named volume deliberately keeps its original `lumenroom-data` name so an +existing Luminary catalog upgrades in place. + +Or with Compose, which wires up the volume and env vars for you: + +```bash +LUMINARY_INVITE=our-team docker compose up -d --build +``` + +The container runs as the unprivileged `node` user (uid 1000), ships a +`HEALTHCHECK` on `/api/health`, and exposes port 8787. To put it behind a TLS +proxy, forward `X-Forwarded-Proto: https` so session cookies are marked `Secure`. + +Back up the catalog by copying the volume: + +```bash +docker run --rm -v lumenroom-data:/data -v "$PWD":/backup alpine \ + tar czf /backup/luminary-$(date +%F).tar.gz -C /data . +``` + +Environment variables: + +| Variable | Default | Purpose | +| --- | --- | --- | +| `PORT` | `8787` | Server port | +| `LUMINARY_DATA` | `server/data` | Where originals, previews and the database live | +| `LUMINARY_INVITE` | *(empty)* | Optional shared invite code for new accounts; personal invite links work without it | +| `LUMINARY_MAX_UPLOAD` | `300 MB` | Upload ceiling (bytes) | +| `LUMINARY_RAW_EDGE` | `6000` | Long edge of the editable proxy generated for raws | +| `LUMINARY_RAW_WORKERS` | `4` (capped at cores−1) | Raws demosaiced at once; each worker holds a LibRaw instance | +| `LUMINARY_RAW_IDLE_MS` | `90000` | Idle decoders are disposed after this, to hand memory back | +| `LUMINARY_QUOTA_BYTES` | `100 GiB` | Default per-account storage allowance (bytes) | +| `LUMINARY_QUOTA_WARN_RATIO` | `0.9` | Fraction of the quota that triggers the in-app and email warning | +| `LUMINARY_PUBLIC_URL` | *(empty)* | Public app URL included in notification emails | +| `LUMINARY_SMTP_USER` | *(empty)* | Gmail address used as the mail sender | +| `LUMINARY_SMTP_APP_PASSWORD` | *(empty)* | Gmail app password (not the normal account password) | +| `LUMINARY_SMTP_FROM` | sender address | Optional From address for notifications | + +The pre-rebrand `LUMENROOM_*` environment variable names are still accepted as +fallbacks, so existing deployments can upgrade without changing their config. + +## Bridge from the Media Team Hub + +A separate dashboard can hand an event over to this editor without sharing +passwords or copying the library. The dashboard signs a short-lived token, sends +the browser to `/api/bridge/login?token=…`, and this server verifies it with the +shared `BRIDGE_SECRET`, creates or reuses a user by email, imports the event's +photo list and redirects into the app with that event open. Photo bytes are +proxied from the dashboard on demand, so the import is metadata only. + +```bash +GLENLOCH_URL=https://media.example.org \ +BRIDGE_SECRET= \ +LUMINARY_INVITE=our-team \ + docker compose up -d --build +``` + +| Variable | Default | Purpose | +| --- | --- | --- | +| `GLENLOCH_URL` | *(empty)* | Dashboard base URL; empty disables the bridge | +| `BRIDGE_SECRET` | *(empty)* | Shared HMAC secret for bridge tokens | +| `LUMINARY_BRIDGE_TTL_HOURS` | `12` | How long an imported bridge event survives | + +The editor shows a banner with **Save to event** — it renders the open photo in +the browser and stores it on the dashboard event as the edited JPEG — and **Back +to dashboard**. Imported events and their catalog rows are temporary: expired +bridge events are swept on the next bridge login. Originals stay on the +dashboard's media storage; only previews and thumbnails are cached under +`LUMINARY_DATA`. RAW files are edited on a 4000 px JPEG proxy generated by the +dashboard and cached here; JPEG/PNG originals are streamed at full size. Bridge accounts have a random password hash, so they can only +be reached through the dashboard link, not the normal sign-in form. + +## Features + +**Library** — events in the sidebar (create, rename, delete, drag to reorder, +drop photos onto an event to move them), drag photos to reorder within a view, +star ratings, pick/reject flags, five color labels, filters (rating, unrated, +flag, labels, "edited only", free text over name/camera/lens/keywords), sorting +by capture date, import date, name, rating or manual order, multi-select with +shift-ranges and bulk actions. Right-click any photo for a menu with the star +rating, flags and color labels plus open, copy/paste settings, export and delete. +Deleted photos move to a Trash with restore, permanent delete and empty trash. +Select 2–4 photos and press **C** (or click Compare) for a full-screen survey; +double-click a frame to develop it. Selected photos can also be grouped into a +stack (`Stack`, or right-click → Stack selected): the grid collapses a stack to +one card with a count badge, and clicking the badge expands or collapses it. +Right-click → Unstack removes the grouping. + +**Develop** — a WebGL2 multi-pass pipeline, per photo, non-destructive: + +- white balance, exposure, contrast, highlights/shadows/whites/blacks +- texture, clarity, dehaze, vibrance, saturation, black & white mix +- RGB + per-channel tone curves +- 8-band HSL color mixer, split toning / color grading +- sharpening, luminance noise reduction +- vignette, grain +- crop with nine aspect ratios, straighten, 90° rotation, flips +- local adjustments (up to four layers): brush, linear gradient and radial + masks with feather, invert, luminance/hue/saturation ranges, and per-layer + exposure, contrast, highlights, shadows, temperature, tint and saturation; + masks follow crops, zoom, healing and lens correction, and Copy mask / Paste + mask carry one layer between photos +- full Lensfun lens profiles: distortion, transverse chromatic aberration and + vignetting from the official calibration database, with manual lens search, + "Match EXIF lens" auto-detection, per-correction switches and automatic + edge scaling; focal length and aperture are read from each photo. Save a + profile as the default for a camera + EXIF lens pair and matching imports + apply it automatically, the Optics panel can show a draggable before/after + split for the lens correction, and a Settings view lists and removes saved + camera-lens defaults +- manual perspective correction: vertical/horizontal keystone, fine rotation + and scale, applied while sampling the source +- spot healing brush (Q): click a blemish, drag to move it, Alt-drag the sample, + adjustable size and feather +- scroll-wheel zoom with a Fit / 100% readout, drag to pan, double-click to zoom + in or back out; right-click the canvas for zoom, crop, copy/paste and export +- histogram, presets (built-in + saved), history with undo, selective + copy/paste and batch sync, named snapshots, virtual copies, before/after +- on-device auto subject, sky and background masks (no model download), an + ISO/camera-aware noise starting point, edge-aware lens-softness compensation, + and an approximate paper soft-proof preview +- HDR merge with alignment, horizontal panorama stitching and focus stacking; + each result is added to the catalog as a new editable photo +- browser print layouts (A4, Letter, 5×7) rendered through the develop pipeline + +**Proofing galleries** — turn any event into a public link (`/g/`) from +**Share** in the top bar. Clients open it without an account, see only that +event's live photos, heart favourites, leave per-photo comments, mark a photo +approved or needing changes, and download the proof. Feedback appears on the +library grid and in the "Client picks", "Approved" and "Changes" filters. +Links can be revoked, which drops their picks and feedback. + +**Team accounts** — the first signup becomes the admin. Admins create single-use +invite links (`/join/`) with an optional email lock and 1–30 day expiry, +copy them from the admin panel, see who joined, and revoke a link at any time. + +**Storage quotas and pruning** — every account starts with a 100 GB quota. At 90% +the user sees a warning in the app and receives at most one reminder email per +day. Admins can change a quota in **Administration → Quotas**, request the oldest +content be deleted, and schedule the cleanup. Scheduling sends the user a +warning email with the exact events and photos that will be removed, then waits +24 hours before deleting them. Content added after the warning is never included +in that prune. Email uses Gmail SMTP with a Google app password, configured in +the same tab or via the `LUMINARY_SMTP_*` variables above. + +**Catalog workflow** — editable title, caption, creator, copyright and keyword +chips with a keyword library and reusable metadata presets. Save the current +filters and sort as a smart collection. Virtual copies share the master file +but keep independent edits; named snapshots preserve alternative looks. + +**Export and print** — format (JPEG/PNG/WebP), quality, resize by long edge or +percent, filename template (`{name}`, `{date}`, `{time}`, `{index}`), saved +export recipes, output sharpening, watermark, embedded XMP metadata in JPEGs, +batch export as one ZIP (or separate files), and browser print layouts. +Full-resolution export runs through the same renderer. + +## Lens profile data + +Lens correction uses the official [Lensfun](https://lensfun.github.io/) database +and its WebAssembly build (`@neoanaloglabkk/lensfun-wasm`). The runtime assets +are served from `public/lensfun/`: the library is LGPL-3.0-or-later, the camera +and lens database is CC BY-SA 3.0, and the bundled notices and license texts sit +next to the assets. This is a non-commercial project; if the database is reused +or redistributed, keep the attribution and share-alike terms. + +Profiles load lazily the first time the Optics panel needs one, so a library +that never uses them does not download the ~5 MB database. + +## Raw support + +The browser cannot decode camera raw, so the server does it: + +1. The original file is stored byte-for-byte (`server/data/originals`). +2. LibRaw (`libraw-wasm`) demosaics it with the camera's white balance and + orientation, and `sharp` encodes an editable JPEG proxy (long edge + `LUMINARY_RAW_EDGE`). +3. If LibRaw cannot open a file, the largest JPEG embedded in the container is + used instead, so exotic or very new cameras still import. The grid marks such + photos `RAW` and the Info panel reports which engine produced the proxy. + +Formats: CR2/CR3/CRW, NEF/NRW, ARW/SRF/SR2, ORF, RW2/RWL, RAF, PEF, DNG, SRW, +3FR, FFF, IIQ, X3F, ERF, K25/KDC, DCR, MOS, MRW, MEF. + +**Parallel import.** Decoding runs in a small pool of LibRaw workers (default 4, +`LUMINARY_RAW_WORKERS`) and the browser uploads four files at a time, so a card +imports several times faster than one file after another. Measured on this repo +with 8 mixed raws (20 MP average): + +| Workers | 8 files | Speedup | Peak memory | +| --- | --- | --- | --- | +| 1 (serial) | 19.2 s | 1.0× | — | +| 4 | 5.2 s | 3.7× | ~2.5 GB | +| 8 | 3.5 s | 5.4× | ~3.5 GB | + +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. Workers idle for 90 s are +disposed and recreated on demand, so a burst of imports does not pin memory +forever. `GET /api/health` reports the pool size. + +## Layout + +``` +src/ + App.tsx state, filtering, sync, drag-and-drop, shortcuts + gl/renderer.ts WebGL2 pipeline (grade → blur → finish) + lib/lensfun.ts lazy Lensfun client, profile matching and CPU map math + lib/ db, api client, edits model, import/export, presets + components/ library grid, develop, panels, modals +public/lensfun/ vendored Lensfun WASM runtime, database and licenses +server/ + index.mjs HTTP API + static hosting + db.mjs SQLite schema (node:sqlite, no native deps) + raw.mjs LibRaw decode + embedded-preview fallback + imaging.mjs sharp encoding, PNG fallback +``` + +## Limitations + +- No cloud hosting or tethered capture. Compare is a still survey rather than a + synchronised zoom/pan view. Merge tools are translation-aligned and aimed at + bracketed, stacked or horizontal panorama sequences, not handheld multi-row + composites. +- Lens profiles are matched from the bundled Lensfun database. A photo whose + EXIF has no lens name needs a manual profile choice; a profile is built for + the photo's current focal length and aperture, not interpolated between + zoom positions. Camera defaults require both a camera and a lens name, and + only apply when the normalized EXIF pair matches one saved default. +- Raw editing works on the decoded proxy (6,000 px default), not the full sensor + mosaic; export size is bounded by the proxy. +- Temperature/tint are relative to the as-shot white balance. +- Auto masks are a lightweight on-device saliency/colour estimate, not a + downloaded segmentation model. They are a starting point that can be + feathered or inverted; complex hair and foliage edges still need a brush. +- Soft proofing approximates paper white, black point and a print gamut; it does + not apply a printer ICC profile. Use the browser print dialog for final ICC + handling. +- Denoise auto-profile is an ISO/camera-aware curve over the existing sliders, + not a calibrated per-sensor noise profile or a learned denoiser. +- Sync is whole-record: the last writer wins per photo. It is designed for a + handful of people sharing one catalog, not for concurrent batch workflows. +- Trash is a soft-delete inside the catalog; there is no automatic catalog + backup. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b592a78 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,38 @@ +services: + luminary: + build: . + image: luminary:latest + container_name: luminary + restart: unless-stopped + ports: + - "${LUMINARY_PORT:-8787}:8787" + environment: + # LUMINARY_* settings; the server still accepts legacy LUMENROOM_* names. + # Invite code for every account after the first (admin) one. + LUMINARY_INVITE: ${LUMINARY_INVITE:-${LUMENROOM_INVITE:-}} + LUMINARY_MAX_UPLOAD: ${LUMINARY_MAX_UPLOAD:-${LUMENROOM_MAX_UPLOAD:-322122547}} + LUMINARY_RAW_EDGE: ${LUMINARY_RAW_EDGE:-${LUMENROOM_RAW_EDGE:-6000}} + # Per-account storage allowance and the fraction at which users are warned. + LUMINARY_QUOTA_BYTES: ${LUMINARY_QUOTA_BYTES:-107374182400} + LUMINARY_QUOTA_WARN_RATIO: ${LUMINARY_QUOTA_WARN_RATIO:-0.9} + # Optional URL shown in notification emails. + LUMINARY_PUBLIC_URL: ${LUMINARY_PUBLIC_URL:-} + # Optional Gmail SMTP fallback; admins can also set these in the UI. + LUMINARY_SMTP_USER: ${LUMINARY_SMTP_USER:-} + LUMINARY_SMTP_APP_PASSWORD: ${LUMINARY_SMTP_APP_PASSWORD:-} + LUMINARY_SMTP_FROM: ${LUMINARY_SMTP_FROM:-} + # Parallel raw decoders; each one holds a LibRaw worker (few hundred MB). + LUMINARY_RAW_WORKERS: ${LUMINARY_RAW_WORKERS:-${LUMENROOM_RAW_WORKERS:-4}} + # Bridge from the Media Team Hub: dashboard base URL and the shared HMAC + # secret (must match the dashboard's BRIDGE_SECRET). Empty disables it. + GLENLOCH_URL: ${GLENLOCH_URL:-} + BRIDGE_SECRET: ${BRIDGE_SECRET:-} + LUMINARY_BRIDGE_TTL_HOURS: ${LUMINARY_BRIDGE_TTL_HOURS:-${LUMENROOM_BRIDGE_TTL_HOURS:-12}} + volumes: + # Originals, previews, thumbnails and the SQLite catalog. + - lumenroom-data:/data + +volumes: + # Retain the original volume name so an existing catalog can be upgraded in place. + lumenroom-data: + name: lumenroom-data diff --git a/docs/Luminary-User-Guide.pdf b/docs/Luminary-User-Guide.pdf new file mode 100644 index 0000000..2503b84 Binary files /dev/null and b/docs/Luminary-User-Guide.pdf differ diff --git a/docs/ai-denoise-feasibility.md b/docs/ai-denoise-feasibility.md new file mode 100644 index 0000000..c83958e --- /dev/null +++ b/docs/ai-denoise-feasibility.md @@ -0,0 +1,316 @@ +# AI denoise — feasibility review and raw-decoder prototype + +**Status:** review + prototype only. No application code was changed. +**Date:** 2026-11-22 +**Scope:** could Luminary get a Lightroom-class AI denoise, and what stands in the way? +**Revisit when:** high-ISO raw material is available (see +[§8](#8-the-test-material-gap)). + +--- + +## 1. What the app actually is + +This matters because an earlier design assumed an Electron desktop app. It is not. + +- **Front end:** React 18 + Vite, WebGL2. All editing happens in the browser on a + demosaiced proxy. `Edits` JSON (`src/types.ts`) is the non-destructive document. +- **Server:** plain `node:http` (`server/index.mjs`, ~1,310 lines, hand-rolled + router at `:284`), cookie sessions, SQLite catalog, deployed as + `node:24-bookworm-slim` in Docker as an unprivileged user. +- **Raw path:** `libraw-wasm` in a `worker_threads` pool (`server/libraw-pool.mjs`), + `open()` + `imageData()` → 8-bit sRGB JPEG proxy at `RAW_PREVIEW_EDGE = 6000` + long edge (`server/config.mjs:14`, `RAW_PREVIEW_EDGE`). `sharp` for JPEG ingest, + `lensfun-wasm` for lens correction. +- **Renderer:** `src/gl/renderer.ts`. `setImage()` uploads one `u_src` texture + (`:1144`), grade pass samples it at `:1296`, finish pass at `:1553`. +- **Export:** `src/lib/export.ts` builds a fresh `Renderer` from `getBitmap()` — a + second place any new image stage must be wired, or exports silently omit it. + +### What exists today under the name "noise reduction" + +`Edits.noise = { luminance, detail, chroma, chromaDetail }` (`src/types.ts:164`), +UI in `DetailPanel` (`src/components/Panels.tsx:495`), defaults seeded from +`autoNoiseFor()` (`src/lib/noiseProfile.ts`) — an ISO→slider heuristic, not a +physical noise model. + +The shaders are classical and coarse: + +- Luminance (`renderer.ts:517`): `mix(c, mix(bs, bb, 0.5), nr * 0.6)` — a two-tap + blur blend. +- Chroma (`:545`): a 17-tap circular average on the chroma axes. + +So AI denoise is not a marginal improvement here; it is a different category. Keep +the classical path as the instant/non-AI option rather than replacing it. + +`noiseProfile.ts` gives the UI a starting point but is **not** a Poisson–Gaussian +model — a denoiser needs real per-camera `k`/`σ²` (see [§7](#7-what-is-still-unknown)). + +--- + +## 2. Verdict + +**Moderate-to-hard, and the difficulty is not where it looks.** + +The integration seams are good: the server already owns the raw file, already has a +worker pool, and the renderer takes a texture cleanly. A two-week path to a working +raw-domain pipeline exists. The real risks are three: + +1. **No trained model.** Independent track, measured in weeks. Nothing in this repo + or the earlier prototype has weights; `onnxruntime-node` has never actually run a + model end to end here. +2. **There is no mosaic→RGB path back.** LibRaw demosaics internally, so denoising + the mosaic means re-deriving RGB yourself. This is where colour drift appears. +3. **No GPU.** `onnxruntime-node` ships CPU + DirectML only; DML is Windows-only and + the server is a Linux container. Plan for the dual-Xeon CPU, ~30–90 s/frame. + +Also: the editable proxy is an **8-bit JPEG at ≤6000 px**, so any denoise performed +*after* it is materially worse than Lightroom, which denoises the mosaic. + +### Effort at a glance + +| Piece | Size | Notes | +|---|---|---| +| Mosaic helper in `server/raw.mjs` | ½ d | ~180 ms/frame, leaves `demosaic()` untouched | +| Black-level + orientation calibration | 2–4 d | see §5, §6 — real work, not a one-liner | +| Denoise endpoint + asset cache | 1–2 d | `data/denoised/.jpg`, keyed by raw hash + model version + params | +| Job progress channel | 1–2 d | **nothing exists**; every route is request/response | +| Raw-domain denoise (DNG round-trip) | 3–6 d | mosaic → VST → tiled ONNX → DNG → LibRaw → proxy | +| Renderer: second texture + `mix()` | ½ d | `u_den` + amount uniform at `renderer.ts:512` | +| Edit model, panel, history, presets | 1–2 d | `Edits.aiDenoise`, `normalizeEdits`, `DetailPanel` | +| Export path | ½ d | easy to forget → denoise missing from exports | +| **Model (train/obtain)** | **weeks** | independent; the long pole | + +**≈1.5–2 weeks of plumbing**, excluding the model. + +--- + +## 3. Three placement options + +**A. Server-side, raw mosaic domain (the goal).** Best quality; matches what +Lightroom does. Requires a demosaic path (B or C below). + +**B. DNG round-trip — recommended.** Write the denoised mosaic as a minimal DNG +(CFA pattern, black/white, `AsShotNeutral`, colour matrix) and hand it back to +`libraw-wasm.open()`. LibRaw then does its normal demosaic and colour handling, so +the denoised proxy matches the current proxy's tone exactly. `src/lib/tiff.ts` +already contains 16-bit TIFF writing. + +**C. Own demosaic.** Malvar-He-Cutler is ~150 lines and removes the second decode, +but colour will not match LibRaw's output — visible as a shift when the Amount +slider sits mid-range, since the two textures are blended. + +**D. Proxy domain (cheap, not the goal).** Denoise the 8-bit JPEG the client already +has. Fast to build, quality ceiling well below Lightroom. + +--- + +## 4. Raw decoder prototype — what was verified + +Run against the 37 sample raws in `server/data/originals/` (36 × Nikon D700 NEF, +1 × Canon 20D CR2) through the repo's own loader, so the worker shim and wasm module +resolve exactly as they do in production. Scripts were throwaway (`/tmp`), none of +this is committed. + +### The mosaic path works + +| | Nikon D700 | Canon 20D | +|---|---|---| +| mosaic frame | 4288 × 2844 | 3596 × 2348 | +| visible frame | 4284 × 2844 | 3522 × 2348 | +| margins (top, left) | 0, 2 | 12, 74 | +| `data.length` | 12,195,072 = `rawW × rawH` | 8,443,408 = `rawW × rawH` | +| element type | `Uint16Array` | `Uint16Array` | +| `color_data.maximum` | 16383 (14-bit) | 4095 (12-bit) | +| `meta.filters` | `0xB4B4B4B4` → RGGB | `0xB4B4B4B4` → RGGB | +| `meta.cdesc` / `meta.colors` | `RGBG` / 3 | `RGBG` / 3 | +| `color_data.cam_mul` | e.g. 436/256/355 | 1806/1015/1673 | + +`data.length === raw_width * raw_height` in every file, so the buffer spans the +whole sensor and cropping to visible is exactly +`(top_margin, left_margin, width, height)` — no stride surprises. + +Cost, measured on this machine: + +| operation | D700 | 20D | +|---|---|---| +| `open()` | ~140 ms | — | +| `rawImageData()` | **32–38 ms** | ~30 ms | +| `imageData()` (current demosaic) | **~1,965 ms** | ~1,604 ms | + +Mosaic access is ~60× cheaper than demosaicing. Memory: 24.4 MB per D700 frame as +`Uint16Array`. + +### CFA decode + +`meta.filters` is a dcraw bitmask: 8 rows × 2 columns of 2-bit colour codes. + +```js +const FC = (filters, row, col) => + (filters >> ((((row << 1) & 14) + (col & 1)) << 1)) & 3; +``` + +`0xB4B4B4B4` decodes to standard RGGB on both bodies: + +``` +R G R G R G R G +G B G B G B G B +... +``` + +--- + +## 5. Correction: the black level is not exposed and must be derived + +`color_data.black` is **0** for both cameras, and `color_data.dng_levels.dng_black` +is 0 too. For the Canon that is false. + +| | D700 | 20D | +|---|---|---| +| `color_data.black` | 0 | 0 | +| darkest 0.2 % quads, per CFA channel | 21.7 / 28.8 / 29.3 / 17.4 | **146.1 / 165.6 / 165.8 / 151.6** | +| darkest-quad sd | 6.4–6.5 | 3.2–4.5 | +| masked-border median | 770 | **128** | + +The 20D carries an unsubtracted pedestal of ~128 DN with a **per-channel spread** +(R and B 15–20 DN above the greens) — the signature of Canon per-channel black that +dcraw keeps in `cblack`, which this libraw-wasm build does not surface. Feeding that +into an Anscombe VST without subtracting it biases the variance estimate and leaves +a DC lift. + +The border is **not** a safe universal fallback: on the D700 the two "margin" columns +read 770 DN, brighter than the darkest visible pixels (p0 = 8.75), so they are +uncalibrated active pixels rather than masked ones. + +**Working rule:** use the masked-border median only when +`borderMedian < visibleP01`; otherwise fall back to a per-camera constant, else 0. +This needs to be validated per body — it is calibration work, not a one-liner. + +--- + +## 6. Correction: the mosaic is never flipped, the proxy always is + +`rawImageData()` returns sensor orientation regardless of EXIF. `metadata()` reports +visible dims already swapped for rotated frames, and `imageData()` returns the +rotated frame (`userFlip: -1` in `DECODE_SETTINGS`, `server/raw.mjs:59`). + +Correlating a 2×2-quad downsample of the mosaic against demosaiced luma: + +| file | `flip` | matching orientation | r | +|---|---|---|---| +| `p_mwpnuqw4_de2ag7dq.nef` | 0 | none | 0.9437 | +| `p_mwpnuoyg_24j6va1c.nef` | 5 | **90° CCW** | 0.9512 | +| `p_mwpnv4gt_tffz1ydw.cr2` | 0 | none | 0.9592 | + +r < 1 is expected: the mosaic quad mean is pre-white-balance, the demosaiced luma is +post-`cam_mul`. + +**Consequence:** a denoised proxy written straight from the mosaic comes back +**sideways on every portrait frame**. Orientation is a pipeline step, not a detail. +`flip: 6` and `flip: 3` are still untested — no samples in the catalog. + +--- + +## 7. What is still unknown + +- **`flip` 6 / 3 / 8 mapping** — only `flip: 5` and `0` appear in the samples. +- **Per-camera black constants** — only D700 and 20D measured. Every body in real use + needs its own (empirical pedestal, per-channel offsets). +- **Whether a DNG round-trip preserves tone exactly** — the central assumption of + option B, untested. +- **Real Poisson–Gaussian `k`/`σ²`** — not derivable from ISO alone; needs + flat-field frames per body per ISO. +- **Denoise timings** — no model has ever run on this machine + (`onnxruntime-node` native binary could not be downloaded here). +- **Behaviour on bridged photos** — bridge-imported items may have no local original + (`server/storage.mjs:findOriginal`); denoise must fetch upstream or grey out. +- **Virtual copies** — `copyOf` shares the master's bytes; cache must key on the + master's raw hash, not the photo id. + +--- + +## 8. The test material gap + +**All 37 samples are ISO 100** (D700: 1/60 s, f/5.6, 44 mm). Nothing in this +catalogue exercises the range where denoise matters, so no denoise work can be +validated against it. + +To revisit this properly, collect: + +1. **A high-ISO ladder on one body** — e.g. 1600 / 3200 / 6400 / 12800 / 25600 of the + same static scene, tripod, dim tungsten light, some deep shadows. +2. **Flat field / lens-cap frames per ISO** — to derive per-channel black and the + noise model instead of guessing. +3. **A portrait-orientation frame** per body — to confirm the `flip: 6` mapping. +4. **At least one second vendor** — the catalogue is effectively Nikon-only; the + Canon black-level behaviour above shows vendor assumptions break fast. +5. **A reference render** — the same frame pushed through Lightroom AI Denoise at a + known strength, to have an objective target rather than an impression. + +Synthetic noise added to the existing ISO 100 mosaics is fine for pipeline and +plumbing tests (tiling seams, orientation, cache keys) but cannot validate a model. + +--- + +## 9. What carries over from the earlier reference implementation + +Written previously in a different project directory for the (incorrect) Electron +assumption: + +| file | status | +|---|---| +| `src/denoise/math.ts` — VST, Bayer packing, tiling, `blendMosaics` | **reuse** | +| `src/denoise/pipeline.ts` — tile runner with injected backend | **reuse** | +| `src/denoise/engine.ts` — ONNX Runtime adapter | **reuse** | +| `src/denoise/types.ts` — `RawMosaic` | reuse, but **extend** (see §1, §5) | +| `src/denoise/worker.ts` — `utilityProcess` | **discard** (Node worker_threads instead) | +| `src/main/*`, `src/preload/*` | **discard** (no Electron) | +| `src/renderer/denoise-notice.ts` | rewrite as a React component on `Panel`/`Slider` | +| tests (`node:test`, 19/19 passing) | port to **vitest** (`npm test` = `vitest run`) | + +Key algorithmic finding to keep: the affine noise model `u/k + σ²/k²` is wrong in +0–1 normalised units (measured 664× noise amplification). The generalised Anscombe +VST is unit-agnostic — keep that. + +--- + +## 10. Recommended next steps + +1. **DNG round-trip spike** — take one sample's mosaic, write a minimal DNG, reopen it + in `libraw-wasm`, and diff the RGB against the current demosaic output. This + decides option B vs C and is the single highest-value unknown. +2. **Black-level calibration** — per-body, per-channel, with the border heuristic in + §5 validated across vendors. +3. **Server plan** — mosaic helper, orientation step, endpoint, job channel, cache + keying, export wiring, and worker-pool limits (`RAW_WORKERS` defaults to + `min(4, cores-1)`; a 14-thread denoise beside it will starve `/api/health`). +4. **Source the high-ISO material** in §8 before any model work. + +--- + +## 11. Reproducing the probe + +The throwaway scripts lived in `/tmp` (`rawprobe.mjs`, `rawmeta.mjs`, `rawalign.mjs`, +`raworient.mjs`). To rebuild, import the repo's own loader so the runtime shim is +installed and the wasm resolves: + +```js +import { loadLibRaw } from '/server/libraw-pool.mjs'; + +const Ctor = await loadLibRaw(); +const lib = new Ctor(); +await lib.open(Buffer.from(rawBytes), {}); // note: open() detaches the buffer +const meta = await lib.metadata(true); // fullOutput — needed for color_data +const raw = await lib.rawImageData(); // { raw_width, raw_height, + // top_margin, left_margin, + // width, height, data: Uint16Array } +lib.dispose(); +``` + +Gotchas confirmed during the prototype: + +- `metadata()` **without** `true` omits `color_data` entirely; `filters`/`cdesc`/ + `colors` are top-level either way. +- `open()` transfers the buffer to the worker and detaches it — hand it a copy if the + caller's bytes are needed again (`server/raw.mjs` already does this). +- `imageData({ noInterpolation: true })` returns 8-bit, pre-rotated, CFA-gap-zeroed + output. Useless as a mosaic source; `rawImageData()` is the only option. diff --git a/docs/user-guide/guide.html b/docs/user-guide/guide.html new file mode 100644 index 0000000..ff5333a --- /dev/null +++ b/docs/user-guide/guide.html @@ -0,0 +1,786 @@ + + + + +Luminary — User Guide + + + + + +
+
+
Luminary
+
+

User Guide

+
Import, cull, develop and export raw photographs in the browser — a complete desktop-style workflow.
+
+
The Luminary library
+
+
+
+
+ VERSION 1.0 · NOVEMBER 2026 + SCREENSHOTS FROM THE RUNNING APPLICATION +
+
+
+ + +
+
Contents
+

What is in this guide

+

Every panel, dialog and keyboard shortcut in the application, in the order you meet them during a real shoot: bring the card in, cull it down, develop the keepers, deliver the files.

+
+
1Introduction
+
2Getting started
+
3Importing photos
+
4The library
+
5Culling a shoot
+
6The Develop workspace
+
7Light and white balance
+
8Colour
+
9Effects and Detail
+
10Crop and straighten
+
11Presets
+
12History, copy and paste
+
13Exporting
+
14Keyboard reference
+
15The team server
+
16Troubleshooting and limits
+
AFormats and badges
+
+ +

How to read this guide

+

Figures are real screenshots taken from the application with a family portrait session loaded. The photographs, file names and camera metadata are the uploaded originals; the cull, crop and grade shown were arranged for this guide, so every example is a real frame rather than a simulated colour field.

+

Keys are written for both platforms. ⌘ means Command on macOS; use Ctrl on Windows and Linux. Both are accepted everywhere ⌘ / Ctrl appears, and on Windows the menu equivalents are in the right-click menu.

+ +
+
Local firstOriginals, ratings and edits live in this browser. Nothing is uploaded unless you sign in to a server.
+
Non-destructiveEvery adjustment is stored as parameters next to the file; the original pixels are never rewritten.
+
Raw awareCamera raws are demosaiced by the optional Node server, then developed like any other frame.
+
+
+ + +
+
Chapter 1
+

Introduction

+

Luminary is a browser-based raw workflow: a catalogue, a culling surface and a full develop module backed by a WebGL renderer, with an optional team server for shared storage and raw decoding.

+ +

The shape of the application

+

There are two screens, and you move between them constantly.

+

Library is the catalogue: a grid of every photo in the current view, a filter bar, and the filmstrip-free space you need to rate and reject quickly. Develop is the darkroom: one photo on a large canvas, a navigator and preset rail on the left, sliders and a histogram on the right, and the filmstrip along the bottom.

+

The switch at the top centre moves between them; G returns to the library from almost anywhere, and Esc in Develop does the same.

+ +

What happens to your files

+

When you import, Luminary reads the EXIF metadata, generates a small JPEG thumbnail, and stores both the original blob and the record in the browser's IndexedDB database. Edits are a plain JSON object attached to that record. Reopening the page reloads everything from disk-backed browser storage; there is no upload, no account and no network round trip in local mode.

+

If you start the team server and sign in, originals are also written to server/data and the library can be shared. The editing model does not change: the server stores files and records, the browser still does the rendering.

+ +
+ Nothing is destructive. Reset adjustments, copy settings and the History panel all rewrite the parameter object only. The original file is untouched until you export a new copy. +
+ +

Requirements

+ + + + + + + + +
ItemRequirement
BrowserA current Chromium (Chrome, Edge), Firefox or Safari with WebGL 2 enabled. Hardware acceleration is strongly recommended — every preview, thumbnail and export is rendered on the GPU.
Display1280 × 800 or larger. The layout is designed for a laptop screen and expands to fill a desktop display.
StorageBrowser storage quota (typically a share of free disk). Large catalogues of raw files are better kept on the team server.
Raw filesRequire the Node server, which demosaics with LibRaw. Without it, JPEG, PNG, WebP, AVIF and TIFF import directly.
+
+ + +
+
Chapter 2
+

Getting started

+

Two commands get you a working catalogue. The first run of the app is empty — the grid shows its hint text until you import or drop something on it.

+ +

Run it locally

+
    +
  1. Install the dependencies once: npm install.
  2. +
  3. For development, run npm run dev and open the address Vite prints.
  4. +
  5. For the full application — static build plus API and raw decoding — run npm run build, then npm start, and open http://localhost:8787.
  6. +
  7. To run it in a container, use docker compose up; the same port is published and server/data is mounted as a volume.
  8. +
+

The server also serves the built user interface, so npm start on its own is enough once dist/ exists. Health and capabilities are available at /api/health.

+ +

Bring in your first photos

+

Press ⌘ / Ctrl + I, click Import photos in the top right, or drag files from your file manager anywhere onto the window. The import dialog is described in the next chapter.

+ +
+ The library with a three-photo selection +
Figure 1. The library after the import and a first cull. The sidebar lists the catalogue and its event, the filter bar narrows the grid, the selection bar appears as soon as anything is selected, and each card carries its own rating, flag, colour label and file metadata.
+
+
+ + +
+
Chapter 3
+

Importing photos

+

Importing is a single dialog with three jobs: choose where the photos belong, collect the files, and report anything that could not be read.

+ +
+ The import dialog with four files staged +
Figure 2. The import dialog with four raw files staged. The event picker points at the existing Family Portrait Session; the summary counts the batch and flags the raw files, and the server is ready to demosaic them.
+
+ +

Adding files

+
    +
  • Drag anywhere onto the window. A full-window drop target appears, and dropping opens the dialog with those files already staged. This works from the library and from Develop.
  • +
  • Click the drop zone inside the dialog to open the file picker, or use Import photos in the top bar.
  • +
  • Files already staged are de-duplicated by name and size, so dropping the same card twice does not double the batch.
  • +
+ +

Choosing a destination

+

The Event / album menu lists every event plus + New event…, which reveals a name field. The event is metadata, not a folder: a photo can be moved between events later without touching the file.

+ +

What can be imported

+ + + + + + +
TypeBehaviour
JPEG, PNG, WebP, AVIF, TIFFDecoded in the browser. EXIF camera, lens, ISO, aperture, shutter and focal length are read when present.
Camera raw — CR2, CR3, NEF, ARW, ORF, RW2, RAF, DNG, PEF, SRW, 3FR and moreSent to the team server, demosaiced with LibRaw, and returned as an editable proxy plus a server-side original. Requires a signed-in session.
+

During an import a progress bar reports the current file by name. If some files fail, the dialog lists each one with the reason and keeps the successes; a failed raw usually means the server is offline or the file is a format LibRaw cannot open.

+ +
+ Raws without a server. The browser cannot decode most camera raws. Stage them anyway and the dialog offers Sign in to the server; once connected, the same batch decodes normally. Server decoding runs a few files at a time, typically two to four seconds per frame. +
+
+ + +
+
Chapter 4
+

The library

+

The library is where you decide what is worth developing. It is built for speed: rating, flagging and filtering without ever opening a photo.

+ +

The sidebar

+

All photos is the whole catalogue. Unsorted holds anything not yet assigned to an event. Below them, each event shows its photo count; the + next to the catalog header creates a new one. The footer reports the server state — whether one was detected, and whether you are signed in.

+ +

The filter bar

+
+ The filter bar +
Figure 3. Rating and flag filters, colour label swatches, free-text search, the Edited toggle, sort order, and the count of visible photos.
+
+
    +
  • Rating — Any, one to five stars, or Unrated. Filtering for 3★ and above is the usual first pass.
  • +
  • Flag — Any, Picked, Unflagged, Rejected.
  • +
  • Label — the six colour swatches. Click one to keep only that colour; click it again to clear.
  • +
  • Search — matches file name, camera, lens and keywords as you type.
  • +
  • Edited — shows only photos with develop adjustments.
  • +
  • Sort — the field, with an arrow to reverse the direction. The right-hand count tells you how many photos survived the filters.
  • +
+

Filters combine: Pick + 4★ + Edited is a valid view. They are view state, not a change to the photos, and clearing a filter restores the full grid instantly.

+ +
+ The library filtered to picked photos +
Figure 4. The same catalogue filtered to Picked: eight keepers from the 41-frame session. The count in the top bar and the grid agree; the filter chip stays lit so you can see why the view is short.
+
+ +

The grid and its cards

+
+ A single card close-up +
Figure 5. One card: the image is letterboxed inside a 3:2 tile, and the strip beneath carries the file name, metadata, rating and colour label.
+
+

Cards are laid out in rows that reflow with the window. Each one shows the photo oriented and cropped as it will be developed — a turned or straightened frame is turned in its thumbnail too, and preset previews follow the same crop.

+
    +
  • Badges — RAW for camera raw, ✓ for picked, ✕ for rejected, ✎ when the photo has adjustments.
  • +
  • Colour strip along the top edge shows the label colour.
  • +
  • Metadata line shows camera, and the size and dimensions appear on hover.
  • +
  • Rating is shown as stars under the file name.
  • +
+ +

Selecting

+

Click to select one photo. Shift-click extends from the last anchor; ⌘ / Ctrl-click toggles a single photo in or out. Drag on empty space to draw a rubber band — everything it touches is selected, and holding Shift adds to the existing selection. A plain click on empty space clears it.

+

With more than one photo selected, the selection bar becomes a batch editor: stars, pick and reject, colour labels, Export and Delete all apply to the whole selection at once.

+ +

The right-click menu

+
+ The context menu on a card +
Figure 6. The context menu carries the same actions as the keyboard, including the shortcut printed beside each item so the menu teaches the keys.
+
+

It includes the star row, pick and reject, the colour labels, Open in Develop, copy and paste, syncing settings, reset, virtual copies, compare, stacking, merging, export, print and Move to Trash. Right-clicking a photo inside a multi-selection acts on the whole selection.

+ +

Reordering and opening

+

Drag one card onto another to reorder the catalogue; dragging a selection moves all of it. Double-click, or select and press E, to open the photo in Develop.

+
+ + +
+
Chapter 5
+

Culling a shoot

+

Culling is a keyboard loop: look, rate, flag, advance. Everything below works on the selection, so a batch of forty frames can be rated in one keystroke.

+ + + + + + + + + + + + + + + + +
KeysAction
0 – 5Set the star rating, from none to five.
6 7 8 9Colour label: red, yellow, green, blue.
PFlag as picked. A second press keeps it picked, so it is safe to hold.
XFlag as rejected — the fastest way to clear the frames that missed.
URemove the flag.
← → ↑ ↓Move the selection through the grid, one photo or one row at a time.
Shift + arrowsExtend the selection as you move.
Home / EndFirst or last photo in the current view.
⌘ / Ctrl + ASelect every photo the filters are showing.
Delete / BackspaceDelete the selection, after confirmation.
EscClear the selection.
+ +

A practical pass

+
    +
  1. Open the event and set the rating filter to Unrated.
  2. +
  3. Press → to walk the shoot. On a keeper, press 3 or 4; on a miss, press X.
  4. +
  5. Switch the flag filter to Rejected and press ⌘ / Ctrl + A then Delete.
  6. +
  7. Filter to Picked. This is the batch you develop.
  8. +
+ +
+ Arrow navigation follows the rendered grid. Up and down move by whole rows, whatever the window width or card count, and the selection scrolls into view as it moves. +
+ +

The filmstrip in Develop uses the same order, so a cull pass done here translates directly into the order you step through while developing.

+
+ + +
+
Chapter 6
+

The Develop workspace

+

Develop is a single-photo surface with three rails. Each one can be ignored until you need it; the canvas keeps its size as panels open and close.

+ +
+ The Develop workspace +
Figure 7. Develop with a photo that has adjustments. Left: navigator and presets. Centre: canvas with the zoom controls. Right: histogram, then the Light and Presence panels. Bottom: filmstrip.
+
+ +

The top strip

+

From left to right: back to the library, the file name, the frame number in the filmstrip, the pixel dimensions, a clickable star row, pick and reject buttons, the colour labels, then Before / After, Crop, Copy, Paste, Reset, Delete and Export. Everything there also exists as a key.

+ +

The canvas

+

The photo is rendered by the WebGL pipeline, which applies crop, rotation, straighten, flips, tone, colour, grain, sharpening and noise reduction in a single pass. What you see is what the export writes.

+
    +
  • Zoom — use the wheel over the canvas. It zooms toward the cursor, so the detail you are pointing at stays put. Z toggles between fit and 100%.
  • +
  • Pan — drag with the mouse when zoomed in. Double-click also toggles the zoom level.
  • +
  • Before / after — hold \ to see the original, release to return. The top-bar button does the same without holding.
  • +
  • Zoom readout — the buttons at the bottom right show fit, 100% and the current percentage.
  • +
+ +

The left rail

+

Navigator shows the whole frame with the current crop applied, the file name, and whether the file is raw or a standard image. It is the quickest way to confirm a photo is turned the right way before you start.

+

Below it, Presets (chapter 11) and, when opened from the panel header, History.

+ +

The right rail

+
+ The right-hand panel column +
Figure 8. The right column. The histogram shows the three channels with the exposure metadata beneath it; panels below stack, collapse and remember their state.
+
+

A histogram sits at the top with ISO, aperture, shutter and focal length underneath. Panels follow: Light, Tone curve, Color mixer, Color grading, Effects, Detail and Info. Click a panel header to collapse or expand it; the chevron shows the state.

+ +

The filmstrip

+

Every photo in the current view, in order. Click to open one, or press ← and →. The wheel over the strip scrolls it sideways, and the active frame scrolls itself into view when you move through the shoot. Ratings, flags and colour labels are visible on each film, so you can see where you are in the cull.

+
+ + +
+
Chapter 7
+

Light and white balance

+

The Light panel is the first thing to set on any photo, and the only panel most photos need.

+ +

White balance

+

Temp moves the image between cool blue and warm amber; Tint between green and magenta. Both start at As shot, meaning the camera's recorded balance, and the As shot button in the panel header returns them there at any time without touching the tone controls.

+ +

Tone

+ + + + + + + + + + +
ControlRangeWhat it does
Exposure−5.00 … +5.00 EVOverall brightness in stops. The first move on an under- or over-exposed frame.
Contrast−100 … +100Separates or flattens the midtones, leaving the endpoints alone.
Highlights−100 … +100Pulls back bright skies and windows, or lifts them.
Shadows−100 … +100Opens dark areas, or deepens them for a moodier frame.
Whites−100 … +100Sets the white point; use it with the histogram rather than by eye.
Blacks−100 … +100Sets the black point and the depth of the shadows.
+

Auto analyses the photo's thumbnail and sets a starting tone curve in one click. It is a starting point, not a finish: adjust from there.

+ +

Presence

+ + + + + + + + + +
ControlWhat it does
TextureMedium-frequency detail — skin, fabric, foliage — without touching edges.
ClarityMidtone contrast. Small amounts add punch; large amounts look metallic.
DehazeCuts atmospheric haze and flattens or adds distance.
VibranceSaturation that protects already-saturated colours and skin tones.
SaturationUniform saturation across every colour.
+ +

Black and white

+

Tick Black & white mix to convert. A filter row appears — None, Yellow, Orange, Red, Green, Blue — with a strength slider. A filter darkens the colours it absorbs, so red drops a blue sky and green lifts foliage. The Color mixer below tunes individual hues on top of the conversion.

+ +
+ + +
+
Chapter 8
+

Colour

+

Three panels take over where the Light panel stops: a tone curve for precise contrast, a mixer for individual hues, and colour grading for split-toning shadows and highlights.

+ +

Tone curve

+

Four channels: RGB for luminance, then R, G and B for per-channel colour. Click on the curve to add a point and drag it; drag a point off the ends to remove it. Reset in the panel header returns the current channel to a straight line.

+

A gentle S — lift the highlights, drop the shadows — is the classic film contrast move. The per-channel curves are for casts that white balance cannot fix: lift the blue curve in the shadows to cool them without touching the midtones.

+ +

Color mixer

+

Eight hue ranges, from red through magenta. Pick a swatch, then adjust Hue, Saturation and Luminance for that range only. This is how you deepen a sky without changing the grass, or pull the orange out of skin while leaving a sunset alone.

+

Reset clears all three values for every band, not just the selected one.

+ +

Color grading

+

Two wheels, expressed as sliders: Shadows and Highlights, each with a Hue (0–360°) and an Amount. Balance shifts the crossover between them.

+

Teal shadows with warm highlights is the standard cinematic grade; a small amount goes a long way. Grading is applied after the tone curve, so it tints the final luminance rather than the source colours.

+
+ + +
+
Chapter 9
+

Effects and Detail

+

The last two panels are where a render starts to look like a photograph rather than a file: vignette and grain on one side, sharpening and noise reduction on the other.

+ +

Effects

+ + + + + + + + + + +
ControlWhat it does
Vignette — AmountDarkens (negative) or lightens (positive) the edges of the crop.
Vignette — MidpointHow far from the centre the falloff begins.
Vignette — FeatherHow soft the transition is. Low feather draws a visible ring.
Grain — AmountStrength of the film grain.
Grain — SizeGrain cell size. Because it is resolution-independent, size is judged at 100%, not on the fitted preview.
Grain — RoughnessFrom smooth, even clumping to coarse, irregular structure.
+

Under the grain sliders is a 100% patch: a small window of the real crop rendered at actual pixels, and it is the only honest way to judge grain size before exporting. Drag the crop and the patch samples that part of the photo, so what you check is what you framed.

+ +

Detail

+ + + + + + + + + +
ControlWhat it does
Sharpen — AmountEdge contrast. Most photographs need a small amount after any resize.
Sharpen — RadiusThe width of the edge being sharpened, in pixels.
Sharpen — DetailHow much fine structure is included; lower values protect smooth areas.
Noise reduction — LuminanceSmooths luminance noise, at the cost of fine detail if pushed.
Noise reduction — DetailHow much texture is preserved while noise is reduced.
+ +
+ Judge sharpening and noise at 100%. Both are pixel-level operations; a fitted preview hides exactly the artefacts you are trying to control. Press Z and pan, then press it again to return to fit. +
+
+ + +
+
Chapter 10
+

Crop and straighten

+

Crop mode overlays the frame with a rule-of-thirds grid, eight handles and a 100% loupe, and every change is visible in the navigator, the filmstrip and the preset thumbnails as you make it.

+ +
+ Crop mode with the crop rectangle and loupe +
Figure 9. Crop mode with a 5 × 4 crop and a 1.2° straighten on a real portrait. The crop panel shows the aspect presets and angle, and the hint bar at the bottom lists the keys.
+
+ +

Entering and leaving

+

Press C or use the Crop button in the top strip. Enter applies the crop and leaves crop mode; Esc cancels it. The hint bar at the bottom of the canvas always shows the current keys.

+ +

Shaping the crop

+
    +
  • Drag a corner or edge handle to resize; drag inside the rectangle to move it.
  • +
  • Aspect presets — Original, Free, 1×1, 4×5, 5×4, 4×3, 3×2, 16×9, 2×1, 9×16. Choosing one constrains the rectangle; Free releases it.
  • +
  • ⟲ 90° and ⟳ 90° turn the frame in quarter steps. Thumbnails, the navigator and preset previews turn with it.
  • +
  • Angle straightens the horizon, from −45° to +45° in 0.1° steps. The crop rectangle stays inside the rotated frame, so straightening never samples outside the image.
  • +
  • Flip H and Flip V mirror the exported file. Mirror view mirrors only the preview, for checking a composition without changing the output.
  • +
  • Reset crop returns to the full frame with no rotation or flips.
  • +
+ +
+ The crop loupe at 100% +
Figure 10. The loupe has been dragged toward the lower-right of the crop and shows real pixels at 100%, so you can place the crop against detail that the fitted view cannot show.
+
+ +

What the crop affects

+

The crop is part of the photo's edit, not a separate export step. It changes the navigator, the filmstrip thumb, the grid thumbnail, every preset tile and the exported dimensions. Grain size is measured in output pixels, so cropping tighter makes existing grain appear larger in the final file — check the 100% patch in the Effects panel after a big crop.

+
+ + +
+
Chapter 11
+

Presets

+

Presets are starting points that render on your photo before you commit to one: every tile in the rail is the actual frame, with the current crop applied.

+ +
+ The preset rail +
Figure 11. The preset rail, grouped by family, with the film variant row above it. The navigator and file details sit above the rail.
+
+ +

Groups and variants

+

Presets are grouped — Essentials, Film, Warm, Cinematic and the rest of the catalogue. The row above the tiles switches the whole rail between variants:

+
    +
  • Stock — the preset as designed.
  • +
  • Push +1 / Pull −1 — a stop brighter or darker, with the contrast shift that goes with it.
  • +
  • Warm split / Cool split — the same look with the shadows and highlights graded in opposite directions.
  • +
+ +

Applying and saving

+

Click a tile to apply it. A preset replaces the develop parameters — crop and rotation are left alone, because they belong to the frame, not the look. After applying, the sliders show the preset's values and can be adjusted further; the History panel records it as one step.

+

To save your own, adjust a photo and press + in the Presets header. Give it a name and it appears in the rail, rendering its own preview. User presets are stored with the rest of the catalogue.

+ +
+ Previews are rendered, not cached bitmaps. Each tile is the current photo through that preset, at the current crop, so choosing between looks is a comparison of your frame rather than of a stock image. +
+
+ + +
+
Chapter 12
+

History, copy and paste

+

Three ways to reuse work: step backwards through a photo's edits, copy a look to another photo, or start again from zero.

+ +

History

+

Every adjustment is recorded with a label and a timestamp. Open History from the left rail and click any entry to restore the photo to that exact state — the sliders follow. ⌘ / Ctrl + Z steps back one entry at a time.

+

History is per photo and belongs to that photo's session. Switching photos does not lose it, and it is saved with the catalogue.

+ +

Copy and paste settings

+

With a developed photo open, press ⌘ / Ctrl + C — or Copy in the top strip. Select another photo, in Develop or in the library, and press ⌘ / Ctrl + V. The full develop state is pasted: white balance, tone, colour, effects, detail and crop.

+

This is the fastest way to match a series shot under the same light: develop one frame properly, copy it, then select the rest in the grid and paste once.

+ +

Reset

+

Reset in the top strip, or Reset adjustments in the context menu, returns the photo to a neutral develop state. The original file is untouched and the reset itself is a history step, so it can be undone.

+ +
+ Paste is the batch tool. Select forty photos in the library, paste once, and all forty receive the copied settings — including the crop, which is why matching a series is a two-step job rather than forty. +
+
+ + +
+
Chapter 13
+

Exporting

+

Export writes new files. Nothing about the catalogue, the original or the edit changes; the dialog is a description of the file you want next to the file you have.

+ +
+ The export dialog +
Figure 12. The export dialog over Develop. The patches under the sample show the chosen output at half, full and double size, each at 100%, so grain and sharpening can be judged at the size that matters.
+
+ +

The options

+ + + + + + + + + +
OptionWhat it does
FormatJPEG, PNG or WebP. JPEG and WebP expose a quality slider from 40 to 100; PNG is lossless and shows no quality control.
ResizeFull resolution, Long edge in pixels, or Percent of the cropped size.
QualityEncoder quality for the lossy formats. 90–95 is visually lossless for most photographs.
File nameA template with the tokens {name}, {date}, {time} and {index}. The first resulting file name is shown underneath as you type.
SummaryThe number of photos in the batch and the output dimensions of the sample.
+ +

Judging the output

+

The sample thumbnail is a rendered preview of the crop. Click anywhere on it to move the 100% patches to that point of the photo — the patches are three views of the same detail at half the chosen size, the chosen size and double it, each rendered on its own pixel grid, with the grain cell size for that output printed underneath. This is how you decide whether grain will survive a downscale, or whether a sharpen amount is too high for the delivery size.

+ +

Running it

+

Press Export and the files are written one after another with a progress bar. Each file is downloaded by the browser; allow multiple downloads if your browser asks. When the batch finishes the dialog closes and a confirmation appears.

+

Everything you see on the canvas is baked into the file: crop, rotation, straighten, flips, white balance, tone curve, colour mixer, grading, vignette, grain, sharpening and noise reduction. There is no sidecar and no second step.

+ +
+ Exports reflect the crop. The dimensions in the summary are the cropped dimensions, so a tight 2×1 crop of a 6000-pixel frame produces a 3000-pixel wide file at full resolution. Check the summary before a large batch. +
+
+ + +
+
Chapter 14
+

Keyboard reference

+

The full map. Press ? at any time to see the same sheet inside the application.

+ +
+ The in-app shortcut sheet +
Figure 13. The shortcut sheet, grouped by where the keys apply. It closes with Esc or a click outside, and it is the reference the application ships with.
+
+ +

Library

+ + + + + + + + + + + + + + + + + + +
KeysAction
GGo to the library.
E / double-clickOpen the selected photo in Develop.
← → ↑ ↓Move the selection.
Shift + arrowsExtend the selection.
Home / EndFirst or last photo.
⌘ / Ctrl + ASelect all shown.
EscClear the selection.
0 – 5Star rating.
6 – 9Colour label: red, yellow, green, blue.
P / X / UPick · reject · unflag.
Delete / BackspaceDelete the selection.
⌘ / Ctrl + C / VCopy · paste develop settings.
⌘ / Ctrl + I / EImport · export.
?Shortcut sheet.
+ +

Develop

+ + + + + + + + + + + + + + +
KeysAction
CCrop mode on or off.
EnterApply the crop.
EscLeave crop mode, or return to the library.
ZFit ↔ 100%.
\ (hold)Before / after.
← →Previous · next photo.
Wheel · dragZoom at the cursor · pan.
⌘ / Ctrl + ZUndo the last adjustment.
⌘ / Ctrl + C / VCopy · paste settings.
?Shortcut sheet.
+ +

Mouse

+ + + + + + + + + + +
GestureAction
Click · Shift-click · ⌘/Ctrl-clickSelect · extend · toggle.
Drag on empty gridRubber-band select; Shift adds.
Right-click a cardContext menu for the selection.
Drag a card onto anotherReorder the catalogue.
Drag files onto the windowImport them.
Wheel over the filmstripScroll the strip sideways.
+ +

Dialogs

+

Esc closes the import, export and team-server dialogs without touching the photo behind them. Clicking the darkened area outside a dialog closes it too, as does the ✕ in its header. While a dialog is open the library and Develop shortcuts are suspended, so a stray X cannot reject a photo you cannot see.

+
+ + +
+
Chapter 15
+

The team server

+

Everything in this guide works without a server. The server adds three things: shared storage, raw decoding, and an account so a team can work from the same catalogue.

+ +

Starting it

+

Run npm run server — or npm start, which serves the built interface from the same process. With Docker, docker compose up starts the same service and mounts server/data as a volume.

+ +

Signing in

+

Click Sign in in the top bar. On a fresh server the Create admin tab is shown: the first account becomes the owner, and the invite code set in LUMINARY_INVITE is what everyone else uses to join. If no server is reachable, the dialog says so and explains how to start one; the local library keeps working exactly as before.

+ +

What the server does

+
    +
  • Stores originals in server/data, alongside thumbnails and photo records, so the catalogue survives a browser reset and can be opened from another machine.
  • +
  • Decodes raws with LibRaw. The dialog reports whether the raw engine is available; when it is, raw files are demosaiced server-side and returned as editable proxies.
  • +
  • Reports capacity: photos on the server, storage used, raw engine state and server version, all visible once signed in.
  • +
+ +

Syncing

+

Sync library pushes local records and pulls anything the server has that this browser does not. Ratings, flags, colour labels and develop settings travel with the record, so a cull done on a laptop is visible on a desktop.

+ +
+ Local mode is not a degraded mode. Without a server the app is a complete single-machine editor; the server is about sharing and raw decoding, not about features being switched off. +
+
+ + +
+
Chapter 16
+

Troubleshooting and limits

+

The problems that come up in practice, and the things this application deliberately does not do yet.

+ +

Common problems

+ + + + + + + + + + +
SymptomCause and fix
Raw files will not importRaws need the server. Start it, sign in, and the staged batch decodes; the import dialog offers the sign-in button directly.
The canvas is black or blankWebGL 2 is unavailable or the GPU context was lost. Turn on hardware acceleration and reload.
Export downloads nothingThe browser blocked multiple downloads. Allow them for this site and run the export again.
Thumbnails stay greyThe bitmap for that photo has not been decoded yet, or it is a raw whose proxy never synced. Re-import or sync.
Storage quota errorsThe browser storage is full. Delete rejected photos, or move the catalogue to the team server.
A photo looks different after reloadEdits are stored as parameters; the preview is re-rendered from the original. If the original changed, the render changes with it.
+ +

Current limits

+
    +
  • No local masks. There are no brushes, graduated or radial filters, and no subject or sky selection. Adjustments are global to the crop.
  • +
  • No print module and no soft proofing. Delivery is a file export.
  • +
  • No tethered capture. Files are imported after the fact.
  • +
  • No plugin or sidecar ecosystem. Edits live in the catalogue record, not in XMP files next to the original.
  • +
  • Undo is linear. ⌘ / Ctrl + Z steps back; there is no separate redo stack. Use History to jump forward again.
  • +
  • Colour management is sRGB. Exports are tagged for standard displays and are not converted to a print profile.
  • +
+ +
+ If something looks wrong, press ? and compare. The shortcut sheet is generated from the same map the keyboard uses, so if a key is listed there it is live. +
+ +
Luminary User Guide · Version 1.0 · Screenshots captured from the running application at 1600 × 1000.
+
+ + +
+
Appendix A
+

Formats and badges

+ +

Import formats

+ + + + + + + + + + +
FormatDecoded by
JPEG (.jpg, .jpeg)Browser
PNG (.png)Browser
WebP (.webp)Browser
AVIF (.avif)Browser
TIFF (.tif, .tiff)Browser
Camera raw: CR2, CR3, CRW, NEF, NRW, ARW, SRF, SR2, ORF, RW2, RWL, RAF, PEF, DNG, SRW, 3FR, FFF, IIQ, X3F, ERF, K25, KDC, DCR, MOS, MRW, MEFTeam server (LibRaw)
+ +

Export formats

+

JPEG, PNG and WebP, at full resolution, a long-edge size, or a percentage of the cropped frame. Output dimensions always reflect the crop and any rotation.

+ +

Badges on a card

+ + + + + + + + + +
BadgeMeaning
RAWCamera raw. The tooltip says whether it is a demosaiced proxy or an embedded preview.
✓Picked.
✕Rejected. The card is dimmed.
✎The photo has develop adjustments.
Colour stripThe colour label, along the top edge of the card.
+ +

Files the server writes

+

Originals, thumbnails and the catalogue records live under server/data. Back that directory up and you have backed up the shared library; the browser copy is a cache of the same records plus the local-only photos.

+ +
End of guide.
+
+ + + diff --git a/docs/user-guide/img/01-library.jpg b/docs/user-guide/img/01-library.jpg new file mode 100644 index 0000000..85b1336 Binary files /dev/null and b/docs/user-guide/img/01-library.jpg differ diff --git a/docs/user-guide/img/02-filters.jpg b/docs/user-guide/img/02-filters.jpg new file mode 100644 index 0000000..ead9699 Binary files /dev/null and b/docs/user-guide/img/02-filters.jpg differ diff --git a/docs/user-guide/img/03-card.jpg b/docs/user-guide/img/03-card.jpg new file mode 100644 index 0000000..1953ece Binary files /dev/null and b/docs/user-guide/img/03-card.jpg differ diff --git a/docs/user-guide/img/04-context-menu.jpg b/docs/user-guide/img/04-context-menu.jpg new file mode 100644 index 0000000..0dd85c1 Binary files /dev/null and b/docs/user-guide/img/04-context-menu.jpg differ diff --git a/docs/user-guide/img/05-develop.jpg b/docs/user-guide/img/05-develop.jpg new file mode 100644 index 0000000..e95198c Binary files /dev/null and b/docs/user-guide/img/05-develop.jpg differ diff --git a/docs/user-guide/img/06-crop.jpg b/docs/user-guide/img/06-crop.jpg new file mode 100644 index 0000000..0dc3dd1 Binary files /dev/null and b/docs/user-guide/img/06-crop.jpg differ diff --git a/docs/user-guide/img/07-panels.jpg b/docs/user-guide/img/07-panels.jpg new file mode 100644 index 0000000..2f5bd83 Binary files /dev/null and b/docs/user-guide/img/07-panels.jpg differ diff --git a/docs/user-guide/img/08-presets.jpg b/docs/user-guide/img/08-presets.jpg new file mode 100644 index 0000000..50a6ece Binary files /dev/null and b/docs/user-guide/img/08-presets.jpg differ diff --git a/docs/user-guide/img/09-export.jpg b/docs/user-guide/img/09-export.jpg new file mode 100644 index 0000000..d889db9 Binary files /dev/null and b/docs/user-guide/img/09-export.jpg differ diff --git a/docs/user-guide/img/10-import.jpg b/docs/user-guide/img/10-import.jpg new file mode 100644 index 0000000..031ef1c Binary files /dev/null and b/docs/user-guide/img/10-import.jpg differ diff --git a/docs/user-guide/img/11-shortcuts.jpg b/docs/user-guide/img/11-shortcuts.jpg new file mode 100644 index 0000000..d82c3af Binary files /dev/null and b/docs/user-guide/img/11-shortcuts.jpg differ diff --git a/docs/user-guide/img/12-crop-detail.jpg b/docs/user-guide/img/12-crop-detail.jpg new file mode 100644 index 0000000..56ef95c Binary files /dev/null and b/docs/user-guide/img/12-crop-detail.jpg differ diff --git a/docs/user-guide/img/13-filtered.jpg b/docs/user-guide/img/13-filtered.jpg new file mode 100644 index 0000000..37da397 Binary files /dev/null and b/docs/user-guide/img/13-filtered.jpg differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..04471ae --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + + Luminary + + +
+ + + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..aec1631 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2856 @@ +{ + "name": "luminary", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "luminary", + "version": "1.0.0", + "dependencies": { + "@neoanaloglabkk/lensfun-wasm": "^0.1.3", + "exifr": "^7.1.3", + "libraw-wasm": "^1.6.0", + "nodemailer": "^7.0.13", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "sharp": "^0.35.5" + }, + "devDependencies": { + "@types/react": "^18.3.12", + "@types/react-dom": "^18.3.1", + "@vitejs/plugin-react": "^4.3.4", + "typescript": "^5.6.3", + "vite": "^5.4.11", + "vitest": "^2.1.9" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.13", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.13.tgz", + "integrity": "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.13", + "@babel/helper-compilation-targets": "^7.29.13", + "@babel/helper-module-transforms": "^7.29.13", + "@babel/helpers": "^7.29.13", + "@babel/parser": "^7.29.13", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.13", + "@babel/types": "^7.29.11", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.15.tgz", + "integrity": "sha512-gNWJUX0FlevflramOkaInywOMhU1lkln38gAC7TFZv2tsWbLYbN/2WZFGcq8zbX0Z55e4vGa27IB/NaeZoauWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.15", + "@babel/types": "^7.29.15", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.29.13", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.13.tgz", + "integrity": "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.29.14", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.14.tgz", + "integrity": "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.14" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", + "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.15.tgz", + "integrity": "sha512-C2FuapQ2Kh1OnVHAoLi5rD3GBJ8COb9Q609T6HEpLqaBAo560PDP5OxBE5dCI/h951MBO/+bCUYU5SZ+8ZlV+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.15.tgz", + "integrity": "sha512-l+ezV2czw3t2d2ELq+3CwPL4WLKK5O8IywBXb9/gpmbCOVZFmRYJPmHVqSCv2k+8iKbE30Zf54siOoIZ52XOxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.15" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.15.tgz", + "integrity": "sha512-RpKWyisHoP81twtSCgmE02iU0RnPcq1DN5bBEbpUePrjA9Q3wXhufnCJrrayPpoZieqFh3zyZQqwtSK0gGccRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.15" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz", + "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz", + "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.15.tgz", + "integrity": "sha512-ZfawBo2i8vvt+BTt37dWDKBPjUfm/H+bw+ltwsCRhW7gPtyNVwUXuNo54eO2Xo+P4VXpalPFfFISbBTRKC8SOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.15", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.15", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.15", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.15.tgz", + "integrity": "sha512-/XKpKDakL//LZ66bq1XsZOswuqeI5MZqPLDu18o3XdkU1fNJ7bdPtzgnc4ZNS+bBGHV0FJG8jjb8SwcC3nNVQQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.15", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz", + "integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@img/colour": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", + "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.5.tgz", + "integrity": "sha512-QRUlFQ0WxvdWyqqG/WtI3iupfD5rBzmCHXSdPsY91sAtVtTo7Q4cb6zOccZ3gqEqkr0f1As1ehLqmEpDsRf+lg==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.3.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.5.tgz", + "integrity": "sha512-+BR255RhDlpygUpOc/Jdt1nT6DQ3XG/ERo5wbcdOf5Q320dKtPCKPLR1LJs9VGXRaMa8l1uUa0tkCNOXiAxZUw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.3.4" + } + }, + "node_modules/@img/sharp-freebsd-wasm32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.5.tgz", + "integrity": "sha512-Y/z91nEZ4uIBX5X3nfTovjU9lHNKFYbL2lpHCLVNmXQK03VIZvXBBt0KxbPGp2SdGSF+2mQU4e+hQaWOt86iAw==", + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "dependencies": { + "@img/sharp-wasm32": "0.35.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.4.tgz", + "integrity": "sha512-5R89nBYiRdUlSWJxPhO+GVtaXzXSxKnRu/xqMn3KTA3L9EB9Oy/P+Nn2f2vlhPuUdy/Zusb2DarbyTpGCfEDuw==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.4.tgz", + "integrity": "sha512-iR2OKH80yi0U+dUplyh3/xdpFvps6YkCwsXenIJxqxR1v9o+xtKTGbS9H7cps+2Vxjc8B1j96p75NmTGjIhtpQ==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.4.tgz", + "integrity": "sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw==", + "cpu": [ + "arm" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.4.tgz", + "integrity": "sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.4.tgz", + "integrity": "sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ==", + "cpu": [ + "ppc64" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.4.tgz", + "integrity": "sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q==", + "cpu": [ + "riscv64" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.4.tgz", + "integrity": "sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ==", + "cpu": [ + "s390x" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.4.tgz", + "integrity": "sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.4.tgz", + "integrity": "sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.4.tgz", + "integrity": "sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.5.tgz", + "integrity": "sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ==", + "cpu": [ + "arm" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.5.tgz", + "integrity": "sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.5.tgz", + "integrity": "sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA==", + "cpu": [ + "ppc64" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.5.tgz", + "integrity": "sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ==", + "cpu": [ + "riscv64" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.5.tgz", + "integrity": "sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA==", + "cpu": [ + "s390x" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.5.tgz", + "integrity": "sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.3.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.5.tgz", + "integrity": "sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.3.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.5.tgz", + "integrity": "sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.3.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.5.tgz", + "integrity": "sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ==", + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.11.3" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-webcontainers-wasm32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.5.tgz", + "integrity": "sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA==", + "cpu": [ + "wasm32" + ], + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@img/sharp-wasm32": "0.35.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.5.tgz", + "integrity": "sha512-X4t7g+7ZA5DKblCBEXGjUqqemj4vczING/5viFwAL8h4N3qYeyjwdCvRLHi4EdOUI+2Z7UFlp1VM+p/AuEtm6Q==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.5.tgz", + "integrity": "sha512-5Zm82LoBc43nhwNybZlG7Y1KO//Zhsn306fQl29ZOuStHLGTo3BWL83q3cznX0poxSAMuYL1On/BHBxkBeKr6A==", + "cpu": [ + "ia32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.5.tgz", + "integrity": "sha512-x76eH0vEiHlcMQu8Y8IenntaACtddpT6W0wmXtWrnKcnKI7ME5DdgqhAD6SEWOEl1v2zDvkZDhFA9KnURwpfqg==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.3.tgz", + "integrity": "sha512-lhTtjtoEArWBjismtfS761S9Hlyn+nIZqOZVYoZ1Xn82PMNMVnk+jj/NhC4fAXGTs7ydONcJiR5vyQBTMDu27g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@neoanaloglabkk/lensfun-wasm": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@neoanaloglabkk/lensfun-wasm/-/lensfun-wasm-0.1.3.tgz", + "integrity": "sha512-+Me+P4kqr2CgJ7Tg+VatLSTfWxJkBt/xE9kG0qxD3KCcVY4MVgm/kkMwiVWTJt4EgzdIi3mFwUGO7HEuyziBpw==", + "license": "LGPL-3.0-or-later" + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.27", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", + "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.68.7.tgz", + "integrity": "sha512-ZL7MgOeMUiBum1bjzzyBotE3DuHVz+UUxcDVlLL7gpdhDM4RpjG4bZOIly7ensIcXw9jhWl7HTIIQ9KsgjykGQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.68.7.tgz", + "integrity": "sha512-cKZ2Hz/xt5DLY/vdUmMXEn3gnjLgwdeB/npHagbdTljLvBE6b/xKcPCcRWTiT0pHeVf8akl5Cb9K7ylRxbtHng==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-x64": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-x64/-/rollup-android-x64-4.68.7.tgz", + "integrity": "sha512-P9vs1uCC2drepKKuiXrhY+r7ry/jtDCrBS8SUCYm2Rr7rVTR9eFH6XVAmD9TdfYFlDgRe5r1eH8tLQVuz+l/VA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.68.7.tgz", + "integrity": "sha512-Lgu2AV7jbOTNNhkQ/OurNm7Snqu1Ux/3y7k8q47fbpPa3q63aIzKKp1xFzax5KH4pcdUzbnX/riuFsxKflsF+g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.68.7.tgz", + "integrity": "sha512-wKo6rOzla+/3rN8QBqTgcrsQMfyqwa3y14TvCTotLLib/ACWTxX1zWDTYze90s2RWtYiSfTlavHLmZv0Jsafrw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.68.7.tgz", + "integrity": "sha512-vAeCwbFyEu/vBt9O/uHCHJSvwtOpTSssnM/PoZgn8rmvAkS+9ixaUfJZ2IP3ltom+rvpuQQEIEqltPY7qhC9lQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.68.7.tgz", + "integrity": "sha512-HvjSxOKI+6Si4ytmaoCEpjwDMrH/1s0uWeTAhdE5oXY8/RMI92hCePI/psZuJtY5EHWoT7MfyvTz0HBDZb1ZwQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.68.7.tgz", + "integrity": "sha512-nz/Eu1sag3w5gPiKLJhAbKa4D9hUUJpDc9XzKXxGNHZqwgT2AbuVS2e4k9CIoLQp5dPhSN9ntiEVuz2jTzu1Gg==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.68.7.tgz", + "integrity": "sha512-05CEv2G/kI261A1WQBZL8gx6xXULjPfVnTKAkfnV/0uqHeLo+dNEOeUzMaiK/HDGR0Z1Nn7KJjm/34bNbNcfTA==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.68.7.tgz", + "integrity": "sha512-wrqk3EkxQt98lTdiYhjcaWmFHwvKiSgHFi7XmPTSF4X8+uGUTBOAc0CaynEvpUhBgkPRbwASrYoU/5uJPF+LFA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.68.7.tgz", + "integrity": "sha512-DnuEUWvzeSxHxzu5lvrN+I/UzrcQkR/fQ4Bibetdp73Rf7aP0XgFpalSDuHmVWsCLETE+Lrl3GVOqIvFP7rcjw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.68.7.tgz", + "integrity": "sha512-n0sr2s+rzVw8ntRucOxGhWeJ9lEl9KxCRzF3RmnZLE/tRnfKiloLuK8UqWrKFqVigEAh0IkRkPz5LVaV9/ZfvA==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.68.7.tgz", + "integrity": "sha512-qDVJyMCbh7ekjt1kM9CZsyCFZvv5UW1QTIx3YfJ/gh8LkqpoPNpl9dCeYeOa+bsDOGTWZiMG2riXuoFSRISimQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.68.7.tgz", + "integrity": "sha512-GiIOHHIzgpMoR5DT1pA1b9qMk5i0Ngg2FRj4D6XFSBC8e/axHuIdB7K/OBozO2RtCVAMnH1rXcuJrGScg+bvzA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.68.7.tgz", + "integrity": "sha512-B132V2fwDl7UGLhvK6s3Ay7eNQ4dmDSDgsBm/Wwbz+Wgnunz0le4R2wzDp6TL5ExMu3MC1auJIrVtk2gOyxbyw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.68.7.tgz", + "integrity": "sha512-3NueHQilbssjxgJMx9hXBV+U5keb3CBzmW5WhoBG3iSLFcmz9U2FVoG4MUYpZoZ+KSNMQPN2AA79dTxlEF0VxQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.68.7.tgz", + "integrity": "sha512-8XRwbf76oAF1zZzg6OT8EY3swvCptZnLmiqMgO5+STyhTZ9s7rXa+tY8jESZW9IDyKACcVBGqa/RACDaLzRVjQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.68.7.tgz", + "integrity": "sha512-pvqqfjNdxVLvmovH681K5cPIL9DXj5n1RROaa0vb9JrtHddiScLrkHPRKj5flTKHF1M7xvRy0SS2yTRIc2TO0Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.68.7.tgz", + "integrity": "sha512-rsTjTf5HAm6F4sI6uUfJf2pc+7AWBKxgc2RveGvwB2OvVa1GezSSCDD1rtXPuFhcg3itPv7iHgcZsq/RwWvJ4Q==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.68.7.tgz", + "integrity": "sha512-VNLvsYMD5+zLCi5SohwDdL8PpicC9PnArLwyMJXXUcAduzrM3k9aZT9XiHw+mn5dOWr3UEyfyqJbOvxwJ2fCWQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.68.7.tgz", + "integrity": "sha512-7aOjdahkwiECWWOmjAemPd21yeQ18TW59DUiLWttzolMe5tDwHyBhlOfmxRUHOQnepTNkZ2Qwp1T6LxFZ5v7yQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.68.7.tgz", + "integrity": "sha512-BnNkTwE4FMCAoz3UYiJ6D6Y3pGozYIYZ2W+onH64uhiTI2iwD3KOaNSlkuHYfupZVemls3YTlvbPnuKwHsraiQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.68.7.tgz", + "integrity": "sha512-OH8tGWsJcRW6Vn0dmndyWJGdQa46bH2/2/PVfleBGUWuBd5/HVkIvw2UslgBwUZdtV78bJaoCNBmYI5+bcTJ4A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.68.7.tgz", + "integrity": "sha512-SpYx5X9+2JOF3hXe1cRaiFn562h4AMJhfgxkyHyiuh9dJ7PanPm7FTp8GJReSbS9N+TfjRiBbKacVk1g35kKxg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.68.7.tgz", + "integrity": "sha512-0ncKtQ55fqElV9Sk4cZ/4tiXVGlWxaH5PvDOlx1Sx8GuHIpSWgYrTcyrO51JnVFfy7LvAJiffkEg63ZHKwTMag==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.68.7.tgz", + "integrity": "sha512-XY9DYHO5UxxVR8G6AErXDlccQmDpvGTLgKHFpvkgsyjwG/PrQuInRjQQfpEzBRuT+bhBtwfS8yDe9sPhVcq/9A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/estree": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.10.tgz", + "integrity": "sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/prop-types": { + "version": "15.7.15", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", + "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "18.3.31", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.31.tgz", + "integrity": "sha512-vfEqpXTvwT91yhmwdfouStN2hSKwTvyRs8qpLfADyrq/kxDw0hZM7Wk9Ug1FELj8hIby+S/+kQCSRFF32nv2Qw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.3.7", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.7.tgz", + "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^18.0.0" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", + "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.28.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-beta.27", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.17.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + } + }, + "node_modules/@vitest/expect": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.9.tgz", + "integrity": "sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.9", + "@vitest/utils": "2.1.9", + "chai": "^5.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.9.tgz", + "integrity": "sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.9", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.12" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.9.tgz", + "integrity": "sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.9.tgz", + "integrity": "sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "2.1.9", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.9.tgz", + "integrity": "sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.9", + "magic-string": "^0.30.12", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.9.tgz", + "integrity": "sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^3.0.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.9.tgz", + "integrity": "sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.9", + "loupe": "^3.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.11.39", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.39.tgz", + "integrity": "sha512-Q9buOYhr2ggrEZpImICecZTJHCCd8yXkRUokFlUEQ8uiD6oP82F4W4jWnhOHZYV+wlvrC51V7Wy0ULyWjil5Wg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/browserslist": { + "version": "4.29.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.6.tgz", + "integrity": "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.11.37", + "caniuse-lite": "^1.0.30001826", + "electron-to-chromium": "^1.5.486", + "node-releases": "^2.0.64", + "update-browserslist-db": "^1.4.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001826", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001826.tgz", + "integrity": "sha512-wTB+9tIbLro/BCXwLuNV1meHE4L9dS6dArMDwgYfNBPMYScqClHyGunhkCSDtHhe/69Xl0sHlKgBVZ+fNsYtWA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chai": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/check-error": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz", + "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/csstype": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.4.tgz", + "integrity": "sha512-PoKaoPzQapnEoqUSnHx1u6W6ku8CVEgKsnpmmzU3m1nwkidpPBQ8V/Zq2+bWNrsOKoKLwTGdbx6xF7BXP1zLVQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.492", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.492.tgz", + "integrity": "sha512-4uMs7omhajKiud0GqALLTazS/zyvHLTLmDWVTR+e6BnyJo5bSNrph/JoRWEFJJmY75ct9hCiSGsbFF9fLe5gDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/exifr": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/exifr/-/exifr-7.1.3.tgz", + "integrity": "sha512-g/aje2noHivrRSLbAUtBPWFbxKdKhgj/xr1vATDdUXPOFYJlQ62Ft0oy+72V6XLIpDJfHs6gXLbBLAolqOXYRw==", + "license": "MIT" + }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/libraw-wasm": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/libraw-wasm/-/libraw-wasm-1.6.0.tgz", + "integrity": "sha512-VfvWq2XGGkc07wexymRLn1H82j6smmC1LAbVl41vnW2Z5RrEPLN+YHi1Hmga2TbxxrY4rOjmTwHwSyTZmypE1g==", + "license": "ISC" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/loupe": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-releases": { + "version": "2.0.65", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.65.tgz", + "integrity": "sha512-PfvofsGQ+MiOQIPkX9fU8ELUWmy5zL74CdQaph/ismKszfFkfwXaw0cGiwbwym2hT9k5+mdyl8O5WQ1MD8EHmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/nodemailer": { + "version": "7.0.13", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-7.0.13.tgz", + "integrity": "sha512-PNDFSJdP+KFgdsG3ZzMXCgquO7I6McjY2vlqILjtJd0hy8wEvtugS9xKRF2NWlPNGxvLCXlTNIae4serI7dinw==", + "license": "MIT-0", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/postcss": { + "version": "8.5.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.33.tgz", + "integrity": "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, + "node_modules/react-refresh": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", + "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "4.68.7", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.68.7.tgz", + "integrity": "sha512-CxhzUIc+ocxPAWxHuff+PAluoW1otD6dHqqPK2h2Q38WA1VYk+3gizX6NEg5t2a8yNGQaiHM1R7V+qdwWuvp5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.10" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.68.7", + "@rollup/rollup-android-arm64": "4.68.7", + "@rollup/rollup-android-x64": "4.68.7", + "@rollup/rollup-darwin-arm64": "4.68.7", + "@rollup/rollup-darwin-x64": "4.68.7", + "@rollup/rollup-freebsd-arm64": "4.68.7", + "@rollup/rollup-freebsd-x64": "4.68.7", + "@rollup/rollup-linux-arm-gnueabihf": "4.68.7", + "@rollup/rollup-linux-arm-musleabihf": "4.68.7", + "@rollup/rollup-linux-arm64-gnu": "4.68.7", + "@rollup/rollup-linux-arm64-musl": "4.68.7", + "@rollup/rollup-linux-loong64-gnu": "4.68.7", + "@rollup/rollup-linux-loong64-musl": "4.68.7", + "@rollup/rollup-linux-ppc64-gnu": "4.68.7", + "@rollup/rollup-linux-ppc64-musl": "4.68.7", + "@rollup/rollup-linux-riscv64-gnu": "4.68.7", + "@rollup/rollup-linux-riscv64-musl": "4.68.7", + "@rollup/rollup-linux-s390x-gnu": "4.68.7", + "@rollup/rollup-linux-x64-gnu": "4.68.7", + "@rollup/rollup-linux-x64-musl": "4.68.7", + "@rollup/rollup-openbsd-x64": "4.68.7", + "@rollup/rollup-openharmony-arm64": "4.68.7", + "@rollup/rollup-win32-arm64-msvc": "4.68.7", + "@rollup/rollup-win32-ia32-msvc": "4.68.7", + "@rollup/rollup-win32-x64-gnu": "4.68.7", + "@rollup/rollup-win32-x64-msvc": "4.68.7", + "fsevents": "~2.3.2" + } + }, + "node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/semver": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.2.tgz", + "integrity": "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/sharp": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.5.tgz", + "integrity": "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g==", + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.1.0", + "detect-libc": "^2.1.2", + "semver": "^7.8.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.35.5", + "@img/sharp-darwin-x64": "0.35.5", + "@img/sharp-freebsd-wasm32": "0.35.5", + "@img/sharp-libvips-darwin-arm64": "1.3.4", + "@img/sharp-libvips-darwin-x64": "1.3.4", + "@img/sharp-libvips-linux-arm": "1.3.4", + "@img/sharp-libvips-linux-arm64": "1.3.4", + "@img/sharp-libvips-linux-ppc64": "1.3.4", + "@img/sharp-libvips-linux-riscv64": "1.3.4", + "@img/sharp-libvips-linux-s390x": "1.3.4", + "@img/sharp-libvips-linux-x64": "1.3.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.3.4", + "@img/sharp-libvips-linuxmusl-x64": "1.3.4", + "@img/sharp-linux-arm": "0.35.5", + "@img/sharp-linux-arm64": "0.35.5", + "@img/sharp-linux-ppc64": "0.35.5", + "@img/sharp-linux-riscv64": "0.35.5", + "@img/sharp-linux-s390x": "0.35.5", + "@img/sharp-linux-x64": "0.35.5", + "@img/sharp-linuxmusl-arm64": "0.35.5", + "@img/sharp-linuxmusl-x64": "0.35.5", + "@img/sharp-webcontainers-wasm32": "0.35.5", + "@img/sharp-win32-arm64": "0.35.5", + "@img/sharp-win32-ia32": "0.35.5", + "@img/sharp-win32-x64": "0.35.5" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/sharp/node_modules/semver": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/source-map-js": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.4.tgz", + "integrity": "sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinypool": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", + "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", + "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tslib": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz", + "integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==", + "license": "0BSD", + "optional": true + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.4.0.tgz", + "integrity": "sha512-WPJuOnjI9FWDct4fB+ej4Mz8opLaw5CDcZ2t44tFZ0vIQVYWzBhWR3mkixuUj/A7+vY4V9+ApOZ2YYLwdgq46w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/vite": { + "version": "5.4.21", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.9.tgz", + "integrity": "sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.7", + "es-module-lexer": "^1.5.4", + "pathe": "^1.1.2", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.9.tgz", + "integrity": "sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "2.1.9", + "@vitest/mocker": "2.1.9", + "@vitest/pretty-format": "^2.1.9", + "@vitest/runner": "2.1.9", + "@vitest/snapshot": "2.1.9", + "@vitest/spy": "2.1.9", + "@vitest/utils": "2.1.9", + "chai": "^5.1.2", + "debug": "^4.3.7", + "expect-type": "^1.1.0", + "magic-string": "^0.30.12", + "pathe": "^1.1.2", + "std-env": "^3.8.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.1", + "tinypool": "^1.0.1", + "tinyrainbow": "^1.2.0", + "vite": "^5.0.0", + "vite-node": "2.1.9", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "2.1.9", + "@vitest/ui": "2.1.9", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..a4601a7 --- /dev/null +++ b/package.json @@ -0,0 +1,33 @@ +{ + "name": "luminary", + "private": true, + "version": "1.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "server": "node server/index.mjs", + "server:dev": "node --watch server/index.mjs", + "build": "tsc --noEmit && vite build", + "start": "node server/index.mjs", + "preview": "vite preview", + "typecheck": "tsc --noEmit", + "test": "vitest run" + }, + "dependencies": { + "@neoanaloglabkk/lensfun-wasm": "^0.1.3", + "exifr": "^7.1.3", + "libraw-wasm": "^1.6.0", + "nodemailer": "^7.0.13", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "sharp": "^0.35.5" + }, + "devDependencies": { + "@types/react": "^18.3.12", + "@types/react-dom": "^18.3.1", + "@vitejs/plugin-react": "^4.3.4", + "typescript": "^5.6.3", + "vite": "^5.4.11", + "vitest": "^2.1.9" + } +} diff --git a/public/lensfun/LICENSE b/public/lensfun/LICENSE new file mode 100644 index 0000000..2450f2c --- /dev/null +++ b/public/lensfun/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 lex + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/public/lensfun/NOTICE.md b/public/lensfun/NOTICE.md new file mode 100644 index 0000000..2facf08 --- /dev/null +++ b/public/lensfun/NOTICE.md @@ -0,0 +1,10 @@ +# Notices + +This project bundles and/or links the following third-party components: + +1. Lensfun library source code (`third_party/lensfun/libs`) under LGPL-3.0-or-later. +2. Lensfun camera/lens database (`third_party/lensfun/data/db`) under CC BY-SA 3.0. +3. tinyxml2 (`third_party/tinyxml2`) under zlib license. +4. utf8proc (`third_party/utf8proc`) under MIT license. + +Refer to `THIRD_PARTY_LICENSES.md` for license texts and links. diff --git a/public/lensfun/THIRD_PARTY_LICENSES.md b/public/lensfun/THIRD_PARTY_LICENSES.md new file mode 100644 index 0000000..4583239 --- /dev/null +++ b/public/lensfun/THIRD_PARTY_LICENSES.md @@ -0,0 +1,20 @@ +# Third-Party Licenses + +## Lensfun + +- Repository: https://github.com/lensfun/lensfun +- Library license: GNU LGPL v3.0 or later +- Database license: Creative Commons Attribution-ShareAlike 3.0 +- Copyright: Lensfun contributors + +## tinyxml2 + +- Repository: https://github.com/leethomason/tinyxml2 +- License: zlib +- Copyright: Lee Thomason + +## utf8proc + +- Repository: https://github.com/JuliaStrings/utf8proc +- License: MIT +- Copyright: utf8proc contributors diff --git a/public/lensfun/UPSTREAM.md b/public/lensfun/UPSTREAM.md new file mode 100644 index 0000000..801f79c --- /dev/null +++ b/public/lensfun/UPSTREAM.md @@ -0,0 +1,23 @@ +# Upstream Tracking + +## Source of truth + +- Upstream repo: https://github.com/lensfun/lensfun.git +- Integration mode: git submodule (`third_party/lensfun`) +- Current pinned commit: `655a9c4e3e53c25bc04843c853e7e7a0121359e7` +- Commit date: `2026-02-28` +- Commit subject: `Add tca data for Meike SL 35mm F1.8 STM PRO` + +## Update policy + +- Pin exact commits. +- Upgrade manually via PR. +- Run full build/test after each bump. + +## Update steps + +1. `scripts/sync-upstream.sh origin/master` +2. Review upstream diff impact (API, DB changes, compile behavior) +3. Rebuild wasm assets +4. Run tests +5. Update this file with new commit metadata diff --git a/public/lensfun/lensfun-core.data b/public/lensfun/lensfun-core.data new file mode 100644 index 0000000..305520d --- /dev/null +++ b/public/lensfun/lensfun-core.data @@ -0,0 +1,65868 @@ + + + + + Rollei 6x6 + Generic + + + + Mamiya 645 + Generic + + + + Mamiya + Mamiya 645 + Mamiya 645 + 0.577 + + + + Mamiya + Mamiya ZD + Mamiya 645 + 0.721 + + + + Phase One + IQ180 + Mamiya 645 + 0.644 + + + + Phase One + IQ140 + Mamiya 645 + 0.789 + + + + Phase One + P 25 + Mamiya 645 + 0.577 + + + + Rolleiflex + 2.8E + Rollei 6x6 + 0.510 + + + + Schneider + Schneider-Kreuznach + Schneider 28mm Digitar f/2.8 + 28mm Digitar f/2.8 + Mamiya 645 + 0.577 + 4:3 + + + + + + + Mamiya + Mamiya 35mm f/3.5 + Mamiya 645 + 0.577 + 4:3 + + + + + + + Mamiya + Mamiya 80mm f/2.8 + Mamiya 645 + 0.577 + 4:3 + + + + + + + Mamiya + Mamiya 55-110mm f/4.5 + Mamiya 645 + 0.577 + 4:3 + + + + + + + + + + + + + Mamiya + 35mm f/22.0-3.5 + Mamiya 35mm f/22.0-3.5 + Mamiya 645 + 0.644 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Mamiya + 120mm f/32.0-4.0 + Mamiya 120mm f/32.0-4.0 + Mamiya 645 + 0.644 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Mamiya + 150mm f/32.0-3.5 + Mamiya 150mm f/32.0-3.5 + Mamiya 645 + 0.644 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Schneider + Schneider-Kreuznach + Schneider 80mm Xenotar f/2.8 + 80mm Xenotar f/2.8 + Rollei 6x6 + 0.510 + 1:1 + + + + + + + Schneider + Schneider-Kreuznach + Schneider LS 55mm f/2.8 + LS 55mm f/2.8 + Mamiya 645 + 0.644 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Schneider + Schneider-Kreuznach + Schneider LS 80mm f/2.8 + LS 80mm f/2.8 + Mamiya 645 + 0.644 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Schneider + Schneider-Kreuznach + Schneider LS 110mm f/2.8 + LS 110mm f/2.8 + Mamiya 645 + 0.644 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GoPro + HD2 + goProHero + 6.4 + + + + GoPro + Hero3+ black + goProHero3+ + 5.42 + + + + GoPro + HERO4 Silver + goProHero4 + 7.66 + + + + GoPro + HERO4 Black + goProHero4black + 5 + + + + GoPro + HERO5 Black + goProHero4black + 5 + + + + GoPro + Hero10 black + goProHero10bl + 5.5 + + + + GoPro + Hero11 Black + goProHero11bl + 5.54 + + + + DJI + Phantom Vision FC200 + dijPhantomVisionFC200 + 6 + + + + DJI + Phantom 3 Pro FC300X + dijPhantom3ProFC300X + 5.5 + + + + + AEE DV + AEE + AEE DV + AEE MagiCam SD19 & compatibles + aeeDV + + 6 + + + + GitUp + Git2 + git2 + 5.57 + + + + DJI + Mavic Pro FC220 + djiMavicProFC220 + 5.64 + + + + DJI + FC6310 + djiFC6310 + 2.73 + + + + DJI + FC3411 + Air 2S + djiFC3411 + 2.73 + + + + Hasselblad + L1D-20c + DJI Mavic 2 Pro + l1d20c + 2.8 + + + + Hasselblad + L2D-20c + DJI Mavic 3 + l2d20c + 1.953 + + + + DJI + Mavic Air FC2103 + djiMavicAirFC2103 + 5.6 + + + + DJI + FC3582 + Mini 3 Pro + djiFC3582 + 3.6 + + + + DJI + FC6310R + Phantom 4 RTK + djiFC6310R + 2.73 + + + + + GoPro + HD2 & compatibles + fixed lens + festes Objektiv + goProHero + fisheye + 6.4 + 4:3 + + + + + + + GoPro + GoPro Hero3+ black & compatibles + fixed lens + festes Objektiv + goProHero3+ + 5.42 + 4:3 + + + + + + + GoPro + HERO4 + fixed lens + festes Objektiv + goProHero4 + equisolid + 7.66 + 4:3 + + + + + + + DJI + Phantom Vision FC200 & compatibles + fixed lens + festes Objektiv + dijPhantomVisionFC200 + equisolid + 6 + 4:3 + + + + + + + + AEE + AEE SD19 & compatibles + fixed lens + festes Objektiv + aeeDV + equisolid + + 6 + 4:3 + + + + + + + + + + DJI + Phantom 3 Pro + fixed lens + festes Objektiv + dijPhantom3ProFC300X + 5.5 + 4:3 + + + + + + + + GitUp + Git2 & compatibles + fixed lens + festes Objektiv + git2 + equisolid + 5.57 + 4:3 + + + + + + + + GoPro + HERO4 black + fixed lens + festes Objektiv + goProHero4black + stereographic + 5 + 4:3 + + + + + + + DJI + Mavic Pro FC220 & compatibles + fixed lens + festes Objektiv + djiMavicProFC220 + 5.64 + 4:3 + + + + + + + + + + DJI + FC6310 & compatibles + fixed lens + festes Objektiv + djiFC6310 + 2.73 + 16:9 + + + + + + + + Hasselblad + L1D-20c & compatibles + fixed lens + festes Objektiv + l1d20c + 2.8 + + + + + + + Hasselblad + L2D-20c & compatibles + fixed lens + festes Objektiv + l2d20c + 1.953 + 4:3 + + + + + + + DJI + FC2103 & compatibles + fixed lens + festes Objektiv + djiMavicAirFC2103 + 5.6 + + + + + + + + + + DJI + FC3411 & compatibles + FC3411 fixed lens + FC3411 festes Objektiv + djiFC3411 + 2.63 + 3:2 + + + + + + + + + + GoPro + HERO10 Black & compatibles + fixed lens + festes Objektiv + goProHero10bl + 5.5 + 4:3 + + + + + + + GoPro + HERO11 Black & compatibles + fixed lens + festes Objektiv + goProHero11bl + fisheye + 5.54 + 8:7 + + + + + + + DJI + FC3582 & compatibles + FC3582 fixed lens + djiFC3582 + 3.6 + 4:3 + + + + + + + + + + DJI + FC6310R & compatibles + FC6310R fixed lens + FC6310R festes Objektiv + djiFC6310R + 2.73 + 4:3 + + + + + + + DJI + DJI MFT 15mm F1.7 ASPH + + Micro 4/3 System + 2.0 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot Pro1 + PowerShot Pro1 + canonPro1 + 3.933 + + + + Canon + Canon PowerShot Pro70 + PowerShot Pro70 + canonPro70 + 5.47 + + + + Canon + Canon PowerShot G6 + PowerShot G6 + canonG3 + 4.843 + + + + Canon + Canon PowerShot G5 + PowerShot G5 + canonG3 + 4.843 + + + + Canon + Canon PowerShot G3 + PowerShot G3 + canonG3 + 4.843 + + + + Canon + Canon PowerShot G2 + PowerShot G2 + canonG2 + 4.843 + + + + Canon + Canon PowerShot G1 + PowerShot G1 + canonG1 + 4.843 + + + + Canon + Canon PowerShot G7 + PowerShot G7 + canonG7 + 4.843 + + + + Canon + Canon PowerShot G3 X + PowerShot G3 X (3:2) + canonG3X + 2.727 + + + + Canon + Canon PowerShot G5 X + PowerShot G5 X (3:2) + canonG7X + 2.72 + + + + Canon + Canon PowerShot G5 X 4:3 + PowerShot G5 X (4:3) + canonG7X + 2.94 + + + + Canon + Canon PowerShot G5 X 16:9 + PowerShot G5 X (16:9) + canonG7X + 2.85 + + + + Canon + Canon PowerShot G7 X + PowerShot G7 X (3:2) + canonG7X + 2.72 + + + + Canon + Canon PowerShot G7 X 4:3 + PowerShot G7 X (4:3) + canonG7X + 2.94 + + + + Canon + Canon PowerShot G7 X 16:9 + PowerShot G7 X (16:9) + canonG7X + 2.85 + + + + Canon + Canon PowerShot G7 X Mark II + PowerShot G7 X Mark II (3:2) + canonG7X + 2.72 + + + + Canon + Canon PowerShot G7 X Mark II 4:3 + PowerShot G7 X Mark II (4:3) + canonG7X + 2.94 + + + + Canon + Canon PowerShot G7 X Mark II 16:9 + PowerShot G7 X Mark II (16:9) + canonG7X + 2.85 + + + + Canon + Canon PowerShot G7 X Mark III + PowerShot G7 X Mark III (3:2) + canonG7X + 2.72 + + + + Canon + Canon PowerShot G9 + PowerShot G9 + canonG9 + 4.605 + + + + Canon + Canon PowerShot G9 X + PowerShot G9 X + canonG9X + 2.72 + + + + Canon + Canon PowerShot G9 X Mark II + PowerShot G9 X Mark II + canonG9X + 2.72 + + + + Canon + Canon PowerShot G10 + PowerShot G10 + canonG10 + 4.605 + + + + Canon + Canon PowerShot G11 + PowerShot G11 + canonG11 + 4.554 + + + + Canon + Canon PowerShot G12 + PowerShot G12 + canonG12 + 4.63 + + + + Canon + Canon PowerShot G1 X + PowerShot G1 X + canonG1X + 1.85 + + + + Canon + Canon PowerShot G1 X Mark II + PowerShot G1 X Mark II + canonG1X2 + 1.93 + + + + Canon + Canon PowerShot G1 X Mark III + PowerShot G1 X Mark III + canonG1X3 + 1.613 + + + + Canon + Canon PowerShot G5 X Mark II + PowerShot G5 X Mark II + canonG5X2 + 2.73 + + + + Canon + Canon PowerShot G15 + PowerShot G15 + canonG15 + 4.65 + + + + Canon + Canon PowerShot G16 + PowerShot G16 + canonG16 + 4.67 + + + + Canon + Canon PowerShot SD550 + PowerShot SD550 + canonSD500 + 4.8 + + + + Canon + Canon PowerShot SD950 IS + PowerShot SD950 IS + canonSD950 + 4.7 + + + + Canon + Canon DIGITAL IXUS 750 + IXUS 750 + canonSD500 + 4.8 + + + + Canon + IXY Digital 700 + canonSD500 + 4.8 + + + + Canon + Canon PowerShot SD500 + PowerShot SD500 + canonSD500 + 4.8 + + + + Canon + Canon DIGITAL IXUS 700 + IXUS 700 + canonSD500 + 4.8 + + + + Canon + IXY Digital 600 + canonSD500 + 4.8 + + + + Canon + Canon PowerShot SD450 + PowerShot SD450 + canonSD200 + 6.05 + + + + Canon + Canon DIGITAL IXUS 55 + IXUS 55 + canonSD200 + 6.05 + + + + Canon + Canon PowerShot SD400 + PowerShot SD400 + canonSD200 + 6.05 + + + + Canon + Canon IXY DIGITAL 55 + IXY 55 + canonSD200 + 6.05 + + + + Canon + Canon DIGITAL IXUS 50 + IXUS 50 + canonSD200 + 6.05 + + + + Canon + Canon DIGITAL IXUS 70 + IXUS 70 + canonSD200 + 6.05 + + + + Canon + Canon PowerShot SD300 + PowerShot SD300 + canonSD200 + 6.05 + + + + Canon + Canon IXY DIGITAL 50 + IXY 50 + canonSD200 + 6.05 + + + + Canon + Canon DIGITAL IXUS 40 + IXUS 40 + canonSD200 + 6.05 + + + + Canon + Canon PowerShot SD200 + PowerShot SD200 + canonSD200 + 6.05 + + + + Canon + Canon IXY DIGITAL 40 + IXY 40 + canonSD200 + 6.05 + + + + Canon + Canon DIGITAL IXUS 30 + IXUS 30 + canonSD200 + 6.05 + + + + Canon + Canon PowerShot S200 + PowerShot S200 + canonIxusII + 6.5 + + + + Canon + Canon DIGITAL IXUS v2 + IXUS v2 + canonIxusII + 6.5 + + + + Canon + Canon IXY DIGITAL 200a + IXY 200a + canonIxusII + 6.5 + + + + Canon + Canon PowerShot SD110 + PowerShot SD110 + canonIxusII + 6.5 + + + + Canon + Canon DIGITAL IXUS II + IXUS II + canonIxusII + 6.5 + + + + Canon + Canon IXY DIGITAL 30 + IXY 30 + canonIxusII + 6.5 + + + + Canon + Canon PowerShot SD100 + PowerShot SD100 + canonIxusII + 6.5 + + + + Canon + Canon DIGITAL IXUS i + IXUS i + canonIxusI + 6.144 + + + + Canon + Canon PowerShot SD10 + PowerShot SD10 + canonIxusI + 6.144 + + + + Canon + Canon PowerShot S500 + PowerShot S500 + canonIxus400 + 4.843 + + + + Canon + Canon DIGITAL IXUS 500 + IXUS 500 + canonIxus400 + 4.843 + + + + Canon + Canon IXY DIGITAL 500 + IXY 500 + canonIxus400 + 4.843 + + + + Canon + Canon PowerShot S410 + PowerShot S410 + canonIxus400 + 4.843 + + + + Canon + Canon DIGITAL IXUS 430 + IXUS 430 + canonIxus400 + 4.843 + + + + Canon + Canon IXY DIGITAL 450 + IXY 450 + canonIxus400 + 4.843 + + + + Canon + Canon PowerShot S400 + PowerShot S400 + canonIxus400 + 4.843 + + + + Canon + Canon DIGITAL IXUS 400 + IXUS 400 + canonIxus400 + 4.843 + + + + Canon + Canon IXY DIGITAL 400 + IXY 400 + canonIxus400 + 4.843 + + + + Canon + Canon PowerShot S80 + PowerShot S80 + canonS70 + 4.843 + + + + Canon + Canon PowerShot S70 + PowerShot S70 + canonS70 + 4.843 + + + + Canon + Canon PowerShot S60 + PowerShot S60 + canonS70 + 4.843 + + + + Canon + Canon PowerShot S50 + PowerShot S50 + canonS30 + 4.843 + + + + Canon + Canon PowerShot S45 + PowerShot S45 + canonS30 + 4.843 + + + + Canon + Canon PowerShot S40 + PowerShot S40 + canonS30 + 4.843 + + + + Canon + Canon PowerShot S30 + PowerShot S30 + canonS30 + 4.843 + + + + Canon + Canon PowerShot A1200 + PowerShot A1200 + canonA1200 + 5.61 + + + + Canon + Canon PowerShot A610 + PowerShot A610 + canonA610 + 4.8 + + + + Canon + Canon PowerShot A620 + PowerShot A620 + canonA610 + 4.8 + + + + Canon + Canon PowerShot A520 + PowerShot A520 + canonA510 + 6.05 + + + + Canon + Canon PowerShot A510 + PowerShot A510 + canonA510 + 6.05 + + + + Canon + Canon PowerShot A95 + PowerShot A95 + canonA80 + 4.85 + + + + Canon + Canon PowerShot A80 + PowerShot A80 + canonA80 + 4.85 + + + + Canon + Canon PowerShot A85 + PowerShot A85 + canonA70 + 6.500 + + + + Canon + Canon PowerShot A75 + PowerShot A75 + canonA70 + 6.500 + + + + Canon + Canon PowerShot A70 + PowerShot A70 + canonA70 + 6.500 + + + + Canon + Canon PowerShot A60 + PowerShot A60 + canonA70 + 6.500 + + + + Canon + Canon PowerShot A40 + PowerShot A40 + canonA70 + 6.500 + + + + Canon + Canon PowerShot A30 + PowerShot A30 + canonA70 + 6.500 + + + + Canon + Canon PowerShot A20 + PowerShot A20 + canonA70 + 6.500 + + + + Canon + Canon PowerShot A10 + PowerShot A10 + canonA70 + 6.500 + + + + Canon + Canon PowerShot S2 IS + PowerShot S2 IS + canonS2 + 6.0 + + + + Canon + Canon PowerShot S1 IS + PowerShot S1 IS + canonS1 + 6.56 + + + + Canon + Canon PowerShot S5 IS + PowerShot S5 IS + canonS5 + 6.0 + + + + Canon + Canon PowerShot Pro90 IS + PowerShot Pro90 IS + canonPro90 + 5.28 + + + + Canon + Canon DIGITAL IXUS 80 IS + IXUS 80 IS + canonIxus80IS + 6.02 + + + + Canon + Canon DIGITAL IXUS 95 IS + IXUS 95 IS + canonIxus80IS + 5.6 + + + + Canon + Canon PowerShot SX1 IS + PowerShot SX1 IS + canonSX1 + 5.5 + + + + Canon + Canon PowerShot S90 + PowerShot S90 + canonS90 + 4.67 + + + + Canon + Canon PowerShot A650 IS + PowerShot A650 IS + canonA650IS + 4.67712 + + + + Canon + Canon PowerShot SX150 IS + PowerShot SX150 IS + canonSX150IS + 5.62 + + + + Canon + Canon PowerShot SX10 IS + PowerShot SX10 IS + canonSX10IS + 5.6 + + + + Canon + Canon PowerShot SX130 IS + PowerShot SX130 IS + canonSX150IS + 5.62 + + + + Canon + Canon PowerShot SX220 HS + PowerShot SX220 HS + canonSX220HS + 5.6 + + + + Canon + Canon PowerShot SX230 HS + PowerShot SX230 HS + canonSX230HS + 5.6 + + + + Canon + Canon PowerShot A720 IS + PowerShot A720 IS + canonA720IS + 6.03 + + + + Canon + Canon PowerShot S120 + PowerShot S120 + canonS120 + 4.62 + + + + Canon + Canon PowerShot A640 + PowerShot A640 + canonA640 + 4.79 + + + + Canon + Canon PowerShot SX240 HS + PowerShot SX240 HS + canonSX260HS + 5.56 + + + + Canon + Canon PowerShot SX260 HS + PowerShot SX260 HS + canonSX260HS + 5.56 + + + + Canon + Canon IXUS 220 HS + IXUS 220 HS + canonIxus220HS + 5.58 + + + + Canon + Canon PowerShot S95 + PowerShot S95 + canonS95 + 4.67 + + + + Canon + Canon PowerShot S100 + PowerShot S100 + canonS100 + 4.62 + + + + Canon + Canon PowerShot A4000 IS + PowerShot A4000 IS + canonA4000IS + 5.6 + + + + Canon + Canon PowerShot ELPH 110 HS + PowerShot ELPH 110 HS + canonIxus125HS + 5.58 + + + + Canon + Canon IXUS 125 HS + IXUS 125 HS + canonIxus125HS + 5.58 + + + + Canon + Canon PowerShot SX510 HS + PowerShot SX510 HS + canonSX510HS + 5.58 + + + + Canon + Canon PowerShot S110 + PowerShot S110 + canonS110 + 4.62 + + + + Canon + Canon PowerShot SD1100 IS + PowerShot SD1100 IS + canonIxus80IS + 6.02 + + + + Canon + Canon PowerShot SX160 IS + PowerShot SX160 IS + canonSX160IS + 5.6 + + + + Canon + Canon PowerShot A495 + PowerShot A495 + canonA495 + 5.39 + + + + Canon + Canon PowerShot A490 + PowerShot A490 + canonA495 + 5.39 + + + + Canon + Canon PowerShot SX30 IS + PowerShot SX30 IS + canonSX30IS + 5.581 + + + + Canon + Canon PowerShot SX50 HS + PowerShot SX50 HS + canonSX50HS + 5.61 + + + + Canon + Canon PowerShot SX60 HS + PowerShot SX60 HS + canonSX60HS + 5.61 + + + + Canon + Canon PowerShot SX700 HS + PowerShot SX700 HS + canonSX710HS + 5.6 + + + + Canon + Canon PowerShot SX710 HS + PowerShot SX710 HS + canonSX710HS + 5.6 + + + + Canon + Canon IXY 220F + IXY 220F + canonIxy220F + 5.58 + + + + Canon + Canon PowerShot Pro1 & compatibles (Standard) + fixed lens + festes Objektiv + canonPro1 + 3.933 + 4:3 + + + + + + + + + + + Canon + Canon PowerShot G3 & compatibles (Standard) + fixed lens + festes Objektiv + canonG3 + 4.843 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot G3 & compatibles, with WC-DC58N + fixed lens, with WC-DC58N + festes Objektiv, mit WC-DC58N + canonG3 + 4.843 + 4:3 + + + + + + + + + + Canon + Canon PowerShot G2 & compatibles (Standard) + fixed lens + festes Objektiv + canonG2 + 4.843 + 4:3 + + + + + + + + + + + + + + + + + Canon + Canon PowerShot G2 & compatibles, with Geobartic 0.5x converter + fixed lens, with Geobartic 0.5× converter + festes Objektiv, mit Geobartic 0.5×-Konverter + canonG2 + 4.843 + 4:3 + + + + + + + + + + + Canon + Canon PowerShot G1 & compatibles (Standard) + fixed lens + festes Objektiv + canonG1 + 4.843 + 4:3 + + + + + + + + + + + + Canon + Canon PowerShot G12 & compatibles (Standard) + fixed lens + festes Objektiv + canonG12 + 4.63 + 4:3 + + + + + + + + + + + + + + Canon + Canon PowerShot G1X & compatibles (Standard) + fixed lens + festes Objektiv + canonG1X + 1.85 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot G15 & compatibles (Standard) + fixed lens + festes Objektiv + canonG15 + 4.65 + 4:3 + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot SD500 & compatibles (Standard) + fixed lens + festes Objektiv + canonSD500 + 4.8 + 4:3 + + + + + + + + + + + + + Canon + Canon PowerShot SD950 IS & compatibles (Standard) + fixed lens + festes Objektiv + canonSD950 + 4.7 + 4:3 + + + + + + + + + + + Canon + Canon PowerShot SD200 & compatibles (Standard) + fixed lens + festes Objektiv + canonSD200 + 6.05 + 4:3 + + + + + + + + + + + + Canon + Canon DIGITAL IXUS II & compatibles (Standard) + fixed lens + festes Objektiv + canonIxusII + 6.5 + 4:3 + + + + + + + + + + + Canon + Canon DIGITAL IXUS i & compatibles (Standard) + fixed lens + festes Objektiv + canonIxusI + 4.843 + 4:3 + + + + + + + Canon + Canon DIGITAL IXUS 400 & compatibles (Standard) + fixed lens + festes Objektiv + canonIxus400 + 4.843 + 4:3 + + + + + + + + + + + + + Canon + Canon DIGITAL IXUS 400 & compatibles, with Tiffen MegaPlus 0.56 converter + fixed lens, with Tiffen MegaPlus 0.56 converter + festes Objektiv, mit Tiffen MegaPlus 0.56-Konverter + canonIxus400 + 4.843 + 4:3 + + + + + + + + + + + + + Canon + Canon PowerShot S70 & compatibles (Standard) + fixed lens + festes Objektiv + canonS70 + 4.843 + 4:3 + + + + + + + + + + + + + + + Canon + Canon PowerShot S70 & compatibles, with TC-DC10 2x converter + fixed lens, with TC-DC10 2× converter + festes Objektiv, mit TC-DC10 2×-Konverter + canonS70 + 4.843 + 4:3 + + + + + + + + + + Canon + Canon PowerShot S30 & compatibles (Standard) + fixed lens + festes Objektiv + canonS30 + 4.843 + 4:3 + + + + + + + + + + + + + Canon + Canon PowerShot A610 & compatibles (Standard) + fixed lens + festes Objektiv + canonA610 + 4.8 + 4:3 + + + + + + + + + + + + + Canon + Canon PowerShot A610 & compatibles, with CHDK's DNG + fixed lens, with CHDK's DNG + festes Objektiv, mit CHDK-DNG + canonA610 + 4.8 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot A510 & compatibles (Standard) + fixed lens + festes Objektiv + canonA510 + 6.05 + 4:3 + + + + + + + + + + + + + + Canon + Canon PowerShot A80 & compatibles (Standard) + fixed lens + festes Objektiv + canonA80 + 4.85 + 4:3 + + + + + + + + + + + + Canon + Canon PowerShot A80 & compatibles, with Tiffen 0.56x converter + fixed lens, with Tiffen 0.56× converter + festes Objektiv, mit Tiffen 0.56×-Konverter + canonA80 + 4.85 + 4:3 + + + + + + + + + + + + + Canon + Canon PowerShot A80 & compatibles, with Tiffen 2x converter + fixed lens, with Tiffen 2× converter + festes Objektiv, mit Tiffen 2×-Konverter + canonA80 + 4.85 + 4:3 + + + + + + + + + + + Canon + Canon PowerShot A70 & compatibles (Standard) + fixed lens + festes Objektiv + canonA70 + 6.500 + 4:3 + + + + + + + + + + + + + Canon + Canon PowerShot S2 IS & compatibles (Standard) + fixed lens + festes Objektiv + canonS2 + 6.0 + 4:3 + + + + + + + + + + + + + + Canon + Canon PowerShot S2 IS & compatibles, with TC-DC58B + fixed lens, with TC-DC58B + festes Objektiv, mit TC-DC58B + canonS2 + 6.0 + 4:3 + + + + + + + + + + + + + + Canon + Canon PowerShot S1 IS & compatibles (Standard) + fixed lens + festes Objektiv + canonS1 + 6.56 + 4:3 + + + + + + + + + + + Canon + Canon PowerShot Pro90 IS & compatibles (Standard) + fixed lens + festes Objektiv + canonPro90 + 5.28 + 4:3 + + + + + + + + + + + + + + + Canon + Canon PowerShot S5 IS & compatibles (Standard) + fixed lens + festes Objektiv + canonS5 + 6.0 + 4:3 + + + + + + + + + + + + + + Canon + Canon PowerShot S5 IS & compatibles, with TC-DC58B + fixed lens, with TC-DC58B + festes Objektiv, mit TC-DC58B + canonS5 + 6.0 + 4:3 + + + + + + + + + + + + + + Canon + Canon DIGITAL IXUS 80 IS & compatibles (Standard) + fixed lens + festes Objektiv + canonIxus80IS + 6.02 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot S90 & compatibles (Standard) + fixed lens + festes Objektiv + canonS90 + 4.67 + + + + + + + + + + + + + + + + Canon + Canon PowerShot A650 IS & compatibles (Standard) + fixed lens + festes Objektiv + canonA650IS + 4.67712 + 4:3 + + + + + + + + + + + + + Canon + Canon PowerShot G11 & compatibles (Standard) + fixed lens + festes Objektiv + canonG11 + 4.554 + 4:3 + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot SX150 IS & compatibles (Standard) + fixed lens + festes Objektiv + canonSX150IS + 5.62 + 4:3 + + + + + + + + + + + + + + + + Canon + Canon PowerShot SX150 IS & compatibles, with CHDK's DNG + fixed lens, with CHDK's DNG + festes Objektiv, mit CHDK-DNG + canonSX150IS + 5.62 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot SX220 HS & compatibles, with CHDK's DNG + fixed lens, with CHDK's DNG + festes Objektiv, mit CHDK-DNG + canonSX220HS + canonSX230HS + 5.6 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot SX220 HS & compatibles (Standard) + fixed lens + festes Objektiv + canonSX220HS + 5.6 + 4:3 + + + + + + + + + + + + + + Canon + Canon PowerShot A1200 & compatibles (Standard) + fixed lens + festes Objektiv + canonA1200 + 5.61 + 4:3 + + + + + + + + + + + + + + + Canon + Canon PowerShot A720 IS & compatibles (Standard) + fixed lens + festes Objektiv + canonA720IS + 6.03 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot A640 & compatibles + fixed lens + festes Objektiv + canonA640 + 4.79 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot A640 & compatibles, with WC-DC58N + fixed lens, with WC-DC58N + festes Objektiv, mit WC-DC58N + canonA640 + 4.79 + 4:3 + + + + + + + + + + + + + + + + Canon + Canon PowerShot S120 & compatibles + fixed lens + festes Objektiv + canonS120 + 4.62 + 4:3 + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot SX260 HS & compatibles, with CHDK's DNG + fixed lens, with CHDK's DNG + festes Objektiv, mit CHDK-DNG + canonSX260HS + 5.56 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot S95 & compatibles + fixed lens + festes Objektiv + canonS95 + 4.67 + 4:3 + + + + + + + + + + + + + + + + + Canon + Canon IXUS 220 HS & compatibles, with CHDK's DNG + fixed lens, with CHDK's DNG + festes Objektiv, mit CHDK-DNG + canonIxus220HS + 5.58 + 4:3 + + + + + + + + + + + + Canon + Canon PowerShot G1X Mark II & compatibles + fixed lens + festes Objektiv + canonG1X2 + 1.93 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot G1 X Mark III & compatibles (Standard) + fixed lens + festes Objektiv + canonG1X3 + 1.613 + 3:2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + G5 X Mark II & compatibles + fixed lens + canonG5X2 + 2.73 + 3:2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot A4000 IS & compatibles, with CHDK's DNG + fixed lens, with CHDK's DNG + festes Objektiv, mit CHDK-DNG + canonA4000IS + 5.6 + 4:3 + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot G7 & compatibles (Standard) + fixed lens + canonG7 + 4.843 + + + + + + + + + + + + + + + + + + Canon + Canon G7 X & compatibles + fixed lens + festes Objektiv + canonG7X + 2.72 + 3:2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot G9 X & compatibles + fixed lens + festes Objektiv + canonG9X + 2.72 + + + + + + + + + + + + + + Canon + Canon PowerShot S100 & compatibles + fixed lens + festes Objektiv + canonS100 + 4.62 + 4:3 + + + + + + + + + + + + + + + + + + Canon + Canon IXUS 125 HS & compatibles + fixed lens + festes Objektiv + canonIxus125HS + 5.58 + 4:3 + + + + + + + + + + + Canon + Canon PowerShot SX510 HS & compatibles + fixed lens + festes Objektiv + canonSX510HS + 5.58 + 4:3 + + + + + + + + + + + Canon + Canon PowerShot SX510 HS & compatibles, with CHDK's DNG + fixed lens, with CHDK's DNG + festes Objektiv, mit CHDK-DNG + canonSX510HS + 5.58 + 4:3 + + + + + + + + + + + Canon + Canon PowerShot S110 & compatibles + fixed lens + festes Objektiv + canonS110 + + 4.62 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot SX160 IS & compatibles, with CHDK's DNG + fixed lens, with CHDK's DNG + festes Objektiv, mit CHDK-DNG + canonSX160IS + 5.6 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot A495 & compatibles, with CHDK's DNG + fixed lens, with CHDK's DNG + festes Objektiv, mit CHDK-DNG + canonA495 + 5.39 + 4:3 + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot G16 & compatibles + fixed lens + festes Objektiv + canonG16 + 4.67 + 4:3 + + + + + + + + + + + + + + + + Canon + Canon PowerShot SX10 IS + fixed lens + festes Objektiv + canonSX10IS + 5.6 + 4:3 + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot SX30 IS & compatibles, with CHDK's DNG + fixed lens, with CHDK's DNG + festes Objektiv, mit CHDK-DNG + canonSX30IS + 5.58 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot SX50 HS & compatibles + fixed lens + festes Objektiv + canonSX50HS + 5.61 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot SX60 HS & compatibles + fixed lens + festes Objektiv + canonSX60HS + 5.61 + 4:3 + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot SX710 HS & compatibles, with CHDK's DNG + fixed lens, with CHDK's DNG + festes Objektiv, mit CHDK-DNG + canonSX710HS + 5.6 + 4:3 + + + + + + + + + + + + + + + + + + + + + Canon + Canon PowerShot G3 X & compatibles + fixed lens + festes Objektiv + canonG3X + 2.727 + 3:2 + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon IXY 220F & compatibles + fixed lens + festes Objektiv + canonIxy220F + 5.58 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Casio Computer Co.,Ltd + Casio + EX-Z750 + casioZ750 + 4.8 + + + + Casio Computer Co.,Ltd + Casio + EX-P700 + casioP600 + 4.65 + + + + Casio Computer Co.,Ltd + Casio + EX-P600 + casioP600 + 4.65 + + + + Casio Computer Co.,Ltd + Casio + EX-Z4 + casioZ4 + 6.05 + + + + Casio Computer Co.,Ltd + Casio + EX-Z3 + casioZ4 + 6.05 + + + + Casio Computer Co.,Ltd + Casio + EX-Z55 + casioZ4 + 6.05 + + + + Casio Computer Co.,Ltd + Casio + EX-Z40 + casioZ4 + 6.05 + + + + Casio Computer Co.,Ltd + Casio + EX-Z30 + casioZ4 + 6.05 + + + + Casio + Casio + QV-4000 + canonG2 + 4.843 + + + + Casio + Casio + QV-3500EX + casioQV3500 + 4.8 + + + + Casio + Casio + QV-3000EX + casioQV3500 + 4.8 + + + + Casio Computer Co.,Ltd. + Casio + EX-FH20 + casioEX-FH20 + 5.68 + + + + Casio + EX-Z750 & compatibles (Standard) + fixed lens + festes Objektiv + casioZ750 + 4.8 + 4:3 + + + + + + + + + + + + + Casio + EX-P600 & compatibles (Standard) + fixed lens + festes Objektiv + casioP600 + 4.65 + 4:3 + + + + + + + + + + + + + + Casio + EX-P600 & compatibles, with WC-DC58A + fixed lens, with WC-DC58A + festes Objektiv, mit WC-DC58A + casioP600 + 4.65 + 4:3 + + + + + + + Casio + EX-Z4 & compatibles (Standard) + fixed lens + festes Objektiv + casioZ4 + 6.05 + 4:3 + + + + + + + + + + + Casio + QV-3500EX & compatibles (Standard) + fixed lens + festes Objektiv + casioQV3500 + 4.8 + 4:3 + + + + + + + + + + Casio + QV-3500EX & compatibles, with Raynox 0.66x + fixed lens, with Raynox 0.66× + festes Objektiv, mit Raynox 0.66× + casioQV3500 + 4.8 + 4:3 + + + + + + + + + + + Fujifilm + FinePix F11 + fujiF11 + 4.5 + + + + Fujifilm + FinePix F10 + fujiF11 + 4.5 + + + + Fujifilm + FinePix S9000 + fujiS9000 + 4.48 + + + + Fujifilm + FinePix S9500 + fujiS9000 + 4.48 + + + + Fujifilm + FinePix S9600 + fujiS9000 + 4.48 + + + + Fujifilm + FinePix S5500 + fujiS5500 + 6.491 + + + + Fujifilm + FinePix S5100 + fujiS5500 + 6.491 + + + + Fujifilm + FinePix S7000 + fuji602 + 4.487 + + + + Fujifilm + FinePix S20Pro + fuji602 + 4.487 + + + + Fujifilm + FinePix S602 ZOOM + fuji602 + 4.487 + + + + Fujifilm + FinePix F601 ZOOM + fuji601 + 4.487 + + + + Fujifilm + FinePix F810 + fuji810 + 4.5 + + + + Fujifilm + FinePix F810 + widescreen mode + fuji810 + 4.9 + + + + Fujifilm + FinePix F710 + fuji810 + 4.5 + + + + Fujifilm + FinePix E550 + fuji810 + 4.5 + + + + Fujifilm + FinePix 3800 + fuji2800 + 6.3333333 + + + + Fujifilm + FinePix S304 + fuji2800 + 6.3333333 + + + + Fujifilm + FinePix S3000 + fuji2800 + 6.3333333 + + + + Fujifilm + FinePix2800ZOOM + fuji2800 + 6.3333333 + + + + Fujifilm + FinePix F200EXR + fujiF200exr + 4.341 + + + + Fujifilm + FinePix X100 + fujix100 + 1.523 + + + + Fujifilm + X100S + fujix100 + 1.523 + + + + Fujifilm + X100T + fujix100 + 1.523 + + + + Fujifilm + X100F + fujix100 + 1.528 + + + + Fujifilm + X100V + fujix100v2 + 1.53 + + + + Fujifilm + X100VI + fujix100v2 + 1.53 + + + + Fujifilm + X10 + fujix10 + 3.93 + + + + Fujifilm + XF10 + fujixf10 + 1.53 + + + + Fujifilm + X70 + fujix70 + 1.5375 + + + + Fujifilm + X20 + + fujix10 + 3.93 + + + + Fujifilm + X30 + + fujix10 + 3.93 + + + + Fujifilm + FinePix HS20EXR + fujihs20exr + 5.71 + + + + Fujifilm + FinePix HS30EXR + fujihs20exr + 5.71 + + + + Fujifilm + FinePix F770EXR + fujif770exr + 5.43 + + + + Fujifilm + FinePix S5600 + fujiS5600 + 6.03 + + + + Fujifilm + XQ1 + fujiXQ1 + 3.91 + + + + Fujifilm + FinePix A370 + fujiA370 + 6.03 + + + + Fujifilm + X-S1 + fujiXS1 + 3.93 + + + + Fujifilm + GFX100RF + fujiGFX100RF + 0.8 + + + + Fujifilm + FinePix F11 & compatibles (Standard) + fixed lens + festes Objektiv + fujiF11 + 4.5 + 4:3 + + + + + + + + + + + + + + + Fujifilm + FinePix S9000 & compatibles (Standard) + fixed lens + festes Objektiv + fujiS9000 + 4.48 + 4:3 + + + + + + + + + + + + + + + + Fujifilm + FinePix S5500 & compatibles (Standard) + fixed lens + festes Objektiv + fujiS5500 + 6.491 + 4:3 + + + + + + + + + + + + + + + + + + + Fujifilm + FinePix S602 ZOOM & compatibles (Standard) + fixed lens + festes Objektiv + fuji602 + 4.487 + 4:3 + + + + + + + + + + + + + + + + Fujifilm + FinePix F601 ZOOM & compatibles (Standard) + fixed lens + festes Objektiv + fuji601 + 4.487 + 4:3 + + + + + + + + + + + + + Fujifilm + FinePix F810 & compatibles (Standard) + fixed lens + festes Objektiv + fuji810 + 4.5 + 4:3 + + + + + + + + + + + + + + Fujifilm + FinePix F810 & compatibles, with WL-FXE01 (full wide) + fixed lens, with WL-FXE01 (full wide) + festes Objektiv, mit WL-FXE01 (kürzeste Brennw.) + fuji810 + 4.5 + 4:3 + + + + + + + Fujifilm + FinePix 2800 ZOOM & compatibles (Standard) + fixed lens + festes Objektiv + fuji2800 + 6.3333333 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + FinePix F200EXR & compatibles (Standard) + fixed lens + festes Objektiv + fujiF200exr + 4.341 + 4:3 + + + + + + + + + + + + + Fujifilm + X100 & compatibles (Standard) + fixed lens + festes Objektiv + fujix100 + 1.523 + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + X100 & compatibles, with TCL-X100 + fixed lens, with TCL-X100 + festes Objektiv, mit TCL-X100 + fujix100 + 1.523 + + + + + + + + + + Fujifilm + X100V & compatibles + fixed lens, or with WCL/TCL + festes Objektiv, oder mit WCL/TCL + fujix100v2 + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + X10 & compatibles (Standard) + fixed lens + festes Objektiv + fujix10 + 3.93 + 4:3 + + + + + + + + + + + + + + + + Fujifilm + FinePix HS20EXR & compatibles (Standard) + fixed lens + festes Objektiv + fujihs20exr + 5.71 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + FinePix F770EXR & compatibles (Standard) + fixed lens + festes Objektiv + fujif770exr + 5.43 + 4:3 + + + + + + + + + + + + + + + + + + Fujifilm + FinePix S5600 + fixed lens + festes Objektiv + fujiS5600 + 6.03 + 4:3 + + + + + + + + + + + + + + Fujifilm + Fujifilm XQ1 + fixed lens + festes Objektiv + fujiXQ1 + 3.91 + 4:3 + + + + + + + + + + + + + + + + Fujifilm + Fujifilm FinePix A370 + fixed lens + festes Objektiv + fujiA370 + 6.03 + 4:3 + + + + + + + + + Fujifilm + Fujifilm X-S1 + fixed lens + festes Objektiv + fujiXS1 + 3.93 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + X70 & compatibles (Standard) + fujix70 + 1.5375 + + + + + + + + Fujifilm + XF10 & compatibles (Standard) + fujixf10 + 1.53 + + + + + + + + + + + + + + + + + + + + Fujifilm + GFX100RF & compatibles (Standard) + fixed lens + festes Objektiv + fujiGFX100RF + 0.8 + + + + + + + + + + + Eastman Kodak Company + Kodak + Kodak DC120 ZOOM Digital Camera + Kodak DC120 + kodakDC120 + 1 + + + + Eastman Kodak Company + Kodak + Kodak Digital Science DC50 Zoom Camera + Kodak DC50 + kodakDC50 + 1 + + + + Eastman Kodak Company + Kodak + Kodak CX6330 Zoom Digital Camera + Kodak CX6330 + kodakCX6330 + 6.593 + + + + Eastman Kodak Company + Kodak + Kodak CX7525 Zoom Digital Camera + Kodak CX7525 + kodakCX6330 + 6.07 + + + + Kodak + Kodak CX6330 & compatibles + fixed lens + festes Objektiv + kodakCX6330 + 6.593 + 4:3 + + + + + + + + + + + + + + + + Konica Minolta + DiMAGE Z6 + kmZ3 + 6.05 + + + + Konica Minolta + DiMAGE Z5 + kmZ3 + 6.05 + + + + Konica Minolta + DiMAGE Z3 + kmZ3 + 6.05 + + + + Konica Minolta Camera, Inc. + Konica Minolta + DiMAGE Z2 + kmZ2 + 6.03 + + + + Minolta Co., Ltd. + Minolta + DiMAGE Z1 + kmZ1 + 6.545 + + + + Konica Minolta + DiMAGE Z20 + kmZ10 + 6.05 + + + + Konica Minolta + DiMAGE Z10 + kmZ10 + 6.05 + + + + Konica Minolta + DiMAGE A200 + kmD7 + 3.933 + + + + Konica Minolta Camera, Inc. + Konica Minolta + DiMAGE A2 + kmD7 + 3.933 + + + + Minolta Co., Ltd. + Minolta + DiMAGE A1 + kmD7 + 3.933 + + + + Minolta Co., Ltd. + Minolta + DiMAGE 7Hi + kmD7 + 3.933 + + + + Minolta Co., Ltd. + Minolta + DiMAGE 7i + kmD7 + 3.933 + + + + Minolta Co., Ltd. + Minolta + DiMAGE 7 + kmD7 + 3.933 + + + + Minolta Co., Ltd. + Minolta + DiMAGE Xt + kmXt + 6.5 + + + + Minolta Co., Ltd. + Minolta + DiMAGE Xi + kmXt + 6.5 + + + + Minolta Co., Ltd. + Minolta + DiMAGE X + kmXt + 6.5 + + + + Konica Minolta Camera, Inc. + Konica Minolta + DiMAGE G400 + kmG400 + 6.144 + + + + Konica Minolta Camera, Inc. + Konica Minolta + Revio KD-420Z + kmG400 + 6.144 + + + + Konica Minolta + DiMAGE Z3 & compatibles (Standard) + fixed lens + festes Objektiv + kmZ3 + 6.05 + 4:3 + + + + + + + + + + + + + + Konica Minolta + DiMAGE Z2 & compatibles (Standard) + fixed lens + festes Objektiv + kmZ2 + 6.03 + 4:3 + + + + + + + + + + + + + + Konica Minolta + DiMAGE Z2 & compatibles, with ZCW-100 + fixed lens, with ZCW-100 + festes Objektiv, mit ZCW-100 + kmZ2 + 6.03 + 4:3 + + + + + + + + + Konica Minolta + DiMAGE Z1 & compatibles (Standard) + fixed lens + festes Objektiv + kmZ1 + 6.545 + 4:3 + + + + + + + + + + + + + + + + + + Konica Minolta + DiMAGE Z1 & compatibles, with ZCW-100 + fixed lens, with ZCW-100 + festes Objektiv, mit ZCW-100 + kmZ1 + 6.545 + 4:3 + + + + + + + Konica Minolta + DiMAGE Z10 & compatibles (Standard) + fixed lens + festes Objektiv + kmZ10 + 6.05 + 4:3 + + + + + + + + + + + + + + + Konica Minolta + DiMAGE Z10 & compatibles, with ZCW-200 + fixed lens, with ZCW-200 + festes Objektiv, mit ZCW-200 + kmZ10 + 6.05 + 4:3 + + + + + + + Konica Minolta + DiMAGE 7 & compatibles (Standard) + fixed lens + festes Objektiv + kmD7 + 3.933 + 4:3 + + + + + + + + + + + + Konica Minolta + DiMAGE 7 & compatibles, with ACW-100 converter + fixed lens, with ACW-100 converter + festes Objektiv, mit ACW-100-Konverter + kmD7 + 3.933 + 4:3 + + + + + + + Konica Minolta + DiMAGE X & compatibles (Standard) + fixed lens + festes Objektiv + kmXt + 6.5 + 4:3 + + + + + + + + + + + + + + + + Konica Minolta + DiMAGE G400 & compatibles (Standard) + fixed lens + festes Objektiv + kmG400 + 6.144 + 4:3 + + + + + + + + + + + + + + + + + Leica + Digilux 2 + leicaDigilux2 + 3.933 + + + + Leica + D-Lux2 + D-Lux 2 + panasonicLX1 + 4.45 + + + + + Leica Camera AG + Leica + C-Lux + C-Lux (Typ 1546) + + panasonicZS200 + 2.73 + + + + Leica + D-Lux 4 + panasonicLX4 + 4.33 + + + + + Leica + D-Lux 3 + panasonicLX3 + 4.33 + + + + + Leica Camera AG + Leica + Leica Q (Typ 116) + Q (Typ 116) + leicaQTyp116 + 1 + + + + Leica Camera AG + Leica + Leica Q2 + Q2 + leicaQ2 + 1 + + + + Leica Camera AG + Leica + Leica Q2 Mono + Q2 Monochrom + leicaQ2 + 1 + + + + Leica Camera AG + Leica + Leica Q3 + Q3 + leicaQ2 + 1 + + + + LEICA CAMERA AG + Leica + LEICA Q3 43 + Q3 43 + leicaQ343 + 1 + + + + Leica Camera AG + Leica + Leica Q3 Mono + Q3 Monochrom + leicaQ2 + 1 + + + + Leica Camera AG + Leica + Leica X Vario (Typ 107) + X Vario (Typ 107) + leicaXVario107 + 1.53 + + + + Leica + Digilux 2 & compatibles (Standard) + fixed lens + festes Objektiv + leicaDigilux2 + 3.933 + 4:3 + + + + + + + + + + + + + + + + + + + + LEICA CAMERA AG + Leica + LEICA Q (Typ 116) & compatibles + fixed lens + festes Objektiv + leicaQTyp116 + 1 + + + + + + + + + LEICA CAMERA AG + Leica + LEICA Q2 & compatibles + fixed lens + festes Objektiv + leicaQ2 + 1 + + + + + + + + + + + + + + + + + + Leica + Leica X Vario 18.0-46.0 mm f/3.5-6.4 + fixed lens + festes Objektiv + leicaXVario107 + 1.53 + + + + + + + + + + + LEICA CAMERA AG + Leica + APO-Summicron 1:2/43 Asph. + leicaQ343 + 1.0 + + + + + + + + + + + + Nikon + Coolpix P60 + nikonP60 + 5.62 + + + + Nikon + E8800 + Coolpix 8800 + nikon8800 + 3.933 + + + + Nikon + E8700 + Coolpix 8700 + nikon5700 + 3.933 + + + + Nikon + E5700 + Coolpix 5700 + nikon5700 + 3.933 + + + + Nikon + E7900 + Coolpix 7900 + nikon7900 + 4.86 + + + + Nikon + E7600 + Coolpix 7600 + nikon7900 + 4.86 + + + + Nikon + E5900 + Coolpix 5900 + nikon7900 + 4.86 + + + + Nikon + E5200 + Coolpix 5200 + nikon7900 + 4.86 + + + + Nikon + E4200 + Coolpix 4200 + nikon7900 + 4.86 + + + + Nikon + E5400 + Coolpix 5400 + nikon5400 + 4.843 + + + + Nikon + E5000 + Coolpix 5000 + nikon5000 + 3.933 + + + + Nikon + E4800 + Coolpix 4800 + nikon4800 + 6 + + + + Nikon + E4500 + Coolpix 4500 + nikon4500 + 4.843 + + + + Nikon + E995 + Coolpix 995 + nikon995 + 4.843 + + + + Nikon + E990 + Coolpix 990 + nikon990 + 4.843 + + + + Nikon + E950 + Coolpix 950 + nikon950 + 5.408 + + + + Nikon + Coolpix P330 + nikonP330 + 4.706 + + + + Nikon + Coolpix P340 + nikonP330 + 4.706 + + + + Nikon + Coolpix S3300 + nikonS3300 + 5.65 + + + + Nikon Corporation + Nikon + Coolpix P1000 + nikonP1000 + 5.56 + + + + Nikon Corporation + Nikon + Coolpix P1100 + nikonP1000 + 5.56 + + + + Nikon + Coolpix P6000 + nikonP6000 + 4.6 + + + + Nikon + E8400 + Coolpix 8400 + nikon8400 + 3.933 + + + + Nikon + Coolpix P7000 + nikonP7000 + 4.69 + + + + Nikon + Coolpix P7800 + nikonP7800 + 4.67 + + + + Nikon Corporation + Nikon + Coolpix A + nikonA + 1.523 + + + + Nikon + E8800 & compatibles (Standard) + fixed lens + festes Objektiv + nikon8800 + 3.933 + 4:3 + + + + + + + + + + + + + + + Nikon + E8800 & compatibles, with WM-E80 + fixed lens, with WM-E80 + festes Objektiv, mit WM-E80 + nikon8800 + 3.933 + 4:3 + + + + + + + + + + + + + Nikon + E8400 & compatibles (Standard) + fixed lens + festes Objektiv + nikon8400 + 3.933 + 4:3 + + + + + + + + + + + + + Nikon + E8400 & compatibles, with WC-E75 + fixed lens, with WC-E75 + festes Objektiv, mit WC-E75 + nikon8400 + 3.933 + 4:3 + + + + + + + + + + + + + Nikon + E5700 & compatibles (Standard) + fixed lens + festes Objektiv + nikon5700 + 3.933 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + Nikon + E5700 & compatibles, with TC-E15ED (full tele) + fixed lens, with TC-E15ED (full tele) + festes Objektiv, mit TC-E15ED (längste Brennw.) + nikon5700 + 3.933 + 4:3 + + + + + + + Nikon + E5700 & compatibles, with WC-E80 (full wide) + fixed lens, with WC-E80 (full wide) + festes Objektiv, mit WC-E80 (kürzeste Brennw.) + nikon5700 + 3.933 + 4:3 + + + + + + + Nikon + E7900 & compatibles (Standard) + fixed lens + festes Objektiv + nikon7900 + 4.86 + 4:3 + + + + + + + + + + + + + Nikon + E5400 & compatibles (Standard) + fixed lens + festes Objektiv + nikon5400 + 4.843 + 4:3 + + + + + + + + + + + + + + + + + + Nikon + E5400 & compatibles, with WC-E80 + fixed lens, with WC-E80 + festes Objektiv, mit WC-E80 + nikon5400 + 4.843 + 4:3 + + + + + + + + + + + + + + Nikon + E5000 & compatibles (Standard) + fixed lens + festes Objektiv + nikon5000 + 3.933 + 4:3 + + + + + + + + + + + + + + + + Nikon + E5000 & compatibles, with WC-E68 (full wide) + fixed lens, with WC-E68 (full wide) + festes Objektiv, mit WC-E68 (kürzeste Brennw.) + nikon5000 + 3.933 + 4:3 + + + + + + + Nikon + E4800 & compatibles (Standard) + fixed lens + festes Objektiv + nikon4800 + 6 + 4:3 + + + + + + + + + + + + + Nikon + E995 & compatibles (Standard) + fixed lens + festes Objektiv + nikon995 + 4.843 + 4:3 + + + + + + + + + + + + + Nikon + E995 & compatibles, with WC-E63 + fixed lens, with WC-E63 + festes Objektiv, mit WC-E63 + nikon995 + 4.843 + 4:3 + + + + + + + + + + + + + + + + + + Nikon + E995 & compatibles, with WC-E24 + fixed lens, with WC-E24 + festes Objektiv, mit WC-E24 + nikon995 + 4.843 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + E995 & compatibles, with TC-E2 + fixed lens, with TC-E2 + festes Objektiv, mit TC-E2 + nikon995 + 4.843 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + Nikon + E990 & compatibles (Standard) + fixed lens + festes Objektiv + nikon990 + 4.843 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + E990 & compatibles, with WC-E63 + fixed lens, with WC-E63 + festes Objektiv, mit WC-E63 + nikon990 + 4.843 + 4:3 + + + + + + + Nikon + E950 & compatibles (Standard) + fixed lens + festes Objektiv + nikon950 + 5.408 + 4:3 + + + + + + + + + + + + + + + + + + + + + Nikon + Coolpix P60 & compatibles (Standard) + fixed lens + festes Objektiv + nikonP60 + 5.62 + 4:3 + + + + + + + + + + + + + + + Nikon + Coolpix P330 & compatibles (Standard) + fixed lens + festes Objektiv + nikonP330 + 4.706 + 4:3 + + + + + + + + + + + + + + + + + + + + Nikon + Coolpix S3300 & compatibles + fixed lens + festes Objektiv + nikonS3300 + 5.65 + 4:3 + + + + + + + + + + + Nikon + Coolpix P7000 & compatibles + fixed lens + festes Objektiv + nikonP7000 + 4.69 + 4:3 + + + + + + + + + + Nikon + Coolpix A & compatibles + fixed lens + festes Objektiv + nikonA + 1.523 + 3:2 + + + + + + + + NIKON CORPORATION + Nikon + Coolpix P1000 & compatibles + fixed lens + festes Objektiv + nikonP1000 + 5.56 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Coolpix P7800 & compatibles + fixed lens + festes Objektiv + nikonP7800 + 4.67 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus Corporation + Olympus + C8080WZ + C-8080 Wide Zoom + olympus8080 + 3.933 + + + + Olympus Imaging Corp. + Olympus + u-miniD,Stylus V + µ-mini Digital + olympusStylusV + 6.0 + + + + Olympus Imaging Corp. + Olympus + u-miniD,Stylus V + Stylus Verve Digital + + variant of the µ-mini Digital + olympusStylusV + 6.0 + + + + Olympus Imaging Corp. + Olympus + C70Z,C7000Z + C-70 Zoom, C-7000 Zoom + olympus7000 + 4.8 + + + + Olympus Optical Co.,Ltd + Olympus + C4100Z,C4000Z + C-4000 Zoom, C-4100 Zoom + olympus4000 + 4.92 + + + + Olympus Optical Co.,Ltd + Olympus + X-2,C-50Z + X-2 + olympusC50 + 4.9 + + + + Olympus Optical Co.,Ltd + Olympus + X-2,C-50Z + C-50 Zoom + + variant of the X-2 + olympusC50 + 4.9 + + + + Olympus Optical Co.,Ltd + Olympus + C750UZ + C-750 Ultra Zoom + olympus750 + 6.03 + + + + Olympus Optical Co.,Ltd + Olympus + C730UZ + C-730 Ultra Zoom + olympus700 + 6.52 + + + + Olympus Optical Co.,Ltd + Olympus + C700UZ + C-700 Ultra Zoom + olympus700 + 6.52 + + + + Olympus Imaging Corp. + Olympus + C7070WZ + C-7070 Wide Zoom + olympus5060 + 4.930 + + + + Olympus Corporation + Olympus + C5060WZ + C-5060 Wide Zoom + olympus5060 + 4.930 + + + + Olympus Optical Co.,Ltd + Olympus + C5050Z + C-5050 Zoom + olympus2040 + 4.930 + + + + Olympus Optical Co.,Ltd + Olympus + C4040Z + C-4040 Zoom + olympus2040 + 4.930 + + + + Olympus Optical Co.,Ltd + Olympus + C3040Z + C-3040 Zoom + olympus2040 + 4.930 + + + + Olympus Optical Co.,Ltd + Olympus + C2040Z + C-2040 Zoom + olympus2040 + 4.930 + + + + Olympus Optical Co.,Ltd + Olympus + C860L,D360L + C-860L + olympusC860 + 6.563 + + + + Olympus Optical Co.,Ltd + Olympus + C860L,D360L + D-360L + + variant of the C-860L + olympusC860 + 6.563 + + + + Olympus + mju-II + µ-II + olympusEpic + 1 + + + + Olympus + Stylus Epic + olympusEpic + 1 + + + + Olympus Imaging Corp. + Olympus + SP350 + SP-350 + olympusSP350 + 4.8 + + + + Olympus Imaging Corp. + Olympus + SP500UZ + SP-500 Ultra Zoom + olympusSP500 + 6.0 + + + + Olympus Imaging Corp. + Olympus + SP560UZ + SP-560 Ultra Zoom + olympusSP560 + 5.8 + + + + Olympus Imaging Corp. + Olympus + XZ-1 + olympusxz1 + 4.68 + + + + Olympus Imaging Corp. + Olympus + XZ-2 + olympusxz1 + 4.68 + + + + Olympus Imaging Corp. + Olympus + Stylus1 + Stylus 1 + olympusStylus1 + 4.67 + + + + + Olympus Imaging Corp. + Olympus + Stylus1,1s + Stylus 1, 1s + olympusStylus1 + 4.67 + + + + Olympus Corporation + Olympus + TG-1 + Tough TG-1 + olympusToughTG4 + 5.56 + + + + Olympus Corporation + Olympus + TG-2 + Tough TG-2 + olympusToughTG4 + 5.56 + + + + Olympus Corporation + Olympus + TG-3 + Tough TG-3 + olympusToughTG4 + 5.56 + + + + Olympus Corporation + Olympus + TG-4 + Tough TG-4 + olympusToughTG4 + 5.56 + + + + Olympus Corporation + Olympus + TG-5 + Tough TG-5 + olympusToughTG5 + 5.62 + + + + Olympus Corporation + Olympus + TG-6 + Tough TG-6 + olympusToughTG4 + 5.56 + + + + Olympus + C8080WZ & compatibles (Standard) + fixed lens + festes Objektiv + olympus8080 + 3.933 + 4:3 + + + + + + + + + + + + + + + Olympus + Stylus V & compatibles (Standard) + fixed lens + festes Objektiv + olympusStylusV + 6.0 + 4:3 + + + + + + + + + + + + Olympus + C7000Z & compatibles (Standard) + fixed lens + festes Objektiv + olympus7000 + 4.8 + 4:3 + + + + + + + + + + + + + + + + Olympus + C4000Z & compatibles (Standard) + fixed lens + festes Objektiv + olympus4000 + 4.92 + 4:3 + + + + + + + + + + + + + + + Olympus + C4000Z & compatibles, with A-28 iS/L converter + fixed lens, with A-28 iS/L converter + festes Objektiv, mit A-28 iS/L-Konverter + olympus4000 + 4.92 + 4:3 + + + + + + + + + + + + + + Olympus + C-50Z & compatibles (Standard) + fixed lens + festes Objektiv + olympusC50 + 4.9 + 4:3 + + + + + + + + + + + + + Olympus + C750UZ & compatibles (Standard) + fixed lens + festes Objektiv + olympus750 + 6.03 + 4:3 + + + + + + + + + + + + + Olympus + C700UZ & compatibles (Standard) + fixed lens + festes Objektiv + olympus700 + 6.52 + 4:3 + + + + + + + + + + + + + + Olympus + C2040Z & compatibles (Standard) + fixed lens + festes Objektiv + olympus2040 + 4.930 + 4:3 + + + + + + + + + + + + + + + + + Olympus + C2040Z & compatibles, with WCON-08B + fixed lens, with WCON-08B + festes Objektiv, mit WCON-08B + olympus2040 + 4.930 + 4:3 + + + + + + + + + + + + + + + + + Olympus + C5060WZ & compatibles (Standard) + fixed lens + festes Objektiv + olympus5060 + 4.843 + 4:3 + + + + + + + + + + + + + + + + + + Olympus + C860L & compatibles (Standard) + fixed lens + festes Objektiv + olympusC860 + 6.563 + 4:3 + + + + + + + Olympus + Stylus Epic & compatibles (Standard) + fixed lens + festes Objektiv + olympusEpic + 1 + 3:2 + + + + + + + Olympus + XZ-1 & compatibles (Standard) + fixed lens + festes Objektiv + olympusxz1 + + + 4.68 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Stylus 1 & compatibles + fixed lens + festes Objektiv + olympusStylus1 + 4.67 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus Tough TG-4 & compatibles + fixed lens + festes Objektiv + olympusToughTG4 + 5.56 + 4:3 + + + + + + + + + + + + + + + + + Olympus + Olympus Tough TG-5 + fixed lens + festes Objektiv + olympusToughTG5 + 5.62 + 4:3 + + + + + + + + + + + + + + + + + + + + + Panasonic + DMC-LX1 + 16:9 + panasonicLX1 + 4.45 + + + + Panasonic + DMC-LX1 + 3:2 + panasonicLX1 + 5.08 + + + + Panasonic + DMC-LX1 + 4:3 + panasonicLX1 + 5.40 + + + + Panasonic + DMC-LX3 + 4:3 + panasonicLX3 + 4.7 + + + + Panasonic + DMC-LX3 + 16:9 + panasonicLX3 + 5.7528 + + + + Panasonic + DMC-LX3 + 3:2 + panasonicLX3 + 5.1 + + + + Panasonic + DMC-LX3 + 1:1 + panasonicLX3 + 5.32 + + + + Panasonic + DMC-LX5 + 4:3 + panasonicLX5 + 4.71 + + + + Panasonic + DMC-LX7 + 4:3 + panasonicLX7 + 5.1 + + + + Panasonic + DMC-LX10 + panasonicLX10 + 2.73 + + + + Panasonic + DMC-LX15 + + panasonicLX10 + 2.73 + + + + Panasonic + DMC-LC1 + leicaDigilux2 + 3.933 + + + + Panasonic + DMC-LZ2 + panasonicLZ2 + 6.06 + + + + Panasonic + DMC-LZ1 + panasonicLZ2 + 6.06 + + + + Panasonic + DMC-FX9 + panasonicFX7 + 6.05 + + + + Panasonic + DMC-FX8 + panasonicFX7 + 6.05 + + + + Panasonic + DMC-FX7 + panasonicFX7 + 6.05 + + + + Panasonic + DMC-FX2 + panasonicFX7 + 6.05 + + + + Panasonic + DMC-FZ30 + panasonicFZ30 + 4.73 + + + + Panasonic + DMC-FZ20 + panasonicFZ10 + 6.0 + + + + Panasonic + DMC-FZ10 + panasonicFZ10 + 5.84 + + + + Panasonic + DMC-FZ5 + panasonicFZ5 + 6.0 + + + + Panasonic + DMC-FZ3 + panasonicFZ3 + 7.6 + + + + Panasonic + DMC-FZ28 + panasonicFZ28 + 5.6 + + + + Panasonic + DMC-FX150 + panasonicFX150 + 4.7 + + + + Panasonic + DMC-LX2 + panasonicDMCLX2 + 4.44 + + + + Panasonic + DMC-FZ18 + panasonicDMCFZ18 + 6.1 + + + + Panasonic + DMC-FZ35 + panasonicDMCFZ35 + 5.6 + + + + Panasonic + DMC-FZ40 + + panasonicDMCFZ45 + 5.60 + + + + Panasonic + DMC-FZ40 (3:2) + + panasonicDMCFZ45 + 5.81 + + + + Panasonic + DMC-FZ45 + panasonicDMCFZ45 + 5.60 + + + + Panasonic + DMC-FZ45 (3:2) + panasonicDMCFZ45 + 5.81 + + + + Panasonic + DMC-FZ50 + panasonicDMCFZ50 + 4.84 + + + + Panasonic + DMC-FZ8 + panasonicDMCFZ8 + 6.02 + + + + Panasonic + DMC-FZ100 + + panasonicDMCFZ45 + 5.60 + + + + Panasonic + DMC-FZ100 (3:2) + + panasonicDMCFZ45 + 5.81 + + + + Panasonic + DMC-FZ200 + panasonicDMCFZ200 + 5.56 + + + + Panasonic + DMC-FZ300 + + panasonicDMCFZ200 + 5.56 + + + + Panasonic + DMC-FZ330 + + panasonicDMCFZ200 + 5.56 + + + + Panasonic + DMC-LX100 + panasonicDMCLX100 + 2.21 + + + + Panasonic + DC-LX100M2 + + panasonicDMCLX100 + 2.21 + + + + Panasonic + DMC-FZ1000 + panasonicFZ1000 + 2.73 + + + + Panasonic + DMC-FZ2000 + panasonicFZ2000 + 2.73 + + + + Panasonic + DMC-FZ2500 + panasonicFZ2000 + 2.73 + + + + Panasonic + DC-FZ10002 + + panasonicFZ1000 + 2.73 + + + + Panasonic + DMC-FZ150 + panasonicFZ150 + 5.56 + + + + Panasonic + DMC-LF1 + panasonicLF1 + 4.67 + + + + Panasonic + DMC-TZ60 + panasonicTZ70 + 5.58 + + + + + Panasonic + DMC-TZ61 + panasonicTZ70 + 5.58 + + + + + Panasonic + DMC-ZS40 + panasonicTZ70 + 5.58 + + + + Panasonic + DMC-TZ70 + panasonicTZ70 + 5.58 + + + + + Panasonic + DMC-TZ71 + panasonicTZ70 + 5.58 + + + + + Panasonic + DMC-ZS50 + panasonicTZ70 + 5.58 + + + + Panasonic + DMC-TZ80 + panasonicTZ70 + 5.58 + + + + + Panasonic + DMC-TZ81 + panasonicTZ70 + 5.58 + + + + + Panasonic + DMC-ZS60 + panasonicTZ70 + 5.58 + + + + Panasonic + DMC-TZ90 + panasonicTZ70 + 5.58 + + + + + Panasonic + DMC-TZ91 + panasonicTZ70 + 5.58 + + + + + Panasonic + DC-TZ90 + panasonicTZ70 + 5.58 + + + + Panasonic + DC-TZ99 + panasonicTZ70 + 5.58 + + + + Panasonic + DMC-TZ96 + panasonicTZ70 + 5.58 + + + + + Panasonic + DMC-ZS70 + panasonicTZ70 + 5.58 + + + + Panasonic + DMC-TZ100 + panasonicTZ100 + 2.75 + + + + Panasonic + DMC-TZ101 + + panasonicTZ100 + 2.75 + + + + Panasonic + DMC-TZ110 + + panasonicTZ100 + 2.75 + + + + Panasonic + DMC-ZS100 + + panasonicTZ100 + 2.75 + + + + Panasonic + DMC-ZS110 + + panasonicTZ100 + 2.75 + + + + Panasonic + DC-ZS200 + + panasonicZS200 + 2.73 + + + + Panasonic + DC-ZS220 + + panasonicZS200 + 2.73 + + + + Panasonic + DC-TZ200 + + panasonicZS200 + 2.73 + + + + Panasonic + DC-TZ200D + + panasonicZS200 + 2.73 + + + + Panasonic + DC-ZS200D + + panasonicZS200 + 2.73 + + + + Panasonic + DC-TZ220 + + panasonicZS200 + 2.73 + + + + Panasonic + DC-TZ202 + + panasonicZS200 + 2.73 + + + + Leica + DMC-LX1 & compatibles (Standard) + fixed lens + festes Objektiv + panasonicLX1 + 4.45 + 16:9 + + + + + + + + + + + + + + + Leica + DMC-LX3 & compatibles (Standard) + fixed lens + festes Objektiv + panasonicLX3 + + + 4.7 + 4:3 + + + + + + + + + + + + + + + + + + + Leica + DMC-LX5 & compatibles (Standard) + fixed lens + festes Objektiv + panasonicLX5 + + + 4.71 + 4:3 + + + + + + + + + + + + Leica + DMC-LX7 & compatibles (Standard) + fixed lens + festes Objektiv + panasonicLX7 + 5.1 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Leica + DMC-LX10 & compatibles (Standard) + fixed lens + festes Objektiv + objectif intégré + panasonicLX10 + 2.73 + + + + + + + + + + + + + + + + + + + + Leica + DMC-LZ2 & compatibles (Standard) + fixed lens + festes Objektiv + panasonicLZ2 + 6.06 + 4:3 + + + + + + + + + + + + + + + Leica + DMC-FX7 & compatibles (Standard) + fixed lens + festes Objektiv + panasonicFX7 + 6.05 + 4:3 + + + + + + + + + + + + + Leica + DMC-FZ28 & compatibles (Standard) + fixed lens + festes Objektiv + panasonicFZ28 + + + 5.6 + 4:3 + + + + + + + + + + + + + + + + + + Leica + DMC-FZ30 & compatibles (Standard) + fixed lens + festes Objektiv + panasonicFZ30 + 4.73 + 4:3 + + + + + + + + + + + + + + + + + Panasonic + DMC-FZ45 & compatibles (Standard) + fixed lens + festes Objektiv + panasonicDMCFZ45 + 5.81 + 3:2 + + + + + + + + + + + + + + + + + + + + Leica + DMC-FZ10 & compatibles (Standard) + fixed lens + festes Objektiv + panasonicFZ10 + 5.84 + 4:3 + + + + + + + + + + + + + + Leica + DMC-FZ5 & compatibles (Standard) + fixed lens + festes Objektiv + panasonicFZ5 + 6.0 + 4:3 + + + + + + + + + + + + + + Leica + DMC-FZ3 & compatibles (Standard) + fixed lens + festes Objektiv + panasonicFZ3 + 7.6 + 4:3 + + + + + + + + + + + + + + + + + Leica + DMC-FZ200 & compatibles (Standard) + fixed lens + festes Objektiv + panasonicDMCFZ200 + 5.56 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Leica + DMC-LX100 & compatibles + fixed lens + festes Objektiv + panasonicDMCLX100 + 2.21 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Leica + FZ1000 & compatibles + fixed lens + festes Objektiv + panasonicFZ1000 + 2.73 + 3:2 + + + + + + + + + + + + + + + + + + + + + + + + + Leica + FZ2000 & compatibles + fixed lens + festes Objektiv + panasonicFZ2000 + 2.73 + 3:2 + + + + + + + + + + + + + + + + + + + + + + Leica + FZ150 & compatibles + fixed lens + festes Objektiv + panasonicFZ150 + + 5.56 + 4:3 + + + + + + + + + + + + + + + + + + + + Panasonic + DMC-LF1 & compatibles + fixed lens + festes Objektiv + panasonicLF1 + 4.67 + 4:3 + + + + + + + + + + + + + + + + + + + + + + Leica + DMC-TZ70 & compatibles + fixed lens + festes Objektiv + panasonicTZ70 + 5.58 + 4:3 + + + + + + + + + + + + + + + + + + + + + + Leica + DMC-TZ100 & compatibles + fixed lens + festes Objektiv + panasonicTZ100 + 2.75 + 3:2 + + + + + + + + + + + + + + + + + + + + + + Panasonic + DC-ZS200 & compatibles + fixed lens + festes Objektiv + panasonicZS200 + 2.73 + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax Corporation + Pentax + Pentax Optio 43WR + Optio 43WR + pentax43WR + 6.5 + + + + Pentax Corporation + Pentax + Pentax Optio 750Z + Optio 750Z + pentax750 + 4.843 + + + + Pentax Corporation + Pentax + Pentax Optio 555 + Optio 555 + pentax750 + 4.843 + + + + Pentax Corporation + Pentax + Pentax Optio 550 + Optio 550 + pentax750 + 4.843 + + + + Pentax Corporation + Pentax + Pentax Optio 450 + Optio 450 + pentax750 + 4.843 + + + + Pentax Corporation + Pentax + Pentax Optio 33LF + Optio 33LF + pentax230 + 6.563 + + + + Pentax Corporation + Pentax + Pentax Optio 33L + Optio 33L + pentax230 + 6.563 + + + + Pentax Corporation + Pentax + Pentax Optio 230GS + Optio 230GS + pentax230 + 6.563 + + + + Pentax Corporation + Pentax + Pentax Optio 330GS + Optio 330GS + pentax230 + 6.563 + + + + Asahi Optical Co.,Ltd + Pentax + Pentax Optio 430 + Optio 430 + pentax430 + 4.85 + + + + Pentax + Pentax Optio 43WR & compatibles (Standard) + fixed lens + festes Objektiv + pentax43WR + 6.5 + 4:3 + + + + + + + + + + + + + Pentax + Pentax Optio 750Z & compatibles (Standard) + fixed lens + festes Objektiv + pentax750 + 4.843 + 4:3 + + + + + + + + + + + + + + Pentax + Pentax Optio 230GS & compatibles (Standard) + fixed lens + festes Objektiv + pentax230 + 6.563 + 4:3 + + + + + + + + + + + + + Pentax + Pentax Optio 430 & compatibles (Standard) + fixed lens + festes Objektiv + pentax430 + 4.85 + 4:3 + + + + + + + + + + + + + + + + + Ricoh + GR Digital + ricohGRdigital + 4.8 + + + + Ricoh + Caplio GX8 + ricohGX + 4.9 + + + + Ricoh + Caplio GX + ricohGX + 4.9 + + + + Ricoh + Caplio RR30 + ricohRR30 + 6.4 + + + + Ricoh Imaging Company, Ltd. + Ricoh + GR + ricohGR + 1.523 + + + + Ricoh Imaging Company, Ltd. + Ricoh + Ricoh GR III + GR III + ricohGRIII + 1.53 + + + + Ricoh Imaging Company, Ltd. + Ricoh + Ricoh GR III HDF + GR III HDF + ricohGRIII + 1.53 + + + + Ricoh Imaging Company, Ltd. + Ricoh + Ricoh GR IIIx + GR IIIx + ricohGRIIIx + 1.53 + + + + Ricoh Imaging Company, Ltd. + Ricoh + Ricoh GR IIIx HDF + GR IIIx HDF + ricohGRIIIx + 1.53 + + + + Ricoh Imaging Company, Ltd. + Ricoh + Ricoh GR IV + GR IV + ricohGRIV + 1.53 + + + + Ricoh + GR Digital & compatibles (Standard) + fixed lens + festes Objektiv + ricohGRdigital + 4.8 + 4:3 + + + + + + + Ricoh + Caplio GX & compatibles (Standard) + fixed lens + festes Objektiv + ricohGX + 4.9 + 4:3 + + + + + + + + + + + + + + Ricoh + Caplio GX & compatibles, with DW-4 + fixed lens, with DW-4 + festes Objektiv, mit DW-4 + ricohGX + 4.9 + 4:3 + + + + + + + + + + + + + + Ricoh + Caplio RR30 & compatibles (Standard) + fixed lens + festes Objektiv + ricohRR30 + 6.4 + 4:3 + + + + + + + + + + + + + Ricoh + Ricoh GR & compatibles + fixed lens + festes Objektiv + ricohGR + 1.523 + 3:2 + + + + + + + + Ricoh imaging company, ltd. + Ricoh GR III & compatibles + GW-4 + fixed lens + festes Objektiv + ricohGRIII + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ricoh imaging company, ltd. + Ricoh GR IIIx & compatibles + fixed lens + festes Objektiv + ricohGRIIIx + 1.53 + + + + + + + + + + + + + + + + + + + Ricoh + Ricoh GR IV & compatibles + fixed lens + festes Objektiv + ricohGRIV + 1.53 + + + + + + + + + + + + Samsung + WB2000 + samsungWB2000 + 5.69 + + + + Samsung + SM-G935F + Galaxy S7 + samsungS7 + 6.19 + + + + Samsung + SM-G950F + Galaxy S8 + samsungS8 + 6.19 + + + + + Samsung + SM-G9500 + Galaxy S8 + samsungS8 + 6.19 + + + + Samsung + SM-N950U + Galaxy Note 8 + samsungS8wide + 6.047 + + + + Samsung + SM-G991B + Galaxy S21 + samsungS21uw + 6.0 + + + + Samsung + EX2F + samsungEx2f + 4.6 + + + + Samsung + WB2000 & compatibles (Standard) + fixed lens + festes Objektiv + samsungWB2000 + 5.69 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Samsung + Samsung S7 wide angle lens cover + samsungS7 + 6.19 + 4:3 + + + + + + + + Samsung + Samsung S8 wide angle lens + samsungS8wide + 6.047 + 4:3 + + + + + + + + Samsung + SM-G950F + samsungS8 + 6.19 + 4:3 + + + + + + + Samsung + Samsung Galaxy S21 ultrawide + samsungS21uw + 6.0 + 4:3 + + + + + + + + + Samsung + EX2F & compatibles (Standard) + fixed lens + festes Objektiv + samsungEx2f + 4.6 + 4:3 + + + + + + + + + + + + + + + + + Sigma + Sigma DP1 + DP1 + sigmaDP1 + 1.739 + + + + Sigma + Sigma DP1 Merrill + DP1 Merrill + sigmaDP1M + 1.531 + + + + Sigma + Sigma DP1S + DP1S + sigmaDP1 + 1.739 + + + + Sigma + Sigma DP1X + DP1X + sigmaDP1 + 1.739 + + + + Sigma + Sigma DP2 + DP2 + sigmaDP2 + 1.739 + + + + Sigma + Sigma DP2 Merrill + DP2 Merrill + sigmaDP2M + 1.531 + + + + Sigma + Sigma DP2S + DP2S + sigmaDP2 + 1.739 + + + + Sigma + Sigma DP2X + DP2X + sigmaDP2 + 1.739 + + + + Sigma + Sigma DP3 Merrill + DP3 Merrill + sigmaDP3M + 1.531 + + + + Sigma + Sigma DP2 & compatibles (Standard) + fixed lens + festes Objektiv + sigmaDP2 + 1.739 + 3:2 + + + + + + + + + + + Sony + DSC-R1 + sonyR1 + 1.68 + + + + Sony + DSC-H1 + sonyH1 + 6.0 + + + + Sony + DSC-F828 + sony828 + 3.933 + + + + Sony + Cybershot + Cyber-shot + DSC-F717 + sony707 + 3.933 + + + + Sony + Cybershot + Cyber-shot + DSC-F707 + sony707 + 3.933 + + + + Sony + DSC-P200 + sonyW1 + 4.8 + + + + Sony + DSC-P150 + sonyW1 + 4.8 + + + + Sony + DSC-P100 + sonyW1 + 4.8 + + + + Sony + DSC-P93 + sonyW1 + 4.8 + + + + Sony + DSC-W12 + sonyW1 + 4.8 + + + + Sony + DSC-W7 + sonyW1 + 4.8 + + + + Sony + DSC-W15 + sonyW1 + 4.8 + + + + Sony + DSC-W5 + sonyW1 + 4.8 + + + + Sony + DSC-W1 + sonyW1 + 4.8 + + + + Sony + DSC-V3 + sonyV1 + 4.843 + + + + Sony + DSC-V1 + sonyV1 + 4.843 + + + + Sony + DSC-T1 + sonyT1 + 5.650 + + + + Sony + Cybershot + Cyber-shot + DSC-S85 + sonyS85 + 4.843 + + + + Sony + Cybershot + Cyber-shot + DSC-S75 + sonyS85 + 4.843 + + + + Sony + DSC-S90 + sonyS60 + 6.5 + + + + Sony + DSC-ST80 + sonyS60 + 6.5 + + + + Sony + DSC-S80 + sonyS60 + 6.5 + + + + Sony + DSC-S60 + sonyS60 + 6.5 + + + + Sony + DSC-P73 + sonyS60 + 6.5 + + + + Sony + DSC-RX100 + RX100 + sonyRX100 + 2.73 + + + + Sony + DSC-RX100M2 + RX100 II + sonyRX100II + 2.73 + + + + Sony + DSC-RX100M3 + RX100 III + sonyRX100III + 2.73 + + + + Sony + DSC-RX100M4 + RX100 IV + sonyRX100III + 2.73 + + + + Sony + DSC-RX100M5 + RX100 V + sonyRX100III + 2.73 + + + + Sony + DSC-RX100M6 + RX100 VI + sonyRX100VI + 2.66 + + + + Sony + DSC-RX100M7 + RX100 VII + sonyRX100VI + 2.66 + + + + Sony + DSC-RX100M7A + RX100 VIIA + sonyRX100VI + 2.66 + + + + Sony + DSC-RX100M5A + RX100 VA + sonyRX100III + 2.73 + + + + Sony + DSC-HX300 + sonyHX300 + 5.58 + + + + Sony + DSC-HX20V + sonyHX20V + 5.62 + + + + Sony + Xperia Z3 + sonyXperiaZ3 + 7.87 + + + + Sony + DSC-RX10 + RX10 + sonyRX10 + 2.73 + + + + Sony + DSC-RX10M2 + RX10 II + sonyRX10II + 2.73 + + + + Sony + DSC-RX10M3 + RX10 III + sonyRX10III + 2.73 + + + + + Sony + DSC-RX10M4 + RX10 IV + sonyRX10III + 2.73 + + + + Sony + DSC-RX1R + RX1R + sonyRX1 + 1 + + + + Sony + DSC-RX1RM2 + RX1R II + sonyRX1 + 1 + + + + Sony + DSC-RX1RM3 + RX1R III + sonyRX1 + 1 + + + + Sony + DSC-RX0 + RX0 + sonyRX0M2 + 2.70 + + + + Sony + DSC-RX0M2 + RX0 II + sonyRX0M2 + 2.70 + + + + Sony + ZV-1 + sonyZV1 + 2.70 + + + + Carl Zeiss + DSC-R1 & compatibles (Standard) + fixed lens + festes Objektiv + sonyR1 + 1.68 + 3:2 + + + + + + + + + + + + + + + + + + + + Carl Zeiss + DSC-H1 & compatibles (Standard) + fixed lens + festes Objektiv + sonyH1 + 6.0 + 4:3 + + + + + + + + + + + + + + + + + Carl Zeiss + DSC-H1 & compatibles, with VCL-DH0758 0.7x converter + fixed lens, with VCL-DH0758 0.7× converter + festes Objektiv, mit VCL-DH0758 0.7×-Konverter + sonyH1 + 6.0 + 4:3 + + + + + + + + + + + + + + + + + Carl Zeiss + DSC-H1 & compatibles, with VCL-DH1758 1.7x converter + fixed lens, with VCL-DH1758 1.7× converter + festes Objektiv, mit VCL-DH1758 1.7×-Konverter + sonyH1 + 6.0 + 4:3 + + + + + + + + + + + + + Carl Zeiss + DSC-F828 & compatibles (Standard) + fixed lens + festes Objektiv + sony828 + 3.933 + 4:3 + + + + + + + + + + + + + + + + + + + Carl Zeiss + DSC-F828 & compatibles, at 2 feet lens-to-subject + fixed lens, at 2 feet lens-to-subject + festes Objektiv, bei 60 cm Fokusabstand + sony828 + 3.933 + 4:3 + + + + + + + + + + + + + + + + + + + Carl Zeiss + DSC-F707 & compatibles (Standard) + fixed lens + festes Objektiv + sony707 + 3.933 + 4:3 + + + + + + + + + + + + + + + + + Carl Zeiss + DSC-F707 & compatibles, macro at 1 inch lens-to-subject + fixed lens, macro at 1 inch lens-to-subject + festes Objektiv, Makro bei 1 Zoll Fokusabstand + sony707 + 3.933 + 4:3 + + + + + + + + + + + Carl Zeiss + DSC-F707 & compatibles, macro at 2 inches lens-to-subject + fixed lens, macro at 2 inches lens-to-subject + festes Objektiv, Makro bei 2 Zoll Fokusabstand + sony707 + 3.933 + 4:3 + + + + + + + + + + + + Carl Zeiss + DSC-F707 & compatibles, macro at 4 inches lens-to-subject + fixed lens, macro at 4 inches lens-to-subject + festes Objektiv, Makro bei 4 Zoll Fokusabstand + sony707 + 3.933 + 4:3 + + + + + + + + + + + + + + + Carl Zeiss + DSC-F707 & compatibles, macro at 6 inches lens-to-subject + fixed lens, macro at 6 inches lens-to-subject + festes Objektiv, Makro bei 6 Zoll Fokusabstand + sony707 + 3.933 + 4:3 + + + + + + + + + + + + Carl Zeiss + DSC-F707 & compatibles, macro at 8 inches lens-to-subject + fixed lens, macro at 8 inches lens-to-subject + festes Objektiv, Makro bei 8 Zoll Fokusabstand + sony707 + 3.933 + 4:3 + + + + + + + + + + + + + + + Carl Zeiss + DSC-F707 & compatibles, macro at 12 inches lens-to-subject + fixed lens, macro at 12 inches lens-to-subject + festes Objektiv, Makro bei 12 Zoll Fokusabstand + sony707 + 3.933 + 4:3 + + + + + + + + + + + + + Carl Zeiss + DSC-F707 & compatibles, macro at 16 inches lens-to-subject + fixed lens, macro at 16 inches lens-to-subject + festes Objektiv, Makro bei 16 Zoll Fokusabstand + sony707 + 3.933 + 4:3 + + + + + + + + + + + + + + Carl Zeiss + DSC-F707 & compatibles, macro at 20 inches lens-to-subject + fixed lens, macro at 20 inches lens-to-subject + festes Objektiv, Makro bei 20 Zoll Fokusabstand + sony707 + 3.933 + 4:3 + + + + + + + + + + + + + + Carl Zeiss + DSC-F707 & compatibles, macro at 24 inches lens-to-subject + fixed lens, macro at 24 inches lens-to-subject + festes Objektiv, Makro bei 24 Zoll Fokusabstand + sony707 + 3.933 + 4:3 + + + + + + + + + + + + + + Carl Zeiss + DSC-F707 & compatibles, macro at 32 inches lens-to-subject + fixed lens, macro at 32 inches lens-to-subject + festes Objektiv, Makro bei 32 Zoll Fokusabstand + sony707 + 3.933 + 4:3 + + + + + + + + + + + + + + + Carl Zeiss + DSC-F707 & compatibles, with VCL-HGD0758 wide angle + fixed lens, with VCL-HGD0758 wide angle + festes Objektiv, mit VCL-HGD0758 Weitwinkel + sony707 + 3.933 + 4:3 + + + + + + + + + + + + + + + + + + Carl Zeiss + DSC-F707 & compatibles, with Sakar 1858W + fixed lens, with Sakar 1858W + festes Objektiv, mit Sakar 1858W + sony707 + 3.933 + 4:3 + + + + + + + + + + + + Carl Zeiss + DSC-W1 & compatibles (Standard) + fixed lens + festes Objektiv + sonyW1 + 4.8 + 4:3 + + + + + + + + + + + + + + Carl Zeiss + DSC-V1 & compatibles (Standard) + fixed lens + festes Objektiv + sonyV1 + 4.843 + 4:3 + + + + + + + + + + + + + + + Carl Zeiss + DSC-V1 & compatibles, with VCL-DEH07V converter + fixed lens, with VCL-DEH07V converter + festes Objektiv, mit VCL-DEH07V-Konverter + sonyV1 + 4.843 + 4:3 + + + + + + + Carl Zeiss + DSC-V1 & compatibles, with VCL-DEH17V converter + fixed lens, with VCL-DEH17V converter + festes Objektiv, mit VCL-DEH17V-Konverter + sonyV1 + 4.843 + 4:3 + + + + + + + Carl Zeiss + DSC-T1 & compatibles (Standard) + fixed lens + festes Objektiv + sonyT1 + 5.650 + 4:3 + + + + + + + + + + + + + + Carl Zeiss + DSC-S85 & compatibles (Standard) + fixed lens + festes Objektiv + sonyS85 + 4.843 + 4:3 + + + + + + + Carl Zeiss + DSC-S85 & compatibles, with VCL-MHG07a converter + fixed lens, with VCL-MHG07a converter + festes Objektiv, mit VCL-MHG07a-Konverter + sonyS85 + 4.843 + 4:3 + + + + + + + Carl Zeiss + DSC-S60 & compatibles (Standard) + fixed lens + festes Objektiv + sonyS60 + 6.5 + 4:3 + + + + + + + + + + + + + + + Sony + DSC-RX100 & compatibles (Standard) + fixed lens + festes Objektiv + sonyRX100 + + 2.73 + 3:2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + DSC-RX100 II & compatibles + fixed lens + festes Objektiv + sonyRX100II + 2.73 + 3:2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + DSC-RX100 III & compatibles + fixed lens + festes Objektiv + sonyRX100III + 2.73 + 3:2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + DSC-RX100 VI & compatibles + fixed lens + festes Objektiv + sonyRX100VI + 2.66 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + DSC-HX300 & compatibles (Standard) + fixed lens + festes Objektiv + sonyHX300 + + 5.58 + 4:3 + + + + + + + + + Sony + Sony Xperia Z3 & compatibles + fixed lens + festes Objektiv + sonyXperiaZ3 + 7.87 + 4:3 + + + + + + + + Sony + Sony RX10 & compatibles + fixed lens + festes Objektiv + sonyRX10 + 2.73 + 3:2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + Sony RX10II & compatibles + fixed lens + festes Objektiv + sonyRX10II + 2.73 + 3:2 + + + + + + + + + + + + + + + + + + + + Sony + Sony RX10III & compatibles + fixed lens + festes Objektiv + sonyRX10III + 2.73 + + + + + + + + + + + + + + + + + + + + + + + + Carl Zeiss + DSC-RX1R & compatibles + fixed lens + festes Objektiv + sonyRX1 + 1 + 3:2 + + + + + + + + Sony + DSC-RX0M2 + fixed lens + festes Objektiv + sonyRX0M2 + 2.70 + + + + + + + + Sony + ZV-1 & compatibles + fixed lens + festes Objektiv + sonyZV1 + 2.7 + 3:2 + + + + + + + + + + + + + + + + + Contax/Yashica + M42 + M39/1 + DKL + T2 + Generic + + + + Contax G + M42 + M39/1 + DKL + T2 + Generic + + + + Contax + 35mm film: full frame + Contax/Yashica + 1 + + + + Contax + Zeiss 21mm f/2.8 Distagon + Contax/Yashica + 1 + + + + + + + Contax + Zeiss 28mm f/2.8 Distagon + Contax/Yashica + 1 + + + + + + + Contax + Contax G Planar T* 2/35 + Contax G + 1.534 + + + + + + + + + + + + + + Generic + + 4/3 System + Canon EF + Canon EF-M + Canon EF-S + Canon FD + Canon FL + Contax/Yashica + Contax G + Fujifilm G + Fujifilm X + Hasselblad 500 + Hasselblad H + Hasselblad X + Leica M + Leica R + Leica S + Leica L + M42 + M39/1 + M39 + DKL + Mamiya 645 + Micro 4/3 System + Minolta AF + Minolta MC + Minolta MD + Nikon CX + Nikon F + Nikon F AF + Nikon F AI + Nikon F AI-S + Nikon Z + Olympus OM + Pentax 645AF2 + Pentax Q + Pentax K + Pentax KA + Pentax KAF + Pentax KAF2 + Pentax KAF3 + Pentax KAF4 + Rollei 6x6 + Samsung NX + Samsung NX mini + Sigma SA + Sony Alpha + Sony E + Tamron Adaptall + T2 + C + Kiev 88 + + + + Generic + Generisch + Crop-factor 0.8 (Medium Format) + Crop-Faktor 0.8 (Mittelformat) + Generic + 0.79 + + + + Generic + Generisch + Crop-factor 1.0 (Full Frame) + Crop-Faktor 1.0 (Kleinbildformat) + Generic + 1 + + + + Generic + Generisch + Crop-factor 1.1 + Crop-Faktor 1.1 + Generic + 1.1 + + + + Generic + Generisch + Crop-factor 1.3 (APS-H) + Crop-Faktor 1.3 (APS-H) + Generic + 1.267 + + + + Generic + Generisch + Crop-factor 1.5 (APS-C) + Crop-Faktor 1.5 (APS-C) + Generic + 1.53 + + + + Generic + Generisch + Crop-factor 1.6 (APS-C) + Crop-Faktor 1.6 (Canon APS-C) + Generic + 1.611 + + + + Generic + Generisch + Crop-factor 1.7 + Crop-Faktor 1.7 (Sigma) + Generic + 1.739 + + + + Generic + Generisch + Crop-factor 2.0 (Four-Thirds) + Crop-Faktor 2.0 (Four-Thirds) + Generic + 2 + + + + Generic + Generisch + Rectilinear 10-1000mm f/1.0 + Rektilinear 10-1000mm f/1.0 + Generic + rectilinear + 1 + + + + Generic + Generisch + Fisheye 8-20mm f/1.0 + Fischauge 8-20mm f/1.0 + Generic + fisheye + 1 + + + + Generic + Generisch + Panoramic 10-100mm f/1.0 + Panoramaobjektiv 10-100mm f/1.0 + Generic + panoramic + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon EF-M + Canon EF-S + Canon EF + M42 + M39/1 + DKL + T2 + Generic + + + + Canon RF + Canon EF-S + Canon EF + M42 + M39/1 + DKL + T2 + Generic + + + + Canon + Canon EOS M + EOS M + Canon EF-M + 1.613 + + + + Canon + Canon EOS M2 + EOS M2 + Canon EF-M + 1.613 + + + + Canon + Canon EOS M3 + EOS M3 + Canon EF-M + 1.613 + + + + Canon + Canon EOS M5 + EOS M5 + Canon EF-M + 1.613 + + + + Canon + Canon EOS M6 + EOS M6 + Canon EF-M + 1.613 + + + + Canon + Canon EOS M6 Mark II + EOS M6 Mark II + Canon EF-M + 1.613 + + + + Canon + Canon EOS M10 + EOS M10 + Canon EF-M + 1.613 + + + + Canon + Canon EOS M50 + EOS M50 + Canon EF-M + 1.613 + + + + Canon + Canon EOS M50m2 + EOS M50 Mark II + Canon EF-M + 1.613 + + + + Canon + Canon EOS KISS M + EOS KISS M + Canon EF-M + 1.613 + + + + Canon + Canon EOS M100 + EOS M100 + Canon EF-M + 1.613 + + + + Canon + Canon EOS M200 + EOS M200 + Canon EF-M + 1.613 + + + + Canon + Canon EOS R7 + EOS R7 + Canon RF + 1.613 + + + + Canon + Canon EOS R10 + EOS R10 + Canon RF + 1.613 + + + + Canon + Canon EOS R50 + EOS R50 + Canon RF + 1.613 + + + + Canon + Canon EOS R50 V + EOS R50 V + Canon RF + 1.613 + + + + Canon + Canon EOS R100 + EOS R100 + Canon RF + 1.613 + + + + Canon + Canon EOS R + EOS R + Canon RF + 1 + + + + Canon + Canon EOS RP + EOS RP + Canon RF + 1 + + + + Canon + Canon EOS R1 + EOS R1 + Canon RF + 1 + + + + Canon + Canon EOS R3 + EOS R3 + Canon RF + 1 + + + + Canon + Canon EOS R5 + EOS R5 + Canon RF + 1 + + + + Canon + Canon EOS R5 C + EOS R5 C + Canon RF + 1 + + + + Canon + Canon EOS R5m2 + EOS R5 Mark II + Canon RF + 1 + + + + Canon + Canon EOS R6 + EOS R6 + Canon RF + 1 + + + + Canon + Canon EOS R6m2 + EOS R6 Mark II + Canon RF + 1 + + + + Canon + Canon EOS R6 Mark III + EOS R6 Mark III + Canon RF + 1 + + + + Canon + Canon EOS R8 + EOS R8 + Canon RF + 1 + + + + Canon + Canon EF-M 18-55mm f/3.5-5.6 IS STM + Canon EF-M + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-M 55-200mm f/4.5-6.3 IS STM + Canon EF-M + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-M 22mm f/2 STM + Canon EF-M + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-M 28mm f/3.5 Macro IS STM + Canon EF-M + 1.613 + + + + + + + + + + + + + + + + + + + Canon + Canon EF-M 15-45mm f/3.5-6.3 IS STM + Canon EF-M + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-M 11-22mm f/4-5.6 IS STM + Canon EF-M + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-M 32mm f/1.4 STM + Canon EF-M + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 24-105mm F4L IS USM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 24-105mm F4-7.1 IS STM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 24-240mm F4-6.3 IS USM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 50mm F1.8 STM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + Canon + Canon RF 70-200mm F2.8L IS USM + Canon RF + 1.0 + + + + + + + + + + + + + + Canon + Canon RF 85mm F1.2L USM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 100-500mm F4.5-7.1L IS USM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 85mm F2 MACRO IS STM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 100-400mm F5.6-8 IS USM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 100mm F2.8L Macro IS USM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 15-35mm F2.8L IS USM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 800mm F11 IS STM + Canon RF + 1.0 + + + + + + + + + + + Canon + Canon RF 16mm F2.8 STM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 14-35mm F4 L IS USM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + Canon + Canon RF 35mm F1.8 MACRO IS STM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF-S 18-150mm F3.5-6.3 IS STM + Canon RF + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 24-70mm F2.8L IS USM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 24mm F1.8 MACRO IS STM + Canon RF + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 28mm F2.8 STM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + Canon + Canon RF 15-30mm F4.5-6.3 IS STM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 24mm F1.8 MACRO IS STM + Canon RF + 1.0 + + + + + + + + + Canon + Canon RF 135mm F1.8L IS USM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 50mm F1.2 L USM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 28-70mm F2 L USM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF-S 18-45mm F4.5-6.3 IS STM + Canon RF + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 24-50mm F4.5-6.3 IS STM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 200-800mm F6.3-9 IS USM + Canon RF + 1.613 + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 600mm F11 IS STM + Canon RF + 1.613 + + + + + + + + + Canon + Canon RF 35mm F1.4 L VCM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + Canon + Canon RF-S 10-18mm F4.5-6.3 IS STM + Canon RF + 1.61 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 70-200mm F4L IS USM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + Canon + Canon RF 200-800mm F6.3-9 IS USM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 28-70mm F2.8 IS STM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon RF 24mm F1.4 L VCM + Canon RF + 1 + + + + + + + + + + + + + + + + + + + Canon + Canon RF 10-20mm f/4L IS STM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + Canon + Canon RF 45mm F1.2 STM + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + + + + + Fujifilm X + M42 + M39/1 + DKL + T2 + Generic + + + + Fujifilm G + Generic + + + + Fujifilm + X-Pro1 + Fujifilm X + 1.529 + + + + Fujifilm + X-Pro2 + Fujifilm X + 1.528 + + + + Fujifilm + X-E1 + Fujifilm X + 1.529 + + + + Fujifilm + X-E2 + Fujifilm X + 1.529 + + + + Fujifilm + X-E2S + Fujifilm X + 1.529 + + + + Fujifilm + X-E3 + Fujifilm X + 1.529 + + + + Fujifilm + X-E4 + Fujifilm X + 1.534 + + + + Fujifilm + X-E5 + Fujifilm X + 1.534 + + + + Fujifilm + X-T1 + Fujifilm X + 1.529 + + + + Fujifilm + X-T2 + Fujifilm X + 1.528 + + + + Fujifilm + X-T3 + Fujifilm X + 1.534 + + + + Fujifilm + X-T4 + Fujifilm X + 1.534 + + + + Fujifilm + X-T5 + Fujifilm X + 1.534 + + + + Fujifilm + X-Pro3 + Fujifilm X + 1.534 + + + + Fujifilm + X-H1 + Fujifilm X + 1.528 + + + + Fujifilm + X-H2 + Fujifilm X + 1.528 + + + + Fujifilm + X-H2S + Fujifilm X + 1.528 + + + + Fujifilm + X-M1 + Fujifilm X + 1.529 + + + + Fujifilm + X-M5 + Fujifilm X + 1.534 + + + + Fujifilm + X-A1 + Fujifilm X + 1.529 + + + + Fujifilm + X-A2 + Fujifilm X + 1.529 + + + + Fujifilm + X-T10 + Fujifilm X + 1.529 + + + + Fujifilm + X-T20 + Fujifilm X + 1.529 + + + + Fujifilm + X-T30 + Fujifilm X + 1.534 + + + + Fujifilm + X-T30 II + Fujifilm X + 1.534 + + + + Fujifilm + X-T30 III + Fujifilm X + 1.534 + + + + Fujifilm + X-T50 + Fujifilm X + 1.534 + + + + Fujifilm + X-S10 + Fujifilm X + 1.534 + + + + Fujifilm + X-S20 + Fujifilm X + 1.534 + + + + Fujifilm + X-T100 + Fujifilm X + 1.529 + + + + Fujifilm + X-T200 + Fujifilm X + 1.529 + + + + Fujifilm + X-A3 + Fujifilm X + 1.529 + + + + Fujifilm + X-A5 + Fujifilm X + 1.529 + + + + Fujifilm + X-A7 + Fujifilm X + 1.529 + + + + Fujifilm + X-A10 + Fujifilm X + 1.529 + + + + Fujifilm + GFX 50R + Fujifilm G + 0.79 + + + + Fujifilm + GFX 50S + Fujifilm G + 0.79 + + + + Fujifilm + GFX50S II + Fujifilm G + 0.79 + + + + Fujifilm + GFX 100 + Fujifilm G + 0.79 + + + + Fujifilm + GFX100S + Fujifilm G + 0.79 + + + + Fujifilm + GFX100S II + Fujifilm G + 0.79 + + + + Fujifilm + GFX100 II + Fujifilm G + 0.79 + + + + Fujifilm + XF18-55mmF2.8-4 R LM OIS + XF 18-55mm f/2.8-4 R LM OIS + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XC16-50mmF3.5-5.6 OIS + XC 16-50mm f/3.5-5.6 OIS + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XC50-230mmF4.5-6.7 OIS + XC 50-230mm f/4.5-6.7 OIS + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XC50-230mmF4.5-6.7 OIS II + XC 50-230mm f/4.5-6.7 OIS II + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF55-200mmF3.5-4.8 R LM OIS + XF 55-200mm f/3.5-4.8 R LM OIS + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF27mmF2.8 R WR + XF 27mm f/2.8 R WR + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF18mmF2 R + XF 18mm f/2 R + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + Fujifilm + XF35mmF1.4 R + XF 35mm f/1.4 R + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF60mmF2.4 R Macro + XF 60mm f/2.4 R Macro + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF23mmF1.4 R + XF 23mm f/1.4 R + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XC16-50mmF3.5-5.6 OIS II + XC 16-50mm f/3.5-5.6 OIS II + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF14mmF2.8 R + XF 14mm f/2.8 R + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF16mmF1.4 R WR + XF 16mm f/1.4 R WR + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF23mmF2 R WR + XF 23mm f/2 R WR + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF50mmF2 R WR + XF 50mm f/2 R WR + Fujifilm X + 1.528 + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF56mmF1.2 R APD + XF 56mm f/1.2 R APD + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF16-55mmF2.8 R LM WR + XF 16-55mm f/2.8 R LM WR + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + Fujifilm + XF56mmF1.2 R + XF 56mm f/1.2 R + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF10-24mmF4 R OIS + XF 10-24mm f/4 R OIS + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + + XF10-24mmF4 R OIS WR + XF 10-24mm f/4 R OIS WR + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF18-135mmF3.5-5.6R LM OIS WR + XF 18-135mm f/3.5-5.6R LM OIS WR + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF100-400mmF4.5-5.6 R LM OIS WR + XF 100-400mm f/4.5-5.6 R LM OIS WR + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF100-400mmF4.5-5.6 R LM OIS WR + 1.4x converter + XF 100-400mm f/4.5-5.6 R LM OIS WR + 1.4× conv. + XF 100-400mm f/4.5-5.6 R LM OIS WR + 1.4×-Konv. + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF16mmF2.8 R WR + XF 16mm f/2.8 R WR + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + Fujifilm + XF50-140mmF2.8 R LM OIS WR + XF 50-140mm f/2.8 R LM OIS WR + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XC15-45mmF3.5-5.6 OIS PZ + XC 15-45mm f/3.5-5.6 OIS PZ + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF35mmF2 R WR + XF 35mm f/2 R WR + Fujifilm X + 1.528 + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XC35mmF2 + XC 35mm f/2 + Fujifilm X + 1.528 + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF70-300mmF4-5.6 R LM OIS WR + XF 70-300mm f/4-5.6 R LM OIS WR + Fujifilm X + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF70-300mmF4-5.6 R LM OIS WR + 1.4x + XF 70-300mm f/4-5.6 R LM OIS WR + 1.4x + Fujifilm X + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF16-80mmF4 R OIS WR + XF 16-80mm f/4 R OIS WR + Fujifilm X + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + GF23mmF4 R LM WR + Fujifilm G + 0.79 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + GF45mmF2.8 R WR + Fujifilm G + 0.79 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + GF110mmF2 R LM WR + Fujifilm G + 0.79 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF33mmF1.4 R LM WR + XF 33mm f/1.4 R LM WR + Fujifilm X + 1.534 + + + + + + + + + + + + + + + + + + + + Fujifilm + XF90mmF2 R LM WR + XF 90mm f/2 R LM WR + Fujifilm X + 1.534 + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF23mmF1.4 R LM WR + XF 23mm f/1.4 R LM WR + Fujifilm X + 1.53 + + + + + + + + + + + + + + + + + + + Fujifilm + GF80mmF1.7 R WR + Fujifilm G + 0.79 + + + + + + + + + Fujifilm + GF55mmF1.7 R WR + Fujifilm G + 0.79 + + + + + + + + Fujifilm + XF56mmF1.2 R WR + XF 56mm f/1.2 R WR + Fujifilm X + 1.534 + + + + + + + + + Fujifilm + GF50mmF3.5 R LM WR + Fujifilm G + 0.79 + + + + + + + + + + + + + + + + + + + Fujifilm + XF16-50mmF2.8-4.8 R LM WR + XF 16-50mm f/2.8-4.8 R LM WR + Fujifilm X + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fujifilm + XF16-55mmF2.8 R LM WR II + XF 16-55mm f/2.8 R LM WR II + Fujifilm X + 1.534 + + + + + + + + + + + + + Fujifilm + XF30mmF2.8 R LM WR Macro + XF 30mm f/2.8 R LM WR Macro + Fujifilm X + 1.534 + + + + + + + + + + + + Hasselblad X + Generic + + + + Hasselblad + X1D II 50C + Hasselblad X + 0.79 + + + + Hasselblad + X2D 100C + Hasselblad X + 0.79 + + + + Hasselblad + X2D II 100C + Hasselblad X + 0.79 + + + + Hasselblad + CFV II 50C/907X + Hasselblad X + 0.79 + + + + Hasselblad + CFV 100C/907X + Hasselblad X + 0.79 + + + + + + + + Leica L + Leica M + M42 + M39/1 + DKL + T2 + Generic + + + + Leica Camera AG + Leica + Leica SL (Typ 601) + SL (Typ 601) + Leica L + 1 + + + + Leica Camera AG + Leica + Leica SL2 + SL2 + Leica L + 1 + + + + Leica Camera AG + Leica + Leica SL2-S + SL2-S + Leica L + 1 + + + + Leica Camera AG + Leica + Leica SL3 + SL3 + Leica L + 1 + + + + Leica Camera AG + Leica + Leica SL3-S + SL3-S + Leica L + 1 + + + + Leica Camera AG + Leica + Leica T (Typ 701) + T (Typ 701) + Leica L + 1.53 + + + + Leica Camera AG + Leica + Leica TL + TL + Leica L + 1.53 + + + + Leica Camera AG + Leica + Leica TL2 + TL2 + Leica L + 1.53 + + + + Leica Camera AG + Leica + Leica CL + CL (Typ 7323) + Leica L + 1.53 + + + + Leica + Digilux 3 + Micro 4/3 System + 2 + + + + Leica Camera AG + Leica + Summicron-TL 1:2/23 Asph. + Leica L + 1.53 + + + + + + + + + + + + + + + + + + Leica Camera AG + Leica + Summilux-TL 1:1.4/35 Asph. + Leica L + 1.53 + + + + + + + + Leica Camera AG + Leica + Elmarit-TL 1:2.8/18 Asph. + Leica L + 1.53 + + + + + + + + Leica Camera AG + Leica + Vario-Elmarit-SL 1:2.8/24-70 Asph. + Leica L + 1 + + + + + + + + + + + + Leica Camera AG + Leica + APO-Summicron-SL 1:2/50 Asph. + Leica L + 1 + + + + + + + + Leica Camera AG + Leica + APO-Summicron-SL 1:2/35 Asph. + Leica L + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Leica Camera AG + Leica + Vario-Elmarit-SL 1:2.8-4/24-90 ASPH. + Leica L + 1.0 + + + + + + + + + + + + + + + + + + + + + Nikon CX + Nikon F + Nikon F AI + Nikon F AI-S + Nikon F AF + M42 + M39/1 + DKL + T2 + Generic + + + + Nikon Z + Nikon F + Nikon F AI + Nikon F AI-S + Nikon F AF + M42 + M39/1 + DKL + T2 + Generic + + + + Nikon Corporation + Nikon + Nikon 1 S1 + 1 S1 + Nikon CX + 2.727 + + + + Nikon Corporation + Nikon + Nikon 1 V1 + 1 V1 + Nikon CX + 2.727 + + + + Nikon Corporation + Nikon + Nikon 1 J1 + 1 J1 + Nikon CX + 2.727 + + + + Nikon Corporation + Nikon + Nikon 1 AW1 + 1 AW1 + Nikon CX + 2.727 + + + + Nikon Corporation + Nikon + Nikon 1 S2 + 1 S2 + Nikon CX + 2.727 + + + + Nikon Corporation + Nikon + Nikon 1 V2 + 1 V2 + Nikon CX + 2.727 + + + + Nikon Corporation + Nikon + Nikon 1 J2 + 1 J2 + Nikon CX + 2.727 + + + + Nikon Corporation + Nikon + Nikon 1 V3 + 1 V3 + Nikon CX + 2.727 + + + + Nikon Corporation + Nikon + Nikon 1 J3 + 1 J3 + Nikon CX + 2.727 + + + + Nikon Corporation + Nikon + Nikon 1 J4 + 1 J4 + Nikon CX + 2.727 + + + + Nikon Corporation + Nikon + Nikon 1 J5 + 1 J5 + Nikon CX + 2.727 + + + + Nikon Corporation + Nikon + Nikon Z 5 + Z 5 + Nikon Z + 1 + + + + Nikon Corporation + Nikon + Nikon Z5_2 + Z5II + Nikon Z + 1 + + + + Nikon Corporation + Nikon + Nikon Z 6 + Z 6 + Nikon Z + 1 + + + + Nikon Corporation + Nikon + Nikon Z 6_2 + Z 6II + Nikon Z + 1 + + + + Nikon Corporation + Nikon + Nikon Z6_3 + Z6III + Nikon Z + 1 + + + + Nikon Corporation + Nikon + Nikon Z 7 + Z 7 + Nikon Z + 1 + + + + Nikon Corporation + Nikon + Nikon Z 7_2 + Z 7II + Nikon Z + 1 + + + + Nikon Corporation + Nikon + Nikon Z 8 + Z 8 + Nikon Z + 1 + + + + Nikon Corporation + Nikon + Nikon Z 9 + Z 9 + Nikon Z + 1 + + + + Nikon Corporation + Nikon + Nikon Z f + Z f + Nikon Z + 1 + + + + Nikon Corporation + Nikon + Nikon ZR + ZR + Nikon Z + 1 + + + + Nikon Corporation + Nikon + Nikon Z 30 + Z 30 + Nikon Z + 1.531 + + + + Nikon Corporation + Nikon + Nikon Z 50 + Z 50 + Nikon Z + 1.531 + + + + Nikon Corporation + Nikon + Nikon Z50_2 + Z50II + Nikon Z + 1.531 + + + + Nikon Corporation + Nikon + Nikon Z fc + Z fc + Nikon Z + 1.531 + + + + Nikon + 1 Nikkor VR 10-30mm f/3.5-5.6 + Nikon CX + 2.727 + + + + + + + + + + + + + + + + + + + Nikon + 1 Nikkor VR 30-110mm f/3.8-5.6 + Nikon CX + 2.727 + + + + + + + + + + + + + + + + + Nikon + 1 Nikkor AW 11-27.5mm f/3.5-5.6 + Nikon CX + 2.727 + + + + + + + + + + + + + + + + + + + + + Nikon + 1 Nikkor 18.5mm f/1.8 + Nikon CX + 2.727 + + + + + + + + + Nikon + 1 Nikkor 32mm f/1.2 + Nikon CX + 2.727 + + + + + + + + + Nikon + 1 Nikkor 10mm f/2.8 + Nikon CX + 2.727 + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + 1 Nikkor AW 10mm f/2.8 + Nikon CX + 2.727 + + + + + + + + + Nikon + Nikkor Z MC 50mm f/2.8 + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 14-24mm f/2.8 S + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 14-30mm f/4 S + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 24-70mm f/2.8 S + Nikon Z + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 24-70mm f/4 S + Nikon Z + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 20mm f/1.8 S + Nikon Z + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 50mm f/1.8 S + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 70-200mm f/2.8 VR S + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 85mm f/1.8 S + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 24-200mm f/4-6.3 VR + Nikon Z + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z DX 16-50mm f/3.5-6.3 VR + Nikon Z + 1.531 + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 35mm f/1.8 S + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 40mm f/2 + Nikon Z + 1 + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z MC 105mm f/2.8 VR S + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 28-75mm f/2.8 + Nikon Z + 1.0 + + + + + + + + + + + + + Nikon + Nikkor Z 24-120mm f/4 S + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 100-400mm f/4.5-5.6 VR S + Nikon Z + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 50mm f/1.2 S + Nikon Z + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z DX 50-250mm f/4.5-6.3 VR + Nikon Z + 1.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 28mm f/2.8 + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 135mm f/1.8 S Plena + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 85mm f/1.2 S + Nikon Z + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 600mm f/6.3 VR S + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 26mm f/2.8 + Nikon Z + 1 + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z DX 12-28mm f/3.5-5.6 PZ VR + Nikon Z + 1.531 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 28-400mm f/4-8 VR + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 180-600mm f/5.6-6.3 VR + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 35mm f/1.4 + Nikon Z + 1.0 + + + + + + + + + Nikon + Nikkor Z DX 18-140mm f/3.5-6.3 VR + Nikon Z + 1.531 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z DX 24mm f/1.7 + Nikon Z + 1.531 + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 400mm f/4.5 VR S + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor Z 50mm f/1.4 + Nikon Z + 1.0 + + + + + + + + + Nikon + Nikkor Z 70-180mm f/2.8 + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + Micro 4/3 System + M42 + M39/1 + DKL + T2 + Generic + + + + Olympus Imaging Corp. + Olympus + E-P1 + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-P2 + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-P3 + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-P5 + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-P7 + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-PL1 + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-PL1s + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-PL2 + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-PL3 + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-PL5 + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-PL6 + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-PL7 + Micro 4/3 System + 2 + + + + Olympus Corporation + Olympus + E-PL8 + Micro 4/3 System + 2 + + + + Olympus Corporation + Olympus + E-PL9 + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-PM1 + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-PM2 + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-M1 + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-M1MarkII + E-M1 II + Micro 4/3 System + 2 + + + + Olympus Corporation + Olympus + E-M1MarkIII + E-M1 III + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-M5 + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-M5MarkII + E-M5 II + Micro 4/3 System + 2 + + + + Olympus Corporation + Olympus + E-M5MarkIII + E-M5 III + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-M10 + Micro 4/3 System + 2 + + + + Olympus Corporation + Olympus + E-M10MarkII + E-M10 II + Micro 4/3 System + 2 + + + + Olympus Corporation + Olympus + E-M10 Mark III + E-M10 III + Micro 4/3 System + 2 + + + + Olympus Corporation + Olympus + E-M10MarkIIIS + E-M10 III S + Micro 4/3 System + 2 + + + + Olympus Corporation + Olympus + E-M10MarkIV + E-M10 IV + Micro 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + PEN-F + Micro 4/3 System + 2 + + + + Olympus + Olympus M.Zuiko Digital ED 12mm f/2.0 + Micro 4/3 System + + 2 + 4:3 + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 12-50mm f/3.5-6.3 EZ + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 14-42mm f/3.5-5.6 + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 14-42mm f/3.5-5.6 L + Micro 4/3 System + + 2 + 4:3 + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital 14-42mm f/3.5-5.6 II + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 14-42mm f/3.5-5.6 II R + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 14-150mm f/4.0-5.6 + Micro 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 14-150mm f/4.0-5.6 II + Micro 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital 17mm f/2.8 Pancake + Micro 4/3 System + 2 + 4:3 + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 45mm f/1.2 Pro + Micro 4/3 System + 2 + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital 45mm f/1.8 + Micro 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 17mm f/1.2 Pro + Micro 4/3 System + 2 + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital 17mm f/1.8 + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 40-150mm f/4.0-5.6 R + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 9-18mm f/4.0-5.6 + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 12-40mm f/2.8 Pro + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 12-100mm f/4.0 IS Pro + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 25mm f/1.2 Pro + Micro 4/3 System + 2 + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital 25mm f/1.8 + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 75mm f/1.8 + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 75-300mm f/4.8-6.7 II + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 14-42mm f/3.5-5.6 EZ + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 60mm f/2.8 Macro + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 7-14mm f/2.8 Pro + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + Olympus + OLYMPUS M.40-150mm F2.8 + Olympus M.Zuiko Digital ED 40-150mm F2.8 Pro + Micro 4/3 System + 2.0 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + M.40-150mm F2.8 + MC-14 + Olympus M.Zuiko Digital ED 40-150mm f/2.8 PRO + 1.4× conv. + Micro 4/3 System + 2.0 + 4:3 + + + + + + + + + + + + + Olympus + Olympus 9mm Body Cap Lens Fisheye + Micro 4/3 System + stereographic + 2 + 4:3 + + + + + + + + Olympus + Olympus M.Zuiko Digital ED 8mm f/1.8 Fisheye Pro + Micro 4/3 System + equisolid + 2 + 4:3 + + + + + + + + + Olympus + OLYMPUS M.12-200mm F3.5-6.3 + Olympus M.Zuiko Digital ED 12-200mm f/3.5-6.3 + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + OLYMPUS M.30mm F3.5 Macro + Olympus M.Zuiko Digital ED 30mm f/3.5 Macro + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + Olympus + OLYMPUS OM 12-45mm F4.0 + Olympus M.Zuiko Digital ED 12-45mm f/4.0 Pro + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + OLYMPUS M.8-25mm F4.0 + Olympus M.Zuiko Digital ED 8-25mm f/4.0 PRO + Micro 4/3 System + 2.0 + 4:3 + + + + + + + + + + + + + + + + + + + + + Panasonic + DMC-G1 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GF1 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GH1 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GM1 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GX1 + Micro 4/3 System + 2 + + + + Panasonic + DMC-G2 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GF2 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GH2 + Micro 4/3 System + 2 + + + + Panasonic + DMC-G3 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GF3 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GH3 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GH4 + Micro 4/3 System + 2 + + + + Panasonic + DC-GH5 + Micro 4/3 System + 2 + + + + Panasonic + DC-GH5M2 + Micro 4/3 System + 2 + + + + Panasonic + DC-GH5S + Micro 4/3 System + 2 + + + + Panasonic + DC-GH6 + Micro 4/3 System + 2 + + + + Panasonic + DC-GH7 + Micro 4/3 System + 2 + + + + Panasonic + DMC-G5 + Micro 4/3 System + 2 + + + + Panasonic + DC-G9 + Micro 4/3 System + 2 + + + + Panasonic + DC-G9M2 + Micro 4/3 System + 2 + + + + Panasonic + DC-GX9 + Micro 4/3 System + 2 + + + + Panasonic + DC-GX7MK3 + Micro 4/3 System + 2 + + + + Panasonic + DC-G100 + Micro 4/3 System + 2 + + + + Panasonic + DC-G100D + Micro 4/3 System + 2 + + + + Panasonic + DC-G110 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GF5 + Micro 4/3 System + 2 + + + + Panasonic + DMC-G6 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GF6 + Micro 4/3 System + 2 + + + + Panasonic + DMC-G7 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GF7 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GX7 + Micro 4/3 System + 2 + + + + Panasonic + DMC-G70 + Micro 4/3 System + 2 + + + + Panasonic + DMC-G10 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GM5 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GF8 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GX8 + Micro 4/3 System + 2 + + + + Panasonic + DMC-G80 + Micro 4/3 System + 2 + + + + + Panasonic + DMC-G81 + Micro 4/3 System + 2 + + + + + Panasonic + DMC-G85 + Micro 4/3 System + 2 + + + + + Panasonic + DMC-G8 + Micro 4/3 System + 2 + + + + Panasonic + DMC-GX80 + Micro 4/3 System + 2 + + + + + Panasonic + DMC-GX85 + Micro 4/3 System + 2 + + + + + Panasonic + DC-GX800 + Micro 4/3 System + 2 + + + + Panasonic + DC-GX880 + Micro 4/3 System + 2 + + + + + + Panasonic + DC-G90 + Micro 4/3 System + 2 + + + + + + + Panasonic + DC-G91 + Micro 4/3 System + 2 + + + + + + + Panasonic + DC-G95 + Micro 4/3 System + 2 + + + + + + + Panasonic + DC-G99 + Micro 4/3 System + 2 + + + + Panasonic + DC-G95D + Micro 4/3 System + 2 + + + + Panasonic + DC-G99D + Micro 4/3 System + 2 + + + + Panasonic + DC-G97 + Micro 4/3 System + 2 + + + + Panasonic + DC-S1 + Leica L + 1 + + + + Panasonic + DC-S1M2 + Leica L + 1 + + + + Panasonic + DC-S1M2ES + Leica L + 1 + + + + Panasonic + DC-S1H + Leica L + 1 + + + + Panasonic + DC-S1R + Leica L + 1 + + + + Panasonic + DC-S1RM2 + Leica L + 1 + + + + Panasonic + DC-S5 + Leica L + 1 + + + + Panasonic + DC-S5D + Leica L + 1 + + + + Panasonic + DC-S5M2 + Leica L + 1 + + + + Panasonic + DC-S5M2X + Leica L + 1 + + + + Panasonic + DC-S9 + Leica L + 1 + + + + Panasonic + Lumix G 14mm f/2.5 Asph. + Micro 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G 14mm f/2.5 Asph. + GWC1 0.79x + Lumix G 14mm f/2.5 Asph. + GWC1 0.79× + Micro 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G 20mm f/1.7 Asph. + Micro 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G X Vario PZ 14-42mm f/3.5-5.6 Asph. Power OIS + Micro 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G Vario 12-60mm f/3.5-5.6 Asph. Power OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + Panasonic + Lumix G Vario 14-42mm f/3.5-5.6 II Asph. Mega OIS + Micro 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G X Vario PZ 14-42mm f/3.5-5.6 Asph. Power OIS + GWC1 0.79x + Lumix G X Vario PZ 14-42mm f/3.5-5.6 Asph. Power OIS + GWC1 0.79× + Micro 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G Vario 14-45mm f/3.5-5.6 Asph. Mega OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G Vario HD 14-140mm f/4.0-5.8 Asph. Mega OIS + Micro 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + LEICA DG NOCTICRON 42.5/F1.2 + Leica DG Nocticron 42.5mm f/1.2 Asph. Power OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G Vario 45-200mm f/4.0-5.6 Mega OIS + Lumix G Vario 45-200mm f/4.0-5.6 Mega OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G Vario 45-200mm f/4.0-5.6 II + Lumix G Vario 45-200mm f/4.0-5.6 II Power OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G Vario 100-300mm f/4.0-5.6 Mega OIS + Micro 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + LUMIX G VARIO 100-300/F4.0-5.6II + Lumix G Vario 100-300mm f/4-5.6 II Power OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Leica DG Summilux 25mm f/1.4 Asph. + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Leica DG Summilux 25mm f/1.4 II + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + LUMIX G VARIO 35-100/F2.8 + Lumix G X Vario 35-100mm f/2.8 Power OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + Panasonic + LUMIX G VARIO 35-100/F2.8II + + Lumix G X Vario 35-100mm f/2.8 II Power OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + Panasonic + Lumix G X Vario 12-35mm f/2.8 Asph. Power OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G X Vario 12-35mm f/2.8 II Asph. Power OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G 20mm f/1.7 II Asph. + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G Vario 35-100mm f/4.0-5.6 Asph. Mega OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G Vario 45-150mm f/4.0-5.6 Asph. Mega OIS + Micro 4/3 System + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G Vario 7-14mm f/4.0 Asph. + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + Panasonic + Leica DG Macro-Elmarit 45mm f/2.8 + Leica DG Macro-Elmarit 45mm f/2.8 Asph. Mega OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + Panasonic + Lumix G X Vario PZ 45-175mm f/4.0-5.6 Asph. Power OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + Panasonic + Leica DG Summilux 15mm f/1.7 Asph. + Micro 4/3 System + 2.0 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G Vario 12-32mm f/3.5-5.6 Asph. Mega OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G 14mm f/2.5 II + Lumix G 14mm f/2.5 II Asph. + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G 42.5mm f/1.7 + Lumix G 42.5mm f/1.7 Asph. Power OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + Panasonic + Lumix G Vario 14-140mm f/3.5-5.6 + Lumix G Vario 14-140mm f/3.5-5.6 Asph. Power OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G Vario 14-140mm f/3.5-5.6 II + Lumix G Vario 14-140mm f/3.5-5.6 Asph. II Power OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G 25mm f/1.7 Asph. + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + LEICA DG 12-60/F2.8-4.0 + Leica DG Vario-Elmarit 12-60mm f/2.8-4.0 Asph. Power OIS + Micro 4/3 System + 2.0 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + LEICA DG 8-18/F2.8-4.0 + Leica DG Vario-Elmarit 8-18mm f/2.8-4 Asph. + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + LEICA DG 10-25/F1.7 + Leica DG Vario-Summilux 10-25mm f/1.7 Asph. + Micro 4/3 System + 2.0 + + + + + + + + + + + + + + + + + + + + Panasonic + LEICA DG 100-400/F4.0-6.3 + Leica DG Vario-Elmar 100-400mm f/4.0-6.3 Asph. Power OIS + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix G Macro 30mm f/2.8 + Lumix G Macro 30mm f/2.8 Asph. Mega OIS + Micro 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix S 20-60/F3.5-5.6 + Lumix S 20-60mm f/3.5-5.6 + Leica L + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix S 70-300/F4.5-5.6 + Lumix S 70-300mm f/4.5-5.6 + Leica L + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix S 24/F1.8 + Lumix S 24mm f/1.8 + Leica L + 1.0 + + + + + + + + + + + + + + + + + + + Panasonic + LUMIX S 50/F1.8 + Lumix S 50mm f/1.8 + Leica L + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + Lumix S 85/F1.8 + Lumix S 85mm f/1.8 + Leica L + 1.0 + + + + + + + + + + + + + + + + + + + Panasonic + LUMIX S 100mm F2.8 MACRO + Lumix S 100mm f/2.8 Macro + Leica L + + + 1 + + + + + + + + + + Panasonic + Leica D Summilux 25mm F1.4 Asph. + Leica D Summilux 25mm f/1.4 Asph. + Micro 4/3 System + 2.0 + + + + + + + + Panasonic + LEICA DG 50-200/F2.8-4.0 + Leica DG Vario-Elmarit 50-200mm f/2.8-4 Asph. OIS + Micro 4/3 System + 2.0 + 4:3 + + + + + + + + + + + + + + + + + Panasonic + Leica D Vario-Elmar 14-150mm f/3.5-5.6 Asph. OIS + 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + Panasonic + LEICA DG SUMMILUX 9/F1.7 + Leica DG Summilux 9mm f/1.7 Asph. + Micro 4/3 System + 2 + 4:3 + + + + + + + + + Panasonic + Lumix S 16-35/F4 + Lumix S Pro 16-35mm f/4 + Leica L + 1 + + + + + + + + + + + + + + + + + Panasonic + Lumix S 35/F1.8 + Lumix S 35mm f/1.8 + Leica L + 1 + + + + + + + + Panasonic + Lumix S 50/F1.4 + Lumix S Pro 50mm f/1.4 + Leica L + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + LUMIX S 28-200/F4-7.1 + Lumix S 28–200mm f/4–7.1 Macro OIS + Leica L + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + LUMIX S 24-60/F2.8 + Lumix S 24-60mm f/2.8 + Leica L + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + LUMIX S 18-40/F4.5-6.3 + Lumix S 18-40mm f/4.5-6.3 + Leica L + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Panasonic + LUMIX S 24-105/F4 + Lumix S 24-105mm f/4 Macro OIS + Leica L + 1.0 + + + + + + + + + + + + + + + + + + + Panasonic + Lumix S 14-28/F4-5.6 + Lumix S 14-28mm f/4-5.6 Macro + Leica L + 1.0 + + + + + + + + + + + + + + + + + Pentax Q + Generic + + + + Pentax + Pentax Q + Q + Pentax Q + 5.53 + + + + Pentax + Pentax Q7 + Q7 + Pentax Q + 4.6 + + + + Pentax + Pentax Q10 + Q10 + Pentax Q + 5.53 + + + + Pentax + Pentax Q-S1 + Q-S1 + Pentax Q + 4.6 + + + + Pentax + 01 Standard Prime 8.5mm f/1.9 AL [IF] + Pentax Q + + + 5.53 + 4:3 + + + + + + + + + + + Samsung NX + M42 + M39/1 + DKL + T2 + Generic + + + + Samsung NX mini + M42 + M39/1 + DKL + T2 + Generic + + + + Samsung + EK-GN120 + Galaxy NX + Samsung NX + 1.531 + + + + Samsung + NX10 + Samsung NX + 1.525 + + + + Samsung + NX11 + Samsung NX + 1.525 + + + + Samsung + NX100 + Samsung NX + 1.525 + + + + Samsung + NX1000 + Samsung NX + 1.525 + + + + Samsung + NX20 + Samsung NX + 1.525 + + + + Samsung + NX200 + Samsung NX + 1.525 + + + + Samsung + NX210 + Samsung NX + 1.525 + + + + Samsung + NX300 + Samsung NX + 1.531 + + + + Samsung + NX300M + Samsung NX + 1.531 + + + + Samsung + NX500 + Samsung NX + 1.531 + + + + Samsung + NX1100 + Samsung NX + 1.531 + + + + Samsung + NX2000 + Samsung NX + 1.531 + + + + Samsung + NX3000 + Samsung NX + 1.531 + + + + Samsung + NX1 + Samsung NX + 1.531 + + + + Samsung + NX5 + Samsung NX + 1.525 + + + + Samsung + NX30 + Samsung NX + 1.531 + + + + Samsung + NX mini + Samsung NX mini + 2.727 + + + + Samsung + Samsung NX 20-50mm f/3.5-5.6 ED + Samsung NX + + 1.528 + + + + + + + + + + + + Samsung + Samsung NX 30mm f/2 Pancake + Samsung NX + + 1.528 + + + + + + + Samsung + Samsung NX 16mm f/2.4 Pancake + Samsung NX + 1.525 + + + + + + + + + Samsung + Samsung NX 18-55mm f/3.5-5.6 OIS + Samsung NX + 1.531 + + + + + + + + + + + + + + + + + + + + + Samsung + Samsung NX 45mm f/1.8 2D/3D + Samsung NX + 1.525 + + + + + + + + + + Samsung + Samsung NX 20mm f/2.8 Pancake + Samsung NX + 1.525 + + + + + + + + + Samsung + Samsung NX 16-50mm f/3.5-5.6 PZ ED OIS + Samsung NX + 1.525 + + + + + + + + + + + + Samsung + Samsung NX 10mm f/3.5 Fisheye + Samsung NX 10mm f/3.5 Fischauge + Samsung NX + equisolid + 1.531 + + + + + + + + + Samsung + Samsung NX 50-200mm f/4-5.6 + Samsung NX + 1.531 + + + + + + + + + + + + + + + + + + + + + Samsung + Samsung NX 16-50mm f/2-2.8 S + Samsung NX + 1.531 + + + + + + + + + + + + + + Samsung + Samsung NX 50-150mm F2.8 S + Samsung NX + 1.531 + + + + + + + + + + + + Samsung + NX-M 9mm F3.53.5-5.6 + Samsung NX-M 9mm f/3.5 ED + Samsung NX mini + 2.727 + + + + + + + + Samsung + NX-M 9-27mm F3.5-5.6 + Samsung NX-M 9-27mm f/3.5-5.6 ED OIS + Samsung NX mini + 2.727 + + + + + + + + + + + + + + + + Samyang + Samyang 7.5mm f/3.5 UMC Fish-eye MFT + Samyang 7.5mm f/3.5 UMC Fischauge MFT + Micro 4/3 System + + + fisheye + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Samyang + Samyang 8mm f/2.8 UMC Fish-eye + Samyang 8mm f/2.8 UMC Fischauge + Sony E + Fujifilm X + Samsung NX + stereographic + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + Samyang + Samyang 50mm f/1.4 AS UMC + Sony E + 1.534 + + + + + + + + + Samyang + Samyang 12mm f/2.0 NCS CS + Sony E + Fujifilm X + Micro 4/3 System + Samsung NX + Canon EF-M + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + Samyang + Samyang AF 35mm f/2.8 + Sony E + 1.0 + + + + + + + + + + + + + + + + + + + + Samyang + Samyang AF 14mm f/2.8 + Samyang AF 14mm f/2.8 + Sony E + Canon EF + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + Samyang + Samyang AF 24mm f/2.8 + Samyang AF 24mm f/2.8 + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Samyang + Samyang AF 45mm f/1.8 + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Samyang + Samyang AF 85mm f/1.4 + Sony E + 1 + + + + + + + + + + + + + + + + Samyang + Samyang AF 24mm f/1.8 + Sony E + 1 + + + + + + + + + Samyang + Samyang AF 12mm f/2.0 + Sony E + Fujifilm X + 1.534 + + + + + + + + + Samyang + Samyang AF 18mm f/2.8 + Sony E + 1 + + + + + + + + Samyang + Samyang AF 75mm f/1.8 + Sony E + 1 + + + + + + + + + + + + + + Samyang + Samyang AF 35mm f/1.8 + Sony E + 1 + + + + + + + + + + + + + + Samyang + Samyang XP 10mm f/3.5 + Canon EF + 1.005 + + + + + + + + + + + + + Sigma + Sigma BF + BF + Leica L + 1 + + + + Sigma + Sigma fp + fp + Leica L + 1 + + + + Sigma + Sigma fp L + fp L + Leica L + 1 + + + + Sigma + sd Quattro + Sigma SA + 1.523 + + + + Sigma + sd Quattro H + Sigma SA + 1.346 + + + + Sigma + E 30mm f/2.8 + Sigma 30mm f/2.8 EX DN + Sony E + Micro 4/3 System + 1.534 + + + + + + + + + + + + + + + Sigma + Sigma 30mm f/2.8 EX DN + Sony E + Micro 4/3 System + 2 + 4:3 + + + + + + + + Sigma + Sigma 19mm f/2.8 EX DN + Sony E + Micro 4/3 System + 2 + 4:3 + + + + + + + + Sigma + Sigma 19mm f/2.8 EX DN + Sony E + Micro 4/3 System + 1.534 + + + + + + + + + Sigma + Sigma 56mm F1.4 DC DN | C 018 + Micro 4/3 System + 2.0 + + + + + + + + Sigma + Sigma 56mm F1.4 DC DN | Contemporary 018 + Sigma 56 mm F1.4 DC DN | C 018 + Sony E + Fujifilm X + Leica L + Canon EF-M + Nikon Z + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 60mm f/2.8 DN + Sony E + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + Sigma + Sigma 60mm f/2.8 DN + Sony E + Micro 4/3 System + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 19mm f/2.8 DN + Sony E + Micro 4/3 System + 1.534 + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 19mm f/2.8 DN + Micro 4/3 System + Sony E + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + SIGMA 30mm f/1.4 DC DN | Contemporary C 016 + 30mm f/1.4 DC DN + Sony E + Micro 4/3 System + Nikon Z + Fujifilm X + Leica L + Canon EF-M + Canon RF + 1.534 + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 16mm f/1.4 DC DN | Contemporary C 017 + Sigma 16mm f/1.4 DC DN C + Micro 4/3 System + Sony E + 2 + 4:3 + + + + + + + + + Sigma + Sigma 16mm f/1.4 DC DN | Contemporary 017 + Sigma 16mm f/1.4 DC DN Contemporary + Micro 4/3 System + Sony E + Fujifilm X + Leica L + Canon EF-M + Canon RF + Nikon Z + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + 105mm F1.4 DG HSM | Art 018 + Sigma 105 mm F1.4 DG HSM Art + Sony E + Canon EF + Leica L + Nikon F AF + Sigma SA + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + 35mm F1.2 DG DN | Art 019 + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + 14-24mm F2.8 DG DN | Art 019 + Sony E + Leica L + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + 85mm F1.4 DG DN | Art 020 + Sony E + Leica L + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + 105mm F2.8 DG DN MACRO | Art 020 + Sony E + Leica L + 1.0 + + + + + + + + + + + + + + + + + + Sigma + Sigma 18-50mm F2.8 DC DN | Contemporary 021 + Sony E + Leica L + Fujifilm X + Canon RF + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + 45mm F2.8 DG DN | Contemporary 019 + Sony E + Leica L + 1.0 + + + + + + + + + + + + + + + + + + + + + + Sigma + 40mm F1.4 DG HSM | Art 018 + Sigma 40mm F1.4 DG HSM | Art + Canon EF + Leica L + Sony E + Nikon F AF + Sigma SA + 1.0 + + + + + + + + + + + + + + + + + + Sigma + 20mm F2 DG DN | Contemporary 022 + Sony E + Leica L + 1.0 + + + + + + + + + Sigma + 24mm F2 DG DN | Contemporary 021 + Sony E + Leica L + 1.0 + + + + + + + + + Sigma + 24-70mm F2.8 DG DN | Art 019 + Sony E + Leica L + 1.0 + + + + + + + + + + + + + + + + + + + Sigma + 35mm F2 DG DN | Contemporary 020 + Sony E + Leica L + 1.0 + + + + + + + + + Sigma + 65mm F2 DG DN | Contemporary 020 + Sony E + Leica L + 1.0 + + + + + + + + + Sigma + 90mm F2.8 DG DN | Contemporary 021 + Leica L + Sony E + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + 28-70mm F2.8 DG DN | Contemporary 021 + Sony E + Leica L + 1.0 + + + + + + + + + + + + + Sigma + 16-28mm F2.8 DG DN | Contemporary 022 + Sony E + Leica L + 1.0 + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 10-18mm F2.8 DC DN | Contemporary 023 + Sony E + Fujifilm X + Leica L + Canon RF + 1.534 + + + + + + + + + + Sigma + 24mm F3.5 DG DN | Contemporary 021 + Leica L + Sony E + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 28mm F1.4 DG HSM | A + 28mm F1.4 DG HSM | Art + Nikon F AF + Leica L + Sony E + Canon EF + Sigma SA + 1 + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 28mm F1.4 DG HSM | A + 28mm F1.4 DG HSM | Art + Nikon F AF + Leica L + Sony E + Canon EF + Sigma SA + 1.534 + + + + + + + + + + + + + + + + + + + Sigma + 17mm F4 DG DN | Contemporary 023 + Leica L + Sony E + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 24-35mm f/2 DG HSM | Art 015 + Canon EF + Nikon F AF + Sigma SA + 1.605 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + 16-300mm F3.5-6.7 DC OS | Contemporary 025 + Sigma 16-300mm F3.5-6.7 DC OS | C + Fujifilm X + Canon RF + Sony E + Leica L + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 17-40mm F1.8 DC | Art 025 + Canon RF + 1.6 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony E + M42 + M39/1 + DKL + T2 + Generic + + + + Sony + NEX-3 + Sony E + 1.534 + + + + Sony + NEX-C3 + Sony E + 1.534 + + + + Sony + NEX-F3 + Sony E + 1.534 + + + + Sony + NEX-3N + Sony E + 1.534 + + + + Sony + NEX-5 + Sony E + 1.534 + + + + Sony + NEX-5N + Sony E + 1.534 + + + + Sony + NEX-5R + Sony E + 1.534 + + + + Sony + NEX-5T + Sony E + 1.534 + + + + Sony + NEX-6 + Sony E + 1.534 + + + + Sony + NEX-7 + Sony E + 1.534 + + + + Sony + ILCE-6000 + Alpha 6000 + Sony E + 1.534 + + + + Sony + ILCE-3000 + Alpha 3000 + Sony E + 1.534 + + + + Sony + ILCE-5000 + Alpha 5000 + Sony E + 1.534 + + + + Sony + ILCE-5100 + Alpha 5100 + Sony E + 1.534 + + + + Sony + ILCE-7 + Alpha 7 + Sony E + 1 + + + + Sony + ILCE-7R + Alpha 7R + Sony E + 1 + + + + Sony + ILCE-7RM2 + Alpha 7R II + Sony E + 1 + + + + Sony + ILCE-7M3 + Alpha 7 III + Sony E + 1 + + + + Sony + ILCE-7RM3 + Alpha 7R III + Sony E + 1 + + + + Sony + ILCE-7RM3A + Alpha 7R IIIA + Sony E + 1 + + + + Sony + ILCE-7M4 + Alpha 7 IV + Sony E + 1 + + + + Sony + ILCE-7M5 + Alpha 7 V + Sony E + 1 + + + + Sony + ILCE-7RM4 + Alpha 7R IV + Sony E + 1 + + + + Sony + ILCE-7RM4A + Alpha 7R IV A + Sony E + 1 + + + + Sony + ILCE-7RM5 + Alpha 7R V + Sony E + 1 + + + + Sony + ILCE-7S + Alpha 7S + Sony E + 1 + + + + Sony + ILCE-7M2 + Alpha 7 II + Sony E + 1 + + + + Sony + ILCE-7C + Alpha 7C + Sony E + 1 + + + + Sony + ILCE-7CM2 + Alpha 7C II + Sony E + 1 + + + + Sony + ILCE-7CR + Alpha 7CR + Sony E + 1 + + + + Sony + ILCE-7SM2 + Alpha 7S II + Sony E + 1 + + + + Sony + ILCE-7SM3 + Alpha 7S III + Sony E + 1 + + + + Sony + ILCE-6100 + Alpha 6100 + Sony E + 1.534 + + + + Sony + ILCE-6300 + Alpha 6300 + Sony E + 1.534 + + + + Sony + ILCE-6400 + Alpha 6400 + Sony E + 1.534 + + + + Sony + ILCE-6500 + Alpha 6500 + Sony E + 1.534 + + + + Sony + ILCE-6600 + Alpha 6600 + Sony E + 1.534 + + + + Sony + ILCE-6700 + Alpha 6700 + Sony E + 1.534 + + + + Sony + ILCE-9 + Alpha 9 + Sony E + 1 + + + + Sony + ILCE-9M2 + Alpha 9 II + Sony E + 1 + + + + Sony + ILCE-9M3 + Alpha 9 III + Sony E + 1 + + + + Sony + ILCE-1 + Alpha 1 + Sony E + 1 + + + + Sony + ILCE-1M2 + Alpha 1 II + Sony E + 1 + + + + Sony + ILME-FX2 + FX2 + Sony E + 1 + + + + Sony + ILME-FX3 + FX3 + Sony E + 1 + + + + Sony + ILME-FX30 + FX30 + Sony E + 1.546 + + + + Sony + ZV-E1 + Sony E + 1 + + + + Sony + ZV-E10 + Sony E + 1.534 + + + + Sony + ZV-E10M2 + ZV-E10 II + Sony E + 1.534 + + + + Sony + E 16mm f/2.8 + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + E 18-55mm f/3.5-5.6 OSS + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + E 50mm f/1.8 OSS + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + E 55-210mm f/4.5-6.3 OSS + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + VCL-ECF1 fisheye converter + VCL-ECF1 Fischauge-Vorsatz + Sony E + fisheye + 1.534 + + + + + + + + + + + + + + + + + + + + Sony + VCL-ECU1 ultra wide converter + VCL-ECU1 Ultraweitwinkel-Vorsatz + Sony E + 1.534 + + + + + + + + + Sony + E 10-18mm f/4 OSS + Sony E + 1.534 + + + + + + + + + + + + + + + + + Sony + E 10-18mm f/4 OSS + Sony E + 1 + + + + + + + + + + + + Sony + E 18-200mm f/3.5-6.3 OSS + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + E 24mm f/1.8 ZA + Sony E + 1.534 + + + + + + + + + Sony + E 30mm f/3.5 Macro + Sony E + 1.534 + + + + + + + + Sony + E PZ 16-50mm f/3.5-5.6 OSS + E 16-50mm f/3.5-5.6 OSS PZ + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + E 18-200mm f/3.5-6.3 OSS LE + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + E 35mm f/1.8 OSS + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + Sony + E 20mm f/2.8 + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + + + + + Sony + E 16-70mm f/4 ZA OSS + Sony E + 1.534 + + + + + + + + + + + + + + + + + Sony + E PZ 18-105mm f/4 G OSS + Sony E + 1.534 + + + + + + + + + + + + + + + + + Sony + E 18-135mm f/3.5-5.6 OSS + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 28-70mm f/3.5-5.6 OSS + Sony E + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 70-300mm f/4.5-5.6 G OSS + Sony E + 1 + + + + + + + + + + + + + + + + + Sony + FE 35mm f/1.4 ZA + Sony E + 1 + + + + + + + + Sony + FE 35mm f/1.8 + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 55mm f/1.8 ZA + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 24-70mm f/4 ZA OSS + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + Sony + FE 24-70mm f/4 ZA OSS + Sony E + 1 + + + + + + + + + + + + + + + + + + + Sony + FE 28mm f/2 + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 21mm f/2.8 + FE 28mm f/2 + Sony SEL075 UWC + Sony E + 1 + + + + + + + + Sony + FE 90mm f/2.8 Macro G OSS + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 24-240mm f/3.5-6.3 OSS + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 70-200mm f/4 G OSS + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 70-200mm f/2.8 GM OSS + Sony E + 1 + + + + + + + + + + + Sony + FE 16-35mm f/2.8 GM + Sony E + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 16-35mm f/4 ZA OSS + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 85mm f/1.4 GM + Sony E + 1.0 + + + + + + + + + + + + + + + + + + Sony + FE 85mm f/1.8 + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 24-70mm f/2.8 GM + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 24-105mm f/4 G OSS + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 35mm f/2.8 ZA + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 50mm f/1.8 + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 12-24mm f/4 G + Sony E + 1 + + + + + + + + + + + + Sony + FE 100-400mm f/4.5-5.6 GM OSS + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + E 16-55mm f/2.8 G + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + E 70-350mm f/4.5-6.3 G OSS + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 200-600mm f/5.6-6.3 G OSS + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 20mm f/1.8 G + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 50mm f/2.5 G + Sony E + 1 + + + + + + + + + Sony + FE 24mm f/2.8 G + Sony E + 1 + + + + + + + + + Sony + FE 35mm f/1.4 GM (SEL35F14GM) + Sony E + 1 + + + + + + + + + Sony + FE 24mm f/1.4 GM + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 50mm f/2.8 Macro + Sony E + 1.0 + + + + + + + + + Sony + FE 50mm f/2.8 Macro + Sony E + 1.534 + + + + + + + + + + + + + + + + + + Sony + E 11mm f/1.8 + Sony E + 1.534 + + + + + + + + + Sony + FE 14mm f/1.8 GM + Sony E + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 40mm f/2.5 G + Sony E + 1.0 + + + + + + + + + Sony + FE 50mm f/1.2 GM + Sony E + 1.0 + + + + + + + + + Sony + FE 28-60mm f/4-5.6 + Sony E + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 20-70mm f/4 G + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + FE 24-70mm f/2.8 GM II + Sony E + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + E 17-70mm F2.8 B070 + Tamron 17-70mm F/2.8 Di III-A VC RXD + Sony E + 1.534 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron 18-200mm f/3.5-6.3 Di III VC + Sony E + Canon EF-M + 1.534 + + + + + + + + + + + + + + + + + + + Tamron + 14-150mm F/3.5-5.8 DiIII C001: + Tamron 14-150mm f/3.5-5.8 Di III + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + E 28-75mm F2.8-2.8 + Tamron E 28-75mm F2.8-2.8 + Sony E + + + rectilinear + 1 + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + E 20mm F2.8 F050 + Tamron 20mm F2.8 Di III OSD M1:2 + Sony E + + + rectilinear + 1 + + + + + + + + + Tamron + E 17-28mm F2.8-2.8 + Tamron E 17-28mm F2.8-2.8 + Sony E + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + E 28-200mm F2.8-5.6 A071 + Tamron E 28-200mm F2.8-5.6 A071 + Sony E + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + E 18-300mm F3.5-6.3 B061 + Tamron E 18-300mm F3.5-6.3 B061 + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + + Tamron + 18-300mm F3.5-6.3 DiIII-A VC VXD B061X + Tamron 18-300mm F3.5-6.3 DiIII-A VC VXD B061X + Fujifilm X + 1.534 + + + + + + + + + + + + + + + + + + + + Tamron + E 70-180mm F2.8 A056 + Tamron 70-180mm f/2.8 Di III VXD A056 + Sony E + 1.0 + + + + + + + + + + + + + + + + Tamron + E 35mm F2.8 F053 + Tamron E 35mm F2.8 F053 + Sony E + 1.0 + + + + + + + + + Tamron + E 24mm F2.8 + Tamron E 24mm F2.8 + Sony E + 1.5 + + + + + + + + + Tamron + + + Tamron E 150-500mm F/5-6.7 Di III VC VXD A057Z + Tamron 150-500mm F5-6.7 Di III VC VXD + Sony E + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + + Tamron E 11-20mm F2.8 DiIII-A RXD B060X RF + Tamron 11-20mm f/2.8 Di III-A RXD (B060) + Sony E + Canon RF + Fujifilm X + 1.534 + + + + + + + + + + + + + + + + + Tamron + Tamron E 28-75mm F/2.8 Di III VXD G2 A063Z + Tamron 28-75mm F2.8 Di III VXD G2 (A063) + Sony E + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + E 50-400mm F4.5-6.3 A067 + Tamron 50-400 mm F4.5-6.3 Di III VC VXD (A067) + Sony E + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron E 35-150mm f/2-2.8 2.0-2.8 Di III VXD A058Z + Tamron 35-150mm F/2-2.8 Di III VXD + Nikon Z + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + E 70-180mm F2.8 A065 + Tamron 70-180mm F/2.8 Di III VC VXD G2 + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tokina + E 20mm f/2 + Sony E + 1 + + + + + + + + + Tokina + Tokina AT-X M35 PRO DX (AF 35mm f/2.8 Macro) + Nikon F AF + Canon EF + 1.534 + + + + + + + + + + + + + Zeiss + Touit 1.8/32 + Touit 32mm f/1.8 + Fujifilm X + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Zeiss + E 25mm f/2 + Batis 25mm f/2 + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Zeiss + ZEISS Batis 2/25 + + Batis 25mm f/2 + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Zeiss + E 85mm F1.8 + Batis 85mm f/1.8 + Sony E + 1 + + + + + + + + Zeiss + E 50mm F2 + Loxia 50mm f/2 Planar T* + Sony E + 1 + + + + + + + + Zeiss + E 21mm F2.8 + Loxia 21mm f/2.8 + Sony E + 1 + + + + + + + + + Zeiss + Zeiss Batis 2.8/18 + Batis 18mm f/2.8 + Sony E + 1 + + + + + + + + + Zeiss + Touit 2.8/12 + Fujifilm X + Sony E + 1.53 + + + + + + + + + + + + + + + + + + + + + + + Zeiss + Distagon 18mm f/4 + Sony E + 1 + + + + + + + + Zeiss + Distagon 28mm f/2.8 MMJ + Sony E + 1 + + + + + + + + Zeiss + Planar 50mm f/1.7 AEJ + Sony E + 1 + + + + + + + + Zeiss + Sonnar 85mm f/2.8 AEJ + Sony E + 1 + + + + + + + + + + + + M42 + Tamron Adaptall + Generic + + + + M39/1 + Generic + + + + DKL + Generic + + + + T2 + Generic + + + + C + Tamron Adaptall + Generic + + + + Kiev 88 + Generic + + + + + Nokia + Lumia 1020 + lumia1020 + 3.93 + + + + Microsoft + Lumia 950 + lumia950 + 6.02 + + + + Microsoft + Lumia 950 XL + lumia950 + 6.02 + + + + SEIKO EPSON CORP. + Epson + R-D1 + Leica M + 1.525 + + + + YI Technology + M1 + Micro 4/3 System + 2 + + + + LG Mobile + LG + LG-H815 + LG G4 + lgH815 + 6.34 + + + + Huawei + VOG-L29 + P30 Pro + vogl29 + 4.86 + + + + Huawei + CLT-L29 + P20 Pro + cltl29 + 4.55 + + + + Huawei + WAS-LX1A + P10 Lite + waslx1a + 6.88 + + + + Nokia + Lumia 1520 + lumia1520 + 6.26 + + + + Honor + DLI-L22 + 6A + dlil22 + 8.235 + + + + Apple + iPhone XS + iPhoneXS + 6.118 + + + + Apple + iPhone XS (tele) + iPhoneXStele + 8.667 + + + + Apple + iPhone XS back camera 4.25mm f/1.8 & compatibles + fixed lens + festes Objektiv + iPhoneXS + 6.118 + 4:3 + + + + + + + + + + Apple + iPhone XS back camera 6mm f/2.4 & compatibles + fixed lens + festes Objektiv + iPhoneXStele + 8.667 + 4:3 + + + + + + + + + + + Fujian + 35mm f/1.7 + C + 2 + 4:3 + + + + + + + + + Zeiss + Lumia 1020 + fixed lens + festes Objektiv + lumia1020 + 3.93 + 16:9 + + + + + + + + Zeiss + Lumia 950 + fixed lens + festes Objektiv + lumia950 + 6.02 + 4:3 + + + + + + + Pentacon + Pentacon 50mm f/1.8 auto multi coating + M42 + 1.526 + + + + + + + + + Cosina + Cosina Cosinon-S 50mm 1:2 + Pentax K + 1.538 + + + + + + + + + Cosina + 24mm 1:2.0 Macro + Pentax K + 1.526 + + + + + + + + Cosina + Cosinon-W 28mm 1:2.8 + Pentax K + 1.53 + + + + + + + + Cosina + Cosinon-W 35mm 1:2.8 + Pentax K + 1.53 + + + + + + + + Cosina + Cosinon-T 135mm 1:3.5 + Pentax K + 1.53 + + + + + + + + Mitakon + Mitakon wide MC f=24mm 1:2.8 + Pentax K + 1.538 + + + + + + + + + Mitakon + Mitakon Speedmaster 50mm f/0.95 III + Sony E + 1 + + + + + + + + Zenit + Zenitar MC 16mm f/2.8 + M42 + Nikon F + Canon EF + Pentax K + fisheye + 1.529 + + + + + + + + + Fotasy + Fotasy M3517 35mm f/1.7 + M42 + + 1.529 + + + + + + + + Voigtländer + Skoparex 1:3.4/35 + DKL + 1.529 + + + + + + + + + Voigtländer + Color-Skopar X 1:2.8/50 + DKL + 1.529 + + + + + + + + + + Cosina + Cosina 19-35mm f/3.5-4.5 MC + Canon EF + Nikon F + Sony Alpha + Pentak K + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Voigtländer + Voigtlander Ultron 40mm f/2 SLII Aspherical + Ultron 40mm f/2 SL-II Aspherical + Nikon F AI-S + 1 + + + + + + + + + + + + + + + + + + + + Voigtländer + Nokton 25mm f/0.95 II + Nokton 25mm f/0.95 Type II + Micro 4/3 System + 2.0 + + + + + + + + + + + + + + + + + + + + + + + + + + LG + LG G4 & compatibles + fixed lens + festes Objektiv + lgH815 + 6.34 + 16:9 + + + + + + + + Huawei + P30 Pro + fixed lens + festes Objektiv + vogl29 + 4.86 + 4:3 + + + + + + + + + + + + + + + + + + + + + Huawei + Huawei P20 Pro & compatibles + fixed lens + festes Objektiv + cltl29 + 4.55 + 4:3 + + + + + + + + + + Huawei + Huawei P10 Lite & compatibles + fixed lens + festes Objektiv + waslx1a + 6.88 + 4:3 + + + + + + + + + Beroflex + Beroflex 1:8 500mm + T2 + 1.531 + + + + + + + + + Yongnuo + Yongnuo YN 35mm f/2 + Canon EF + 1.62 + + + + + + + + + Yongnuo + Yongnuo YN 35mm f/2 + Canon EF + Nikon F + 1.0 + + + + + + + + + Yongnuo + Yongnuo YN 50mm f/1.8 + Canon EF + 1 + + + + + + + + + + Yongnuo + Yongnuo YN 50mm f/1.8 II + Canon EF + 1 + + + + + + + + + Irix + Irix 15mm f/2.4 + Canon EF + Nikon F + Pentax KA + + 1 + + + + + + + + + + + + + + + + + + + + Irix + Irix 11mm f/4 G + Nikon F AF + Canon EF + Pentax KA + 1 + + + + + + + + + Arsenal + MC Volna-3 80mm f/2.8 + Kiev 88 + 1.523 + + + + + + + + + + + + + + + + + + + + + + + Meike + Meike 25mm f/1.8 + Canon EF-M + Fujifilm X + Micro 4/3 System + Nikon CX + Sony E + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + Meike + Meike 35mm f/1.7 + Fujifilm X + Sony E + 1.528 + + + + + + + + + Meike + Meike 50mm F1.2 + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Meike + Meike 50mm f/2.0 + Fujifilm X + Micro 4/3 System + Sony E + Nikon CX + Canon EF-M + 1.528 + + + + + + + + + Meike + Meike 28mm f/2.8 + Fujifilm X + Micro 4/3 System + Sony E + Nikon CX + Canon EF-M + 1.529 + + + + + + + + Meke + Meike + Meke FF 35mm f/2.0 + Meike AF 35mm F2 FF + Leica L + Sony E + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + Meke + Meike + MEKE SL 85mm F1.8 STM PRO + Meike SL 85mm F1.8 STM PRO + Leica L + Sony E + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + Meike + MEKE SL 35mm F1.8 STM PRO + Meike SL 35mm F1.8 STM PRO + Leica L + Sony E + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Zeiss + Standard + lumia1520 + 6.26 + 16:9 + + + + + + + Miranda + Miranda 28mm f/2.8 MC + Contax/Yashica + Canon FD + M42 + Nikon F + Pentax K + Minolta MD + 1 + + + + + + + + + Petri + Auto Petri 1:2.8 f=28mm + M42 + 1.529 + + + + + + + + + Venus + Laowa 15mm f/2.0 Zero-D + Canon RF + Leica L + Nikon Z + Sony E + 1.0 + + + + + + + + + + + + + + + + + + + Venus + Laowa 12mm f/2.8 Zero-D + Canon EF + Nikon F + Pentax KAF3 + Sony Alpha + Sony E + Nikon Z + 1 + + + + + + + + + + + + + + + + + + + Venus + Laowa 9mm f/2.8 Zero-D + Fujifilm X + Sony E + Canon EF-M + Micro 4/3 System + Nikon Z + Leica L + + 1.529 + + + + + + + + + + + + + + + + + + + + + + + Venus + Laowa 7.5mm f/2.0 + Micro 4/3 System + + 2 + + + + + + + + + + + + + + + + + + Venus + Laowa 17mm f/1.8 C-Dreamer + Micro 4/3 System + 2.0 + + + + + + + + + + + + + + + + + + + + Venus + Laowa 60mm f/2.8 2X Ultra-Macro + Canon EF + Nikon F + Pentax K + Sony Alpha + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TTArtisan + 50mm F1.4 Tilt + Sony E + Fujifilm X + Canon RF + Nikon Z + Micro 4/3 System + Leica L + + + 1 + + + + + + + + + + + + + + + + + + + + + + + TTArtisan + TTArtisan APS-C 23mm F1.4 + Sony E + Fujifilm X + Canon EF-M + Canon RF + Nikon Z + Micro 4/3 System + Leica L + + + 1.534 + + + + + + + + Chinon + Auto Chinon 35mm f/2.8 + M42 + Sony E + 1 + + + + + + + + + + + + + + + + + + + Chinon + Chinon 75-205mm f/3.8 + M42 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Voigtländer + Voigtlander Super Wide-Heliar 15mm f/4.5 III + 15mm F4.5 Super Wide Heliar Aspherical III + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + SLR Magic + SLR Magic 8mm f/4 + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + Opteka + Opteka 15mm f/4 Wide Macro 1:1 + Nikon F + Canon EF + 1 + + + + + + + Honor + Honor 6A & compatibles + fixed lens + festes Objektiv + dlil22 + 8.235 + 4:3 + + + + + + + + Voigtländer + Voigtlander Heliar-Hyper Wide 10mm F5.6 + Heliar-Hyper Wide 10mm F5.6 + Sony E + 1 + + + + + + + Viltrox + Viltrox AF 85mm f/1.8 Z + Nikon Z + 1 + + + + + + + + + Viltrox + 23mmF1.4XM + Viltrox AF 23mm F1.4 XF/Z/L + Fujifilm X + Nikon Z + Leica L + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + Viltrox + Viltrox 23mm F1.4 E + Sony E + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + Viltrox + Viltrox PFU RBMH 20mm f/1.8 ASPH + Sony E + Nikon Z + + + 1 + + + + + + + + + + + + + + + + + + + + + + Viltrox + Viltrox AF 33mm f/1.4 XF + Fujifilm X + Sony E + Nikon Z + Canon EF + 1.534 + + + + + + + + Pentacon + Pentacon electric 2.8/29mm + M42 + 1 + + + + + + + + + Pentacon + Pentacon 50mm f/1.8 + M42 + 1.0 + + + + + + + + + Meyer-Optik Görlitz + Orestegon 29mm f/2.8 + M42 + 1.0 + + + + + + + + + Meyer-Optik Görlitz + Lydith 30mm f/3.5 + M42 + 1.0 + + + + + + + + + Meyer-Optik Görlitz + Helioplan 40mm f/4.5 + M42 + 1.0 + + + + + + + + + Meyer-Optik Görlitz + Domiplan 50mm f/2.8 + M42 + 1.0 + + + + + + + + + Meyer-Optik Görlitz + Oreston 50mm f/1.8 + M42 + 1.0 + + + + + + + + + Meyer-Optik Görlitz + Orestor 100mm f/2.8 + M42 + Exakta + 1.0 + + + + + + + + + Meyer-Optik Görlitz + Orestor 135mm f/2.8 + M42 + 1.0 + + + + + + + + + Meyer-Optik Görlitz + Orestegor 200mm f/4 + M42 + 1.0 + + + + + + + + + Voigtländer + APO-Lanthar 50mm F2 Aspherical + Sony E + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Voigtländer + Voigtlander Color Skopar 20mm F3.5 SLII Aspherical + Color Skopar 20mm F3.5 SLII Aspherical + Pentax KAF4 + Canon EF + Nikon F AF + 1 + + + + + + + + + Rollei + Rollei Rolleinar MC f/4 21mm + Sony E + 1 + + + + + + + + + Rollei + Rollei Rolleinar MC f/2.8 28mm + Sony E + 1 + + + + + + + + + Kipon + Elegant 35mm F/2.4 + Nikon Z + 1 + + + + + + + + + Venus + Laowa C&D-Dreamer MFT 10mm F2.0 + Micro 4/3 System + 2 + + + + + + + + + + + + + + + + + + 7Artisans + 7Artisans 60mm f/2.8 II APS-C + Nikon Z + Fujifilm X + Sony E + Leica L + Canon EF-M + Canon RF + Micro 4/3 System + 1.5 + + + + + + + + + + + + + + + + + + + 7Artisans + 7Artisans 35mm f/1.4 APS-C (manual) + Sony E + Nikon Z + Fujifilm X + Canon EF-M + Leica L + Canon RF + Micro 4/3 System + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + Viltrox + Viltrox 16mm F1.8 FE + Viltrox AF 16mm F1.8 FE/L/Z + Sony E + Leica L + Nikon Z + 1 + + + + + + + + + + + + + + + + + + + Viltrox + Viltrox AF 50mm f/1.8 Z + Nikon Z + Sony E + 1 + + + + + + + + Viltrox + AF 13mm f/1.4 XF + Viltrox AF 13mm F1.4 + Fujifilm X + Sony E + Nikon Z + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + Venus + Laowa 9mm f/5.6 FF RL + Nikon Z + Sony E + Leica L + 1.529 + + + + + + + + 7Artisans + 7Artisans 35mm f/0.95 + Sony E + Nikon Z + Fujifilm X + Canon EF-M + Micro 4/3 System + 1.534 + + + + + + + + Pergear + Pergear 60mm f/2.8 MK2 Macro + Sony E + Nikon Z + Fujifilm X + Leica L + Canon RF + Micro 4/3 System + 1.534 + + + + + + + + Viltrox + AF 27mm f/1.2 XF + Viltrox AF 27mm F1.2 PRO + Fujifilm X + Sony E + Nikon Z + 1.534 + + + + + + + + + + + + + + + + + + + TTArtisan + TTArtisan APS-C 25mm f/2.0 + Sony E + Fujifilm X + Canon EF-M + Canon RF + Nikon Z + Micro 4/3 System + Leica L + 1.534 + + + + + + + + + + + + + + + + + + + Voigtländer + Voigtlander Nokton 58mm F1.4 SLII + Nokton 58mm F1.4 SLII + Nikon F AF + Pentax KAF4 + 1 + + + + + + + + + + + + + + + + + + + + + Voigtländer + Voigtlander Nokton 58mm F1.4 SLII + Nokton 58mm F1.4 SLII + Nikon F AF + Pentax KAF4 + 1.534 + + + + + + + + + + + + + + + + + + + TTArtisan + TTArtisan 7.5mm f/2 Fisheye + Micro 4/3 System + fisheye + 2 + 4:3 + + + + + + + + + Viltrox + Viltrox AF 35mm f/1.8 Z + Viltrox AF 35mm F1.8 Z + Nikon Z + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + Venus + Laowa 15mm f/4 Wide Angle Macro + Laowa 15mm F/4 Wide Angle Macro + Nikon F AF + Canon EF + Sony E + Sony Alpha + Pentax KAF4 + M42 + Fujifilm X + 1 + + + + + + + + + + + + + + + + + + + TTArtisan + TTArtisan 35mm f/1.8 + Sony E + Fujifilm X + Nikon Z + 1.534 + + + + + + + + + TTArtisan + AF 27mm f/2.8 + TTArtisan AF 27mm F2.8 + Fujifilm X + Sony E + Nikon Z + 1.534 + + + + + + + + + + + + + + + + + + + Viltrox + Viltrox AF 20mm f/2.8 Z + Viltrox AF 20mm F2.8 Z + Nikon Z + Sony E + 1.0 + + + + + + + + + Steinheil München + Auto-D-Quinaron 35mm f/2.8 + M42 + 1.0 + + + + + + + + + Steinheil München + Culminar 85mm f/2.8 + M42 + 1.0 + + + + + + + + + Steinheil München + Auto-D-Tele-Quinar 135mm f/2.8 + M42 + 1.0 + + + + + + + + + Beroflex + Beroflex 400mm f/6.3 + M42 + 1.0 + + + + + + + + + Voigtländer + Voigtlander Color-Ultron 50mm f/1.8 + Color-Ultron 50mm f/1.8 + M42 + 1.0 + + + + + + + + + Venus + Laowa FF 10mm f/2.8 C&D Dreamer + Laowa 10mm f/2.8 Zero-D FF + Sony E + Nikon Z + Leica L + Canon RF + 1.0 + + + + + + + + + + + + + + + + + + Venus + Laowa 85mm f/5.6 2X Ultra Macro APO + Sony E + Canon RF + Leica M + Leica L + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + Toshiba + Tosner MC 28mm f/2.8 + M42 + 2.0 + 4:3 + + + + + + + + Sun + Sun Wide YS-28 28mm f/2.8 + Olympus OM + T2 + 2.0 + 4:3 + + + + + + + + Yongnuo + Yongnuo YN 33mm F/1.4S DA DSM WL Pro + Sony E + Nikon Z + Fujifilm X + 1.534 + + + + + + + + Voigtländer + 35mm f/2 + APO-Lanthar 35mm F2 Aspherical II + Nikon Z + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Viltrox + Viltrox AF 24mm f/1.8 Z + Nikon Z + Sony E + 1.0 + + + + + + + + + + + + + + + + + Viltrox + Viltrox 25mm F1.7 E + Sony E + Fujifilm X + Nikon Z + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + Quantaray + Quantaray M-AF 35-80mm F4-5.6 + Sony Alpha + Canon EF + Nikon F + Pentak K + Minolta AF + 1.0 + + + + + + + + + + + Yongnuo + YN11mm F/1.8S DA DSM WL + Sony E + 1.534 + + + + + + + + AstrHori + AstrHori 10mm f/8 + Fujifilm X + Sony E + Nikon Z + Leica L + Micro 4/3 System + 1.534 + + + + + + + + 7Artisans + 7Artisans 18mm f/6.3 II + Fujifilm X + Sony E + Nikon Z + Leica L + Micro 4/3 System + 1.534 + + + + + + + + Sun + Sun Wide Zoom Macro 24-40mm f/3.5 + M42 + Pentax K + Canon EF + Nikon F + Contax/Yashica + Olympus OM + 1.534 + + + + + + + + + + + + + + + + + Yashica + Yashica DSB 55mm f/2 + Contax/Yashica + 1.0 + + + + + + + + + + + + + + + + + + + + + + + Yashica + Yashica ML 50mm f/1.7 + Contax/Yashica + 1.0 + + + + + + + + + + + + + + + + + + + + + + + Yashica + Yashica ML 50mm f/2 + Contax/Yashica + 1.0 + + + + + + + + + + + + + + + + + + + + + + + Yashica + Yashica ML 55mm F/4 Macro + Contax/Yashica + 1.0 + + + + + + + + + + + + + + + + + + + + + Voigtländer + Voigtlander Nokton 28mm F1.5 Aspherical + Nokton 28mm F1.5 Aspherical + Sony E + Nikon Z + Leica M + 1.0 + + + + + + + + + + + + + + + + + + + + + Viltrox + Viltrox 35mm F1.7 E + Sony E + Fujifilm X + Nikon Z + 1.534 + + + + + + + + Viltrox + Viltrox 15mm F1.7 E + Viltrox AF 15mm F1.7 Air + Sony E + Fujifilm X + Nikon Z + 1.534 + + + + + + + + Mamiya + Mamiya/Sekor SX 55mm f/1.8 + M42 + 1.0 + + + + + + + + + Petri + Auto Petri 55mm f/1.8 + M42 + 1.0 + + + + + + + + + TTArtisan + E 23mm F1.8 + TTArtisan AF 23mm F1.8 + Sony E + Fujifilm X + Nikon Z + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + Viltrox + Viltrox AF 9mm f/2.8 Z/E + Viltrox AF 9mm f/2.8 Z/E/XF + Nikon Z + Sony E + Fujifilm X + 1.534 + + + + + + + Viltrox + AF 56/1.4 XF + Viltrox AF 56mm f/1.4 XF + Fujifilm X + Nikon Z + Sony E + Canon EF + 1.534 + + + + + + + + Viltrox + Viltrox AF 56mm f/1.2 E/Z + Viltrox AF 56mm f/1.2 Pro + Sony E + Nikon Z + Fujifilm X + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TTArtisan + TTARTISAN 40mmF2.0Z + TTArtisan AF 40mm F2 + Nikon Z + Sony E + 1.0 + + + + + + + + Pergear + Pergear 7.5mm f/2.8 + Micro 4/3 System + 2.0 + 4:3 + + + + + + + + Yongnuo + Yongnuo 25mm f/1.7 II + Micro 4/3 + 2.0 + 4:3 + + + + + + + + + + + OM Digital Solutions + OM System + OM-1 + Micro 4/3 System + 2 + + + + OM Digital Solutions + OM System + OM-1MarkII + OM-1 II + Micro 4/3 System + 2 + + + + OM Digital Solutions + OM System + OM-3 + Micro 4/3 System + 2 + + + + OM Digital Solutions + OM System + OM-5 + Micro 4/3 System + 2 + + + + OM Digital Solutions + OM System + OM-5MarkII + OM-5 II + Micro 4/3 System + 2 + + + + + OM Digital Solutions + OM System + OM 12-100mm F4.0 + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OM Digital Solutions + OM System + OM 20mm F1.4 + Micro 4/3 System + 2 + + + + + + + + + + + + + + + + + OM Digital Solutions + OM System + OM 40-150mm F4.0 + M.Zuiko Digital ED 40-150mm F4.0 PRO + Micro 4/3 System + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + OM System + OM 17mm F1.8 II + Micro 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Leica M + M42 + M39/1 + DKL + T2 + Generic + + + + Leica Camera AG + Leica + Leica M (Typ 240) + M (Typ 240) + Leica M + 1 + + + + Leica Camera AG + Leica + Leica M EV1 + M EV1 + Leica M + 1 + + + + Leica Camera AG + Leica + Leica M Monochrom (Typ 246) + M Monochrom (Typ 246) + Leica M + 1 + + + + Leica Camera AG + Leica + M8 Digital Camera + Leica M + 1.33 + + + + Leica Camera AG + Leica + M9 Digital Camera + Leica M + 1 + + + + Leica Camera AG + Leica + Leica M10 + M10 + Leica M + 1 + + + + Leica Camera AG + Leica + Leica M10 Monochrom + M10 Monochrom + Leica M + 1 + + + + Leica Camera AG + Leica + Leica M10-D + M10-D + Leica M + 1 + + + + Leica Camera AG + Leica + Leica M10-P + M10-P + Leica M + 1 + + + + Leica Camera AG + Leica + Leica M10-R + M10-R + Leica M + 1 + + + + Leica Camera AG + Leica + Leica M11 + M11 + Leica M + 1 + + + + Leica Camera AG + Leica + Leica M11 Monochrom + M11 Monochrom + Leica M + 1 + + + + Leica Camera AG + Leica + Leica M11-P + M11-P + Leica M + 1 + + + + Leica Camera AG + Leica + Leica M11-D + M11-D + Leica M + 1 + + + + Leica Camera AG + Leica + Elmarit-M 1:2.8/28 Asph. + Leica M + 1 + + + + + + + + Leica Camera AG + Leica + Elmarit-M 1:2.8/90 + Leica M + 1 + + + + + + + + Leica Camera AG + Leica + Summicron-M 1:2/50 + + Leica M + 1 + + + + + + + + + Leica Camera AG + Leica + Summicron-M 1:2/28 Asph. + Leica M + 1 + + + + + + + + + Leica Camera AG + Leica + Summicron-M 1:2/35 Asph. + Summicron-M 1:2/35 Asph. (11879/11882) + Leica M + 1.0 + + + + + + + + + Leica Camera AG + Leica + APO-Summicron-M 1:2/75 Asph. + APO-Summicron-M 1:2/75 Asph. (11673/11701) + Leica M + 1.0 + + + + + + + + + + + + + Canon EF-S + Canon EF + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Canon EF + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Canon FD + Canon FL + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Canon FL + M42 + M39/1 + DKL + T2 + Generic + + + + Canon + Canon EOS 5DS + EOS 5DS + Canon EF + 1 + + + + Canon + Canon EOS 5DS R + EOS 5DS R + Canon EF + 1 + + + + Canon + Canon EOS 6D + EOS 6D + Canon EF + 1.005 + + + + Canon + Canon EOS 6D Mark II + EOS 6D Mark II + Canon EF + 1.005 + + + + Canon + Canon EOS 5D Mark IV + EOS 5D Mark IV + Canon EF + 1 + + + + Canon + Canon EOS 5D Mark III + EOS 5D Mark III + Canon EF + 1 + + + + Canon + Canon EOS 5D Mark II + EOS 5D Mark II + Canon EF + 1 + + + + Canon + Canon EOS 5D + EOS 5D + Canon EF + 1 + + + + Canon + Canon EOS-1Ds + EOS-1Ds + Canon EF + 1 + + + + Canon + Canon EOS-1Ds Mark II + EOS-1Ds Mark II + Canon EF + 1 + + + + Canon + Canon EOS-1D Mark II + EOS-1D Mark II + Canon EF + 1.255 + + + + Canon + Canon EOS-1D Mark II N + EOS-1D Mark II N + Canon EF + 1.255 + + + + Canon + Canon EOS-1Ds Mark III + EOS-1Ds Mark III + Canon EF + 1 + + + + Canon + Canon EOS-1D Mark III + EOS-1D Mark III + Canon EF + 1.282 + + + + Canon + Canon EOS-1D Mark IV + EOS-1D Mark IV + Canon EF + 1.290 + + + + Canon + Canon EOS-1D + EOS-1D + Canon EF + 1.255 + + + + Canon + Canon EOS-1D X + EOS-1D X + Canon EF + 1 + + + + Canon + Canon EOS-1D X Mark II + EOS-1D X Mark II + Canon EF + 1 + + + + Canon + Canon EOS 1000D + EOS 1000D + Canon EF-S + 1.622 + + + + Canon + Canon EOS DIGITAL REBEL XS + EOS Digital Rebel XS + Canon EF-S + 1.622 + + + + Canon + Canon EOS Kiss Digital F + EOS Kiss Digital F + Canon EF-S + 1.622 + + + + Canon + Canon EOS 1100D + EOS 1100D + Canon EF-S + 1.620 + + + + Canon + Canon EOS REBEL T3 + EOS Rebel T3 + Canon EF-S + 1.620 + + + + Canon + Canon EOS Kiss X50 + EOS Kiss X50 + Canon EF-S + 1.620 + + + + Canon + Canon EOS 300D DIGITAL + EOS 300D + Canon EF-S + 1.587 + + + + Canon + Canon EOS DIGITAL REBEL + EOS Digital REBEL + Canon EF-S + 1.587 + + + + Canon + Canon EOS Kiss Digital + EOS Kiss Digital + Canon EF-S + 1.587 + + + + Canon + Canon EOS 350D DIGITAL + EOS 350D + Canon EF-S + 1.622 + + + + Canon + Canon EOS DIGITAL REBEL XT + EOS Digital Rebel XT + Canon EF-S + 1.622 + + + + Canon + Canon EOS Kiss Digital N + EOS Kiss Digital N + Canon EF-S + 1.622 + + + + Canon + Canon EOS 400D DIGITAL + EOS 400D + Canon EF-S + 1.622 + + + + Canon + Canon EOS DIGITAL REBEL XTi + EOS Digital Rebel XTi + Canon EF-S + 1.622 + + + + Canon + Canon EOS Kiss Digital X + EOS Kiss Digital X + Canon EF-S + 1.622 + + + + Canon + Canon EOS 450D + EOS 450D + Canon EF-S + 1.622 + + + + Canon + Canon EOS DIGITAL REBEL XSi + EOS Digital Rebel XSi + Canon EF-S + 1.622 + + + + Canon + Canon EOS Kiss Digital X2 + EOS Kiss Digital X2 + Canon EF-S + 1.622 + + + + Canon + Canon EOS 500D + EOS 500D + Canon EF-S + 1.613 + + + + Canon + Canon EOS REBEL T1i + EOS Rebel T1i + Canon EF-S + 1.613 + + + + Canon + Canon EOS Kiss X3 + EOS Kiss X3 + Canon EF-S + 1.613 + + + + Canon + Canon EOS 550D + EOS 550D + Canon EF-S + 1.613 + + + + Canon + Canon EOS REBEL T2i + EOS Rebel T2i + Canon EF-S + 1.613 + + + + Canon + Canon EOS Kiss X4 + EOS Kiss X4 + Canon EF-S + 1.613 + + + + Canon + Canon EOS 600D + EOS 600D + Canon EF-S + 1.613 + + + + Canon + Canon EOS REBEL T3i + EOS Rebel T3i + Canon EF-S + 1.613 + + + + Canon + Canon EOS Kiss X5 + EOS Kiss X5 + Canon EF-S + 1.613 + + + + Canon + Canon EOS 650D + EOS 650D + Canon EF-S + 1.613 + + + + Canon + Canon EOS REBEL T4i + EOS Rebel T4i + Canon EF-S + 1.613 + + + + Canon + Canon EOS Kiss X6i + EOS Kiss X6i + Canon EF-S + 1.613 + + + + Canon + Canon EOS 700D + EOS 700D + Canon EF-S + 1.613 + + + + Canon + Canon EOS REBEL T5i + EOS Rebel T5i + Canon EF-S + 1.613 + + + + Canon + Canon EOS 800D + EOS 800D + Canon EF-S + 1.613 + + + + Canon + Canon EOS REBEL T7i + EOS Rebel T7i + Canon EF-S + 1.613 + + + + Canon + Canon EOS Kiss X7i + EOS Kiss X7i + Canon EF-S + 1.613 + + + + Canon + Canon EOS 750D + EOS 750D + Canon EF-S + 1.613 + + + + Canon + Canon EOS Rebel T6i + EOS Rebel T6i + Canon EF-S + 1.613 + + + + Canon + Canon EOS Kiss X8i + EOS Kiss X8i + Canon EF-S + 1.613 + + + + Canon + Canon EOS 760D + EOS 760D + Canon EF-S + 1.613 + + + + Canon + Canon EOS Rebel T6s + EOS Rebel T6s + Canon EF-S + 1.613 + + + + Canon + Canon EOS 8000D + EOS 8000D + Canon EF-S + 1.613 + + + + Canon + Canon EOS Kiss X9i + EOS Kiss X9i + Canon EF-S + 1.613 + + + + Canon + Canon EOS 850D + EOS 850D + Canon EF-S + 1.613 + + + + Canon + Canon EOS Rebel T8i + EOS Rebel T8i + Canon EF-S + 1.613 + + + + Canon + Canon EOS Kiss X10i + EOS Kiss X10i + Canon EF-S + 1.613 + + + + Canon + Canon EOS 9000D + EOS 9000D + Canon EF-S + 1.613 + + + + Canon + Canon EOS 1200D + EOS 1200D + Canon EF-S + 1.620 + + + + Canon + Canon EOS REBEL T5 + EOS Rebel T5 + Canon EF-S + 1.620 + + + + Canon + Canon EOS Kiss X70 + EOS Kiss X70 + Canon EF-S + 1.620 + + + + Canon + Canon EOS Hi + EOS Hi + Canon EF-S + 1.620 + + + + Canon + Canon EOS 1300D + EOS 1300D + Canon EF-S + 1.620 + + + + Canon + Canon EOS Rebel T6 + EOS Rebel T6 + Canon EF-S + 1.620 + + + + Canon + Canon EOS 2000D + EOS 2000D + Canon EF-S + 1.613 + + + + Canon + Canon EOS Kiss X90 + EOS Kiss X90 + Canon EF-S + 1.613 + + + + Canon + Canon EOS Rebel T7 + EOS Rebel T7 + Canon EF-S + 1.613 + + + + Canon + Canon EOS 4000D + EOS 4000D + Canon EF-S + 1.613 + + + + Canon + Canon EOS Rebel T100 + EOS Rebel T100 + Canon EF-S + 1.613 + + + + Canon + Canon EOS 100D + EOS 100D + Canon EF-S + 1.613 + + + + Canon + Canon EOS REBEL SL1 + EOS Rebel SL1 + Canon EF-S + 1.613 + + + + Canon + Canon EOS Kiss X7 + EOS Kiss X7 + Canon EF-S + 1.613 + + + + Canon + Canon EOS 200D + EOS 200D + Canon EF-S + 1.613 + + + + Canon + Canon EOS REBEL SL2 + EOS Rebel SL2 + Canon EF-S + 1.613 + + + + Canon + Canon EOS 250D + EOS 250D + Canon EF-S + 1.613 + + + + Canon + Canon EOS REBEL SL3 + EOS Rebel SL3 + Canon EF-S + 1.613 + + + + Canon + Canon EOS 200D II + EOS 200D II + Canon EF-S + 1.613 + + + + Canon + Canon EOS Kiss X9 + EOS Kiss X9 + Canon EF-S + 1.613 + + + + Canon + Canon EOS 7D + EOS 7D + Canon EF-S + 1.620 + + + + Canon + Canon EOS 7D Mark II + EOS 7D Mark II + Canon EF-S + 1.605 + + + + Canon + Canon EOS 90D + EOS 90D + Canon EF-S + 1.613 + + + + Canon + Canon EOS 80D + EOS 80D + Canon EF-S + 1.613 + + + + Canon + Canon EOS 77D + EOS 77D + Canon EF-S + 1.613 + + + + Canon + Canon EOS 70D + EOS 70D + Canon EF-S + 1.600 + + + + Canon + Canon EOS 60D + EOS 60D + Canon EF-S + 1.620 + + + + Canon + Canon EOS 50D + EOS 50D + Canon EF-S + 1.622 + + + + Canon + Canon EOS 40D + EOS 40D + Canon EF-S + 1.622 + + + + Canon + Canon EOS 30D + EOS 30D + Canon EF-S + 1.600 + + + + Canon + Canon EOS 20D + EOS 20D + Canon EF-S + 1.600 + + + + Canon + Canon EOS 10D + EOS 10D + Canon EF-S + 1.587 + + + + Canon + Canon EOS D60 + EOS D60 + Canon EF-S + 1.587 + + + + Canon + Canon EOS D30 + EOS D30 + Canon EF-S + 1.587 + + + + Canon + 35mm film: full frame + Canon EF + 1 + + + + Kodak + DCS Pro SLR/c + Canon EF + 1 + + + + Kodak + DCS520 + DCS 520 + Canon EF + 1.593 + + + + Canon + EOS D2000 + Canon EF + 1.593 + + + + Canon + Canon EF-S 10-22mm f/3.5-4.5 USM + Canon EF-S + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 16-35mm f/2.8L USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 16-35mm f/2.8L II USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 16-35mm f/2.8L III USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 17-35mm f/2.8L USM + Canon EF + 1 + + + + + + + + + + + + + + Canon + Canon EF 17-40mm f/4L USM + Canon EF + 1 + + + + + + + + + + + + + + + + + Canon + Canon EF-S 17-55mm f/2.8 IS USM + Canon EF-S + 1.622 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-S 17-85mm f/4-5.6 IS USM + Canon EF-S + + 1.611 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-S 18-55mm f/3.5-5.6 + Canon EF-S + + 1.611 + + + + + + + + + + + + + + + + + + Canon + Canon EF-S 18-55mm f/3.5-5.6 IS II + Canon EF-S + + 1.611 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-S 18-55mm f/3.5-5.6 III + Canon EF-S + + 1.611 + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-S 18-55mm f/3.5-5.6 IS STM + Canon EF-S + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 20mm f/2.8 USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 24-70mm f/2.8L USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 24-85mm f/3.5-4.5 USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 24-85mm f/3.5-4.5 USM + Canon EF + + 1.611 + + + + + + + + + + + + Canon + Canon EF 28-70mm f/2.8L USM + Canon EF + + 1.611 + + + + + + + + + + + + + + Canon + Canon EF 24-105mm f/4L IS USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 24-105mm f/4L IS USM + Canon EF + + 1.611 + + + + + + + + + + + + + Canon + Canon EF 28-105mm f/3.5-4.5 II USM + Canon EF + 1 + + + + + + + + + + + Canon + Canon EF 28-300mm f/3.5-5.6L IS USM + Canon EF + 1 + + + + + + + + + + + + + + + Canon + Canon EF 28-135mm f/3.5-5.6 IS USM + Canon EF + 1 + + + + + + + + + + + + + + + + Canon + Canon EF 35mm f/1.4L USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + EF35mm f/1.4L II USM (750) + Canon EF 35mm f/1.4L II USM + Canon EF + 1.605 + + + + + + + + + Canon + Canon EF 35mm f/2 IS USM + Canon EF + 1.005 + + + + + + + + + Canon + Canon EF 35mm f/2 IS USM + Canon EF + 1.613 + + + + + + + + + + + + + + + + + Canon + Canon EF 35-70mm f/3.5-4.5 + Canon EF + + 1.611 + + + + + + + + + + Canon + Canon EF 35-80mm f/4-5.6 III + Canon EF + + 1.611 + + + + + + + + + + + + Canon + Canon EF 35-105mm f/3.5-4.5 + Canon EF + 1.005 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 35-105mm f/3.5-4.5 + Canon EF + + 1.611 + + + + + + + + + + + Canon + Canon EF 35-105mm f/4.5-5.6 + Canon EF + + 1.611 + + + + + + + + + + + + + + + + + Canon + Canon EF 35-135mm f/4-5.6 USM + Canon EF + + 1.611 + + + + + + + + + + + + + Canon + Canon EF 50mm f/1.4 USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 55-200mm f/4.5-5.6 + Canon EF + + 1.611 + + + + + + + + + + + + + + + Canon + Canon EF-S 55-250mm f/4-5.6 IS + Canon EF-S + + 1.611 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-S 55-250mm f/4-5.6 IS II + Canon EF-S + + 1.611 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-S 55-250mm f/4-5.6 IS STM + Canon EF-S + 1.611 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 70-200mm f/2.8L USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 70-200mm f/2.8L IS USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 70-200mm f/2.8L IS USM + Canon EF + 1.62 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 70-200mm f/2.8L IS USM + EF 1.4x extender + Canon EF 70-200mm f/2.8L IS USM + EF 1.4× ext. + Canon EF 70-200mm f/2.8L IS USM + EF 1,4×-Konv. + Canon EF + 1 + + + + + + + + + + + + + + + + + Canon + Canon EF 70-200mm f/2.8L IS II USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 70-200mm f/2.8L IS II USM + EF 2x extender III + Canon EF 70-200mm f/2.8L IS II USM + EF 2× III ext. + Canon EF 70-200mm f/2.8L IS II USM + EF-2×-III-Konv. + Canon EF + 1 + + + + + + + + + + + + + + + Canon + Canon EF 70-200mm f/2.8L IS USM + EF 2x II extender + Canon EF 70-200mm f/2.8L IS USM + EF 2× II ext. + Canon EF 70-200mm f/2.8L IS USM + EF-2×-II-Konv. + Canon EF + 1.62 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 70-200mm f/4L USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + Canon + Canon EF 70-200mm f/4L USM + EF 1.4x extender + Canon EF 70-200mm f/4L USM + EF 1.4× ext. + Canon EF 70-200mm f/4L USM + EF 1,4×-Konv. + Canon EF + 1 + + + + + + + + + + + + + + + + + + Canon + Canon EF 70-200mm f/4L IS USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 70-200mm f/4L IS USM + Canon EF + 1.613 + + + + + + + + + + + + + + + Canon + Canon EF 70-300mm f/4.5-5.6 DO IS USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 70-300mm f/4-5.6 IS USM + Canon EF + + 1.611 + + + + + + + + + + + Canon + Canon EF 75-300mm f/4-5.6 IS USM + Canon EF + + 1.611 + + + + + + + + + + + Canon + Canon EF 80-200mm f/2.8L + Canon EF + 1 + + + + + + + + + + + + + Canon + Canon EF 85mm f/1.2L II USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 100mm f/2.8 Macro USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 100-200mm f/4.5A + Canon EF + 1.005 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 100-300mm f/5.6L + Canon EF + 1 + + + + + + + + + + + + + Canon + Canon EF 100-400mm f/4.5-5.6L IS USM + Canon EF + + 1.611 + + + + + + + + + + + + + + Canon + Canon EF 100-400mm f/4.5-5.6L IS USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 100-400mm f/4.5-5.6L IS II USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 100-400mm f/4.5-5.6L IS II USM + Canon EF + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 24mm f/1.4L USM + Canon EF + 1 + + + + + + + Canon + Canon EF 24mm f/2.8 + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 28mm f/1.8 + Canon EF + + 1.611 + + + + + + + Canon + Canon EF 28mm f/1.8 USM + Canon EF + 1 + + + + + + + Canon + Canon EF 28mm f/2.8 + Canon EF + 1.613 + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 35mm f/2 + Canon EF + 1 + + + + + + + Canon + Canon EF 50mm f/1.2L USM + Canon EF + 1 + + + + + + + Canon + Canon EF 50mm f/1.4 USM + Canon EF + + 1.611 + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 50mm f/1.8 + Canon EF + + 1.267 + + + + + + + Canon + Canon EF 50mm f/1.8 + Canon EF + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 50mm f/1.8 MkII + Canon EF 50mm f/1.8 II + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 50mm f/1.8 MkII + Canon EF 50mm f/1.8 II + Canon EF + + 1.267 + + + + + + + Canon + Canon EF 50mm f/1.8 MkII + Canon EF 50mm f/1.8 II + Canon EF + 1.622 + + + + + + + + + + + + + + + + + + + + + + Canon + Canon FDn 50mm 1:1.4 + Canon FD + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon FDn 50mm 1:1.4 + Canon FD + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-S 60mm f/2.8 Macro USM + Canon EF-S + + 1.611 + + + + + + + Canon + Canon EF 85mm f/1.2L USM + Canon EF + 1 + + + + + + + Canon + Canon EF 85mm f/1.8 USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + Canon + Canon EF 100mm f/2.8L Macro IS USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 100mm f/2.8L Macro IS USM + Canon EF + 1.605 + + + + + + + + + Canon + Canon EF 100mm f/2.8 Macro + Canon EF + + 1.611 + + + + + + + Canon + Canon FDn 100mm 1:2.8 + Canon FD + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 135mm f/2L + Canon EF 135mm f/2 L USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 135mm f/2.8 Soft Focus + Canon EF + + 1.267 + + + + + + + Canon + Canon EF 200mm f/2.8L USM + Canon EF + 1 + + + + + + + Canon + Canon EF 200mm f/2.8L II USM + Canon EF + + 1.611 + + + + + + + Canon + Canon TS-E 24mm f/3.5L + Canon EF + 1 + + + + + + + Canon + Canon TS-E 24mm f/3.5L + Canon EF + 1.622 + + + + + + + + + Canon + Canon TS-E 45mm f/2.8 + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon TS-E 90mm f/2.8 + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-S 18-135mm f/3.5-5.6 IS + Canon EF-S + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-S 18-135mm f/3.5-5.6 IS USM + Canon EF-S 18-135mm f/3.5-5.6 IS USM + Canon EF-S + 1.605 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-S 18-135mm f/3.5-5.6 IS STM + Canon EF-S + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-S 18-55mm f/3.5-5.6 IS + Canon EF-S + 1.622 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 24-70mm f/2.8L II USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-S 15-85mm f/3.5-5.6 IS USM + Canon EF-S + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 50-200mm f/3.5-4.5L + Canon EF + 1.622 + + + + + + + + + + + + + + + Canon + Canon EF 50-200mm f/3.5-4.5L + Canon EF + 1 + + + + + + + + + + + + + + Canon + Canon EF 70-300mm f/4-5.6L IS USM + Canon EF + 1.605 + + + + + + + + + + + + + + + + + Canon + Canon EF 70-300mm f/4-5.6L IS USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 90-300mm f/4.5-5.6 + Canon EF + 1.005 + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-S 18-200mm f/3.5-5.6 IS + Canon EF-S + 1.620 + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 28-80mm f/3.5-5.6 USM IV + Canon EF + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 400mm f/5.6L USM + Canon EF + 1.005 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 400mm f/5.6L USM + 1.4x extender + Canon EF 400mm f/5.6L USM + EF 1.4× ext. + Canon EF 400mm f/5.6L USM + EF 1,4×-Konv. + Canon EF + 1.005 + + + + + + + + + Canon + Canon EF 300mm f/2.8L IS II USM + Canon EF + 1 + + + + + + + + + Canon + Canon EF 300mm f/2.8L IS II USM + Canon EF + 1.6 + + + + + + + + + Canon + Canon EF 300mm f/2.8L IS II USM + EF 1.4x extender III + Canon EF 300mm f/2.8L IS II USM + EF 1.4× ext. III + Canon EF 300mm f/2.8L IS II USM + EF 1,4×-Konv. III + Canon EF + 1 + + + + + + + + + Canon + Canon EF 300mm f/2.8L IS II USM + EF 1.4x extender III + Canon EF 300mm f/2.8L IS II USM + EF 1.4× ext. III + Canon EF 300mm f/2.8L IS II USM + EF 1,4×-Konv. III + Canon EF + 1.6 + + + + + + + + + Canon + Canon EF 300mm f/2.8L IS II USM + EF 2.0x extender III + Canon EF 300mm f/2.8L IS II USM + EF 2.0× ext. III + Canon EF 300mm f/2.8L IS II USM + EF 2,0×-Konv. III + Canon EF + 1 + + + + + + + + + Canon + Canon EF 300mm f/2.8L IS II USM + EF 2.0x extender III + Canon EF 300mm f/2.8L IS II USM + EF 2.0× ext. III + Canon EF 300mm f/2.8L IS II USM + EF 2,0×-Konv. III + Canon EF + 1.6 + + + + + + + + + Canon + Canon EF 300mm f/4L IS USM + Canon EF + 1.605 + + + + + + + + + Canon + Canon EF 300mm f/4L IS USM + 1.4x extender + Canon EF 300mm f/4L IS USM + 1.4× ext. + Canon EF 300mm f/4L IS USM + 1.4×-Konv. + Canon EF + 1.605 + + + + + + + + + Canon + Canon EF 500mm f/4L IS II USM + Canon EF + 1 + + + + + + + + + Canon + Canon EF 500mm f/4L IS II USM + Canon EF + 1.6 + + + + + + + + + Canon + Canon EF 500mm f/4L IS II USM + EF 1.4x extender III + Canon EF 500mm f/4L IS II USM + EF 1.4× ext. III + Canon EF 500mm f/4L IS II USM + EF 1.4×-Konv. III + Canon EF + 1 + + + + + + + + + Canon + Canon EF 500mm f/4L IS II USM + EF 1.4x extender III + Canon EF 500mm f/4L IS II USM + EF 1.4× ext. III + Canon EF 500mm f/4L IS II USM + EF 1.4×-Konv. III + Canon EF + 1.6 + + + + + + + + + Canon + Canon EF 500mm f/4L IS II USM + EF 2.0x extender III + Canon EF 500mm f/4L IS II USM + EF 2.0× ext. III + Canon EF 500mm f/4L IS II USM + EF 2.0×-Konv. III + Canon EF + 1 + + + + + + + + + Canon + Canon EF 500mm f/4L IS II USM + EF 2.0x extender III + Canon EF 500mm f/4L IS II USM + EF 2.0× ext. III + Canon EF 500mm f/4L IS II USM + EF 2.0×-Konv. III + Canon EF + 1.6 + + + + + + + + + Canon + Canon Lens FL 50mm F1.4 + Canon FL + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon Lens FL 135mm F3.5 + Canon FL + 1.529 + + + + + + + + + + + + + + + + + + + + + Canon + Canon FDn 135mm 1:2.8 + Canon FD + + + 1.534 + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 16-35mm f/4L IS USM + Canon EF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 70-210mm f/3.5-4.5 USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 24-70mm f/4L IS USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 24-70mm f/4L IS USM + Canon EF + 1.600 + + + + + + + + + + + + + Canon + Canon EF-S 10-18mm f/4.5-5.6 IS STM + Canon EF-S + 1.62 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-S 24mm f/2.8 STM + Canon EF-S + 1.622 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon FDn 24mm 1:2.8 + Canon FD + 1.529 + + + + + + + + + Canon + Canon FDn 50mm 1:1.8 + Canon FD + 1.529 + + + + + + + + + Canon + Canon EF 40mm f/2.8 STM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + Canon + Canon EF 14mm f/2.8L II USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 8-15mm f/4L Fisheye USM + Canon EF 8-15mm f/4L Fischauge USM + Canon EF + equisolid + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 50mm f/1.8 STM + Canon EF + 1.0 + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 50mm f/1.8 STM + Canon EF + 1.613 + + + + + + + + + + + + + + + + + Canon + Canon EF 50mm f/2.5 Compact Macro + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon FDn 200mm 1:4 + Canon FD + + + 1.534 + + + + + + + + + + + + + + + + + + + + + Canon + Canon FD 200mm f/2.8 S.S.C. + Canon FD + 1.534 + + + + + + + + + + Canon + Canon EF 24mm f/2.8 IS USM + Canon EF + 1.613 + + + + + + + + + Canon + EF-S18-55mm f/4-5.6 IS STM + Canon EF-S 18-55mm f/4-5.6 IS STM + Canon EF-S + 1.613 + + + + + + + + + + + + + + + + + + + Canon + Canon EF 24-105mm f/4L IS II USM + Canon EF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 24-105mm f/4L IS II USM + Canon EF + 1.605 + + + + + + + + + + + + + + + + + + + Canon + Canon EF 24mm f/1.4L II USM + Canon EF + 1.005 + + + + + + + + + Canon + Canon EF 22-55mm f/4-5.6 USM + Canon EF + 1.613 + + + + + + + + + + + + + + + + + Canon + Canon FD 50mm f/1.4 S.S.C. + Canon FD + 1 + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 15mm f/2.8 Fisheye + Canon EF + 1.0 + + + + + + + + + + + + + + Canon + Canon EF 24-105mm f/3.5-5.6 IS STM + Canon EF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 85mm f/1.4L IS USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 80-200mm f/4.5-5.6 + Canon EF + 1 + + + + + + + + + + + + + + + + + + Canon + Canon EF 28mm f/2.8 + Canon EF + 1.0 + + + + + + + + Canon + Canon EF 75-300mm F4-5.6 III + Canon EF-S + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 75-300mm f/4-5.6 III USM + Canon EF + 1.005 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 70-210mm f/4 + Canon EF + 1.005 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 28-80mm f/3.5-5.6 USM + Canon EF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 11-24mm f/4L USM + Canon EF + 1.0 + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 300mm f/2.8L IS USM + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 300mm f/2.8L IS USM +1.4x extender III + Canon EF 300mm f/2.8L IS USM + EF 1.4× ext. III + Canon EF 300mm f/2.8L IS USM + EF 1,4× Konv. III + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 300mm f/2.8L IS USM +2x III extender + Canon EF 300mm f/2.8L IS USM + EF 2.0× ext. III + Canon EF 300mm f/2.8L IS USM + EF 2.0× Konv. III + Canon EF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF-S 18-55mm f/3.5-5.6 II + Canon EF-S + 1.622 + + + + + + + + + + + + + + + + Canon + Canon EF 100-400mm f/4.5-5.6L IS II USM + 1.4x extender + Canon EF 100-400mm f/4.5-5.6L IS II USM + 1.4× ext. + Canon EF + 1.0 + + + + + + + + + + + Canon + Canon EF 70-300mm f/4-5.6 IS II USM + Canon EF + 1.0 + + + + + + + + + + + + + + + + + Canon + Canon EF 300mm f/2.8L IS USM + Canon EF + 1.61 + + + + + + + + + + + + + + + + + Canon + Canon EF 300mm f/2.8L IS USM + 1.4x extender + Canon EF 300mm f/2.8L IS USM + EF 1.4× ext. II + Canon EF + 1.61 + + + + + + + + + + + + + + + + + + Canon + Canon EF 300mm f/2.8L IS USM + 2x extender + Canon EF 300mm f/2.8L IS USM + EF 2.0× ext. II + Canon EF + 1.61 + + + + + + + + + + + + + + + + + + + Canon + Canon FDn 28mm f/2.8 + Canon FD + 1.534 + + + + + + + + Canon + Canon FDn 100mm f/2.8 + Canon FD + 1.534 + + + + + + + + + Canon + Canon EF 100-300mm f/4.5-5.6 USM + Canon EF + 1.0 + + + + + + + + + + + + Canon + Canon EF 20-35mm f/3.5-4.5 USM + Canon EF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Canon + Canon EF 28-90mm f/4-5.6 USM + Canon EF + 1.61 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Hasselblad 500 + Generic + + + + Hasselblad H + Generic + + + + Hasselblad + Hasselblad 500 mech. + Hasselblad 500 + 0.66 + + + + Hasselblad + Hasselblad H3D + Hasselblad H + 0.72 + + + + + + + + Minolta AF + Sony Alpha + M42 + M39/1 + DKL + T2 + Generic + + + + Minolta MC + Minolta MD + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Minolta MD + Minolta MC + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Konica Minolta + Maxxum 5D + Minolta AF + 1.531 + + + + Konica Minolta + Dynax 5D + Minolta AF + 1.531 + + + + Konica Minolta + Maxxum 7D + Minolta AF + 1.522 + + + + Konica Minolta + Dynax 7D + Minolta AF + 1.522 + + + + Konica Minolta + KM 24-105mm f/3.5-4.5 AF D + Minolta AF + + 1.526 + + + + + + + + + + + + + + + Konica Minolta + KM 28-100mm f/3.5-5.6 AF D + Minolta AF + + 1.526 + + + + + + + + + + + + Konica Minolta + KM 80-200mm f/2.8 + Minolta AF + + 1.526 + + + + + + + + + + + + + + Konica Minolta + KM 20mm f/2.8 + Minolta AF + + 1.526 + + + + + + + Minolta + Minolta MC Rokkor-PG 50mm 1:1.4 + Minolta MC + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Minolta + Minolta AF 35-105mm f/3.5-4.5 + Minolta AF + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Minolta + Minolta MD 35mm 1/2.8 + Minolta MD + 1.529 + + + + + + + + + + + + + + + + + + + + + + + Minolta + Minolta MD Rokkor 50mm 1:1.4 + Minolta MD + 1.534 + + + + + + + + Minolta + Minolta AF 135mm f/2.8 + Minolta AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + Minolta + Minolta AF 100-300mm f/4.5-5.6 APO (D) + Minolta AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Minolta + Minolta AF 85mm f/1.4G (D) + Minolta AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + Minolta + Minolta AF 28-75mm F2.8 (D) + + Minolta AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Minolta + Minolta AF 50mm f/2.8 Macro + Minolta AF + 1 + + + + + + + + + Minolta + Minolta AF 50mm f/1.4 + Minolta AF + 1 + + + + + + + + + Minolta + Minolta AF 50mm f/1.7 + Minolta AF + 1.523 + + + + + + + + + + + + + + + + + + + Minolta + Minolta AF 17-35mm f/2.8-4 (D) + Minolta AF + 1 + + + + + + + + + + + + + + + + + Minolta + Minolta AF 17-35mm F2.8-4 (D) + Minolta AF + 1.534 + + + + + + + + + + + + Minolta + Minolta/Sony AF 24-105mm f/3.5-4.5 (D) + Minolta AF + 1 + + + + + + + + + + + + + + + + + Minolta + Minolta AF 70-210mm f/4 Macro + Minolta AF + 1 + + + + + + + + + + + + + + + + + Minolta + Minolta MD 28mm f/2.8 + Minolta MD + 1.534 + + + + + + + + Minolta + Minolta MD 50mm f/1.4 + Minolta MD + 1.534 + + + + + + + + Minolta + Minolta AF 35-70mm F4 + Minolta AF + 1.0 + + + + + + + + + + + + + + + + + Minolta + Minolta MD 135mm f/2.8 + Minolta MD + 1.534 + + + + + + + + + Minolta + Minolta MD 24mm f/2.8 + Minolta MD + 1.0 + + + + + + + + + Minolta + Minolta MD 45mm f/2 + Minolta MD + 1.0 + + + + + + + + + + + + + Leica R + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Leica S + Generic + + + + + + + + Nikon F + Nikon F AI + Nikon F AI-S + Nikon F AF + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Nikon F AI + Nikon F + Nikon F AI-S + Nikon F AF + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Nikon F AI-S + Nikon F + Nikon F AI + Nikon F AF + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Nikon F AF + Nikon F + Nikon F AI + Nikon F AI-S + M42 + M39/1 + DKL + T2 + Generic + + + + Nikon Corporation + Nikon + Nikon D40 + D40 + Nikon F AF + 1.525 + + + + Nikon Corporation + Nikon + Nikon D40X + D40X + Nikon F AF + 1.523 + + + + Nikon Corporation + Nikon + Nikon D50 + D50 + Nikon F AF + 1.525 + + + + Nikon Corporation + Nikon + Nikon D60 + D60 + Nikon F AF + 1.523 + + + + Nikon Corporation + Nikon + Nikon D70 + D70 + Nikon F AF + 1.525 + + + + Nikon Corporation + Nikon + Nikon D70s + D70s + Nikon F AF + 1.525 + + + + Nikon Corporation + Nikon + Nikon D80 + D80 + Nikon F AF + 1.523 + + + + Nikon Corporation + Nikon + Nikon D90 + D90 + Nikon F AF + 1.523 + + + + Nikon Corporation + Nikon + Nikon D100 + D100 + Nikon F AF + 1.525 + + + + Nikon Corporation + Nikon + Nikon D200 + D200 + Nikon F AF + 1.523 + + + + Nikon Corporation + Nikon + Nikon D300 + D300 + Nikon F AF + 1.523 + + + + Nikon Corporation + Nikon + Nikon D300S + D300S + Nikon F AF + 1.523 + + + + Nikon Corporation + Nikon + Nikon D500 + D500 + Nikon F AF + 1.531 + + + + Nikon Corporation + Nikon + Nikon D600 + D600 + Nikon F AF + 1 + + + + Nikon Corporation + Nikon + Nikon D610 + D610 + Nikon F AF + 1 + + + + Nikon Corporation + Nikon + Nikon D700 + D700 + Nikon F AF + 1 + + + + Nikon Corporation + Nikon + Nikon D750 + D750 + Nikon F AF + 1 + + + + Nikon Corporation + Nikon + Nikon D780 + D780 + Nikon F AF + 1 + + + + Nikon Corporation + Nikon + Nikon D800 + D800 + Nikon F AF + 1 + + + + Nikon Corporation + Nikon + Nikon D800E + D800E + Nikon F AF + 1 + + + + Nikon Corporation + Nikon + Nikon D810 + D810 + Nikon F AF + 1 + + + + Nikon Corporation + Nikon + Nikon D850 + D850 + Nikon F AF + 1 + + + + Nikon Corporation + Nikon + Nikon D3000 + D3000 + Nikon F AF + 1.523 + + + + Nikon Corporation + Nikon + Nikon D3100 + D3100 + Nikon F AF + 1.558 + + + + Nikon Corporation + Nikon + Nikon D3200 + D3200 + Nikon F AF + 1.554 + + + + Nikon Corporation + Nikon + Nikon D3300 + D3300 + Nikon F AF + 1.523 + + + + Nikon Corporation + Nikon + Nikon D3400 + D3400 + Nikon F AF + 1.523 + + + + Nikon Corporation + Nikon + Nikon D3500 + D3500 + Nikon F AF + 1.523 + + + + Nikon Corporation + Nikon + Nikon D5000 + D5000 + Nikon F AF + 1.523 + + + + Nikon Corporation + Nikon + Nikon D5100 + D5100 + Nikon F AF + 1.523 + + + + Nikon Corporation + Nikon + Nikon D5200 + D5200 + Nikon F AF + 1.534 + + + + Nikon Corporation + Nikon + Nikon D5300 + D5300 + Nikon F AF + 1.534 + + + + Nikon Corporation + Nikon + Nikon D5500 + D5500 + Nikon F AF + 1.534 + + + + Nikon Corporation + Nikon + Nikon D5600 + D5600 + Nikon F AF + 1.534 + + + + Nikon Corporation + Nikon + Nikon D7000 + D7000 + Nikon F AF + 1.523 + + + + Nikon Corporation + Nikon + Nikon D7100 + D7100 + Nikon F AF + 1.534 + + + + Nikon Corporation + Nikon + Nikon D7200 + D7200 + Nikon F AF + 1.534 + + + + Nikon Corporation + Nikon + Nikon D7500 + D7500 + Nikon F AF + 1.534 + + + + Nikon Corporation + Nikon + Nikon D1 + D1 + Nikon F AF + 1.525 + + + + Nikon Corporation + Nikon + Nikon D1H + D1H + Nikon F AF + 1.525 + + + + Nikon Corporation + Nikon + Nikon D1X + D1X + Nikon F AF + 1.525 + + + + Nikon Corporation + Nikon + Nikon D2H + D2H + Nikon F AF + 1.546 + + + + Nikon Corporation + Nikon + Nikon D2Hs + D2Hs + Nikon F AF + 1.546 + + + + Nikon Corporation + Nikon + Nikon D2X + D2X + Nikon F AF + 1.522 + + + + Nikon Corporation + Nikon + Nikon D2Xs + D2Xs + Nikon F AF + 1.522 + + + + Nikon Corporation + Nikon + Nikon D3 + D3 + Nikon F AF + 1 + + + + Nikon Corporation + Nikon + Nikon D3X + D3X + Nikon F AF + 1 + + + + Nikon Corporation + Nikon + Nikon D3S + D3S + Nikon F AF + 1 + + + + Nikon Corporation + Nikon + Nikon D4 + D4 + Nikon F AF + 1 + + + + Nikon Corporation + Nikon + Nikon D4s + D4s + Nikon F AF + 1 + + + + Nikon Corporation + Nikon + Nikon D5 + D5 + Nikon F AF + 1.003 + + + + Nikon Corporation + Nikon + Nikon D6 + D6 + Nikon F AF + 1 + + + + + Nikon Corporation + Nikon + Nikon Df + Df + Nikon F AF + 1.001 + + + + Fujifilm + FinePixS1Pro + FinePix S1 Pro + Nikon F AF + 1.543 + + + + Fujifilm + FinePixS2Pro + FinePix S2 Pro + Nikon F AF + 1.543 + + + + Fujifilm + FinePix S3Pro + FinePix S3 Pro + Nikon F AF + 1.534 + + + + Fujifilm + FinePix S5Pro + FinePix S5 Pro + Nikon F AF + 1.560 + + + + Fujifilm + IS Pro + FinePix IS Pro + Nikon F AF + 1.560 + + + + Kodak + DCS Pro SLR/n + Nikon F AF + 1 + + + + Kodak + DCS Pro 14nx + Nikon F AF + 1 + + + + Kodak + DCS Pro 14N + DCS-14n + Nikon F AF + 1 + + + + Nikon + 35mm film: full frame + Nikon F AF + 1 + + + + Nikon + Nikon AF-S DX Zoom-Nikkor 12-24mm f/4G IF-ED + Nikkor AF-S 12-24mm f/4G DX IF-ED + Nikon F AF + + 1.528 + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 16-35mm f/4G ED VR + Nikkor AF-S 16-35mm f/4G ED VR + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S DX Nikkor 16-80mm f/2.8-4E ED VR + Nikkor AF-S 16-80mm f/2.8-4E DX ED VR + Nikon F AF + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S DX Zoom-Nikkor 16-85mm f/3.5-5.6G ED VR + Nikkor AF-S 16-85mm f/3.5-5.6G DX ED VR + Nikon F AF + + 1.528 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Zoom-Nikkor 17-35mm f/2.8D IF-ED + Nikkor AF-S 17-35mm f/2.8D IF-ED + Nikon F AF + + 1.528 + + + + + + + + + + + Nikon + Nikon AF-S DX Zoom-Nikkor 17-55mm f/2.8G IF-ED + Nikkor AF-S 17-55mm f/2.8G DX IF-ED + Nikon F AF + + 1.528 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 18-35mm f/3.5-4.5D IF-ED + Nikkor AF 18-35mm f/3.5-4.5D IF-ED + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 18-35mm f/3.5-4.5D IF-ED + Nikkor AF 18-35mm f/3.5-4.5D IF-ED + Nikon F AF + + 1.528 + + + + + + + + + + + + Nikon + Nikon AF-S DX Zoom-Nikkor 18-55mm f/3.5-5.6G ED + Nikkor AF-S 18-55mm f/3.5-5.6G DX ED + Nikon F AF + + 1.528 + + + + + + + + + + + + + + Nikon + Nikon AF-S DX Zoom-Nikkor 18-55mm f/3.5-5.6G VR + Nikkor AF-S 18-55mm f/3.5-5.6G DX VR + Nikon F AF + + 1.528 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S DX VR Nikkor 18-55mm f/3.5-5.6G II + Nikkor AF-S 18-55mm f/3.5-5.6G DX VR II + Nikon F AF + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S DX Zoom-Nikkor 18-70mm f/3.5-4.5G IF-ED + Nikkor AF-S 18-70mm f/3.5-4.5G DX IF-ED + Nikon F AF + + + + 1.528 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S DX Zoom-Nikkor 18-105mm f/3.5-5.6G ED VR + Nikkor AF-S 18-105mm f/3.5-5.6G DX ED VR + Nikon F AF + + + rectilinear + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S DX Zoom-Nikkor 18-135mm f/3.5-5.6G IF-ED + Nikkor AF-S 18-135mm f/3.5-5.6G DX IF-ED + Nikon F AF + + 1.528 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S DX VR Zoom-Nikkor 18-200mm f/3.5-5.6G IF-ED + Nikkor AF-S 18-200mm f/3.5-5.6G DX VR IF-ED + Nikon F AF + 1.5 + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S DX VR Zoom-Nikkor 18-200mm f/3.5-5.6G IF-ED II + Nikkor AF-S 18-200mm f/3.5-5.6G DX VR IF-ED II + Nikon F AF + 1.5 + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 24-50mm f/3.3-4.5D + Nikkor AF 24-50mm f/3.3-4.5D + Nikon F AF + + 1.528 + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 24-50mm f/3.3-4.5 + Nikkor AF 24-50mm f/3.3-4.5 + Nikon F AF + 1 + + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 24-85mm f/2.8-4D IF + Nikkor AF 24-85mm f/2.8-4D IF + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 24-85mm f/2.8-4D IF + Nikkor AF 24-85mm f/2.8-4D IF + Nikon F AF + + 1.528 + + + + + + + + + + + + Nikon + Nikon AF-S Zoom-Nikkor 24-85mm f/3.5-4.5G IF-ED + Nikkor AF-S 24-85mm f/3.5-4.5G IF-ED + Nikon F AF + 1 + + + + + + + + + + + Nikon + Nikon AF-S VR Zoom-Nikkor 24-120mm f/3.5-5.6G IF-ED + Nikkor AF-S 24-120mm f/3.5-5.6G VR IF-ED + Nikon F AF + + 1.528 + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 24-120mm f/4G ED VR 170 + Nikkor AF-S 24-120mm f/4G ED VR + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 28-85mm f/3.5-4.5 + Nikkor AF 28-85mm f/3.5-4.5 + Nikon F AF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 28-200mm f/3.5-5.6G IF-ED + Nikkor AF 28-200mm f/3.5-5.6G IF-ED + Nikon F AF + + 1.528 + + + + + + + + + + + + + + Nikon + Nikon AF-S Zoom-Nikkor 28-300mm f/3.5-5.6G ED VR + Nikkor AF-S 28-300mm f/3.5-5.6G ED VR + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 35-70mm f/2.8D + Nikkor AF 35-70mm f/2.8D + Nikon F AF + + 1.528 + + + + + + + + + + + + Nikon + Nikon AI-S Zoom-Nikkor 50-135mm f/3.5 + Nikkor AI-S 50-135mm f/3.5 + Nikon F AI-S + + 1.528 + + + + + + + + + Nikon + Nikon AF-S DX Zoom-Nikkor 55-200mm f/4-5.6G ED + Nikkor AF-S 55-200mm f/4-5.6G DX ED + Nikon F AF + + 1.528 + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 70-180mm f/4.5-5.6D ED Micro + Nikkor AF 70-180mm f/4.5-5.6D ED Micro + Nikon F AF + + 1.528 + + + + + + + + + + + Nikon + Nikon AF-S VR Zoom-Nikkor 70-200mm f/2.8G IF-ED + Nikkor AF-S 70-200mm f/2.8G VR IF-ED + Nikon F AF + + 1.528 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AI-S Zoom-Nikkor 70-210mm f/4.5-5.6 + Nikkor AI-S 70-210mm f/4.5-5.6 + Nikon F AI-S + 1 + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 70-210mm f/4 + Nikkor AF 70-210mm f/4 + Nikon F + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 70-210mm f/4 + Nikkor AF 70-210mm f/4 + Nikon F AF + + 1.528 + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Nikkor 70-210mm f/4-5.6 + Nikkor AF 70-210mm f/4-5.6 + Nikon F AF + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 70-300mm f/4-5.6D ED + Nikkor AF 70-300mm f/4-5.6D ED + Nikon F AF + + 1.528 + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 70-300mm f/4-5.6G + Nikkor AF 70-300mm f/4-5.6G + Nikon F AF + + 1.528 + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 80-200mm f/2.8D ED + Nikkor AF 80-200mm f/2.8D ED + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 80-200mm f/2.8 ED + Nikkor AF 80-200mm f/2.8 ED + Nikon F AF + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 80-400mm f/4.5-5.6G ED VR + Nikkor AF-S 80-400mm f/4.5-5.6G ED VR + Nikon F AF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 80-400mm f/4.5-5.6D ED VR 183 + Nikkor AF 80-400mm f/4.5-5.6D ED VR + Nikon F AF + + 1.528 + + + + + + + + + + + + Nikon + Nikon AF Nikkor 14mm f/2.8D ED + Nikkor AF 14mm f/2.8D ED + Nikon F AF + + 1.528 + + + + + + + Nikon + Nikon AI Nikkor 15mm f/3.5 + Nikkor AI 15mm f/3.5 + Nikon F AI + + 1.528 + + + + + + + Nikon + Nikon AF-S Nikkor 20mm f/1.8G ED + Nikkor AF-S 20mm f/1.8G ED + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Nikkor 20mm f/2.8D + Nikkor AF 20mm f/2.8D + Nikon F AF + + 1.528 + + + + + + + Nikon + Nikon AI-S Nikkor 24mm f/2.8 + Nikkor AI-S 24mm f/2.8 + Nikon F AI-S + 1 + + + + + + + + + + Nikon + Nikon AF Nikkor 24mm f/2.8D 54 + Nikkor AF 24mm f/2.8D + Nikon F AF + + 1.528 + + + + + + + Nikon + Nikon AF Nikkor 24mm f/2.8D + Nikkor AF 24mm f/2.8D + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + Nikon + Nikon AI-S Nikkor 24mm f/2 + Nikkor AI-S 24mm f/2 + Nikon F AI-S + + 1.528 + + + + + + + Nikon + Nikon AI-S Nikkor 28mm f/2.8 + Nikkor AI-S 28mm f/2.8 + Nikon F AI-S + 1 + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Nikkor 28mm f/2.8D 62 + Nikkor AF 28mm f/2.8D + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + Nikon + Nikon AI-S Nikkor 28mm f/2 + Nikkor AI-S 28mm f/2 + Nikon F AI-S + + 1.528 + + + + + + + Nikon + Nikon AI-S Nikkor 28mm f/3.5 PC (unshifted) + Nikkor AI-S 28mm f/3.5 PC (unshifted) + Nikkor AI-S 28mm f/3.5 PC (ungeshiftet) + Nikon F AI-S + 1 + + + + + + + Nikon + Nikon AF-S Nikkor 28mm f/1.8G + Nikkor AF-S 28mm f/1.8G + Nikon F AF + 1 + + + + + + + + + Nikon + Nikon AF Nikkor 28mm f/1.4D + Nikkor AF 28mm f/1.4D + Nikon F AF + 1 + + + + + + + + Nikon + Nikon AI-S Nikkor 35mm f/2 + Nikkor AI-S 35mm f/2 + Nikon F AI-S + 1 + + + + + + + + + Nikon + Nikon AI-S Nikkor 35mm f/1.4 + Nikkor AI-S 35mm f/1.4 + Nikon F AI-S + + 1.528 + + + + + + + Nikon + Nikon AF-S DX Nikkor 35mm f/1.8G + Nikkor AF-S 35mm f/1.8G DX + Nikon F AF + + 1.528 + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Nikkor 35mm f/2D 66 + Nikkor AF 35mm f/2.0D + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Nikkor 35mm f/2.8 PC "black knob" + Nikkor AF 35mm f/2.8 PC “black knob” + Nikkor AF 35mm f/2.8 PC „schwarzer Knauf“ + Nikon F + 1 + + + + + + + + + Nikon + Nikon Zoom-NIKKOR Auto 43-86mm F3.5 + Nikkor Auto 43-86mm f/3.5 + Nikon F + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AI Nikkor 45mm f/2.8 GN + Nikkor AI 45mm f/2.8 GN + Nikon F AI + + 1.528 + + + + + + + Nikon + Nikon AF Nikkor 50mm f/1.4D + Nikkor AF 50mm f/1.4D + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + Nikon + Nikon AI-S Nikkor 50mm f/1.4 + Nikkor AI-S 50mm f/1.4 + Nikon F AI-S + + 1.528 + + + + + + + + Nikon + Nikon AF Nikkor 50mm f/1.8D + Nikkor AF 50mm f/1.8D + Nikon F AF + + + rectilinear + + 1.528 + + + + + + + Nikon + Nikon AF Nikkor 50mm f/1.8D + Nikkor AF 50mm f/1.8D + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + Nikon + Nikon AI-S Nikkor 50mm f/1.8 + Nikkor AI-S 50mm f/1.8 + Nikon F AI-S + + 1.528 + + + + + + + Nikon + Nikon Nikkor 50mm f/2 + Nikkor 50mm f/2 + Nikon F + + 1.528 + + + + + + + Nikon + Nikon AI Nikkor 55mm f/1.2 + Nikkor AI 55mm f/1.2 + Nikon F AI + + 1.528 + + + + + + + Nikon + Nikon AI-S Nikkor 55mm f/2.8 Micro + Nikkor AI-S 55mm f/2.8 Micro + Nikon F AI-S + + 1.528 + + + + + + + + Nikon + Nikon AI-S Nikkor 55mm f/2.8 Micro + Nikkor AI-S 55mm f/2.8 Micro + Nikon F AI-S + 1 + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AI-S Nikkor 58mm f/1.2 Noct + Nikkor AI-S 58mm f/1.2 Noct + Nikon F AI + Nikon F AI-S + + 1.528 + + + + + + + Nikon + Nikon AF-S Nikkor 58mm f/1.4G + Nikkor AF-S 58mm f/1.4G + Nikon F AF + 1.0 + + + + + + + + Nikon + Nikon AF Nikkor 85mm f/1.8D + Nikkor AF 85mm f/1.8D + Nikon F AF + 1 + + + + + + + Nikon + Nikon AF Nikkor 105mm f/2.8D + Nikkor AF 105mm Micro f/2.8D + Nikon F AF + + 1.528 + + + + + + + Nikon + Nikon AF-S VR Micro-Nikkor 105mm f/2.8G IF-ED 138 + Nikkor AF-S VR 105mm f/2.8G Micro IF-ED + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AI-S Nikkor 135mm f/2 + Nikkor AI-S 135mm f/2 + Nikon F AI-S + + 1.528 + + + + + + + Nikon + Nikon AI-S Nikkor 180mm f/2.8 ED + Nikkor AI-S 180mm f/2.8 ED + Nikon F AI-S + + 1.528 + + + + + + + Nikon + Nikon AI-S Nikkor 500mm f/8 Reflex + Nikkor AI-S 500mm f/8 Reflex + Nikon F AI-S + 1 + + + + + + + + + Nikon + Nikon AI-S Nikkor 500mm f/8 Reflex + Nikkor AI-S 500mm f/8 Reflex + Nikon F AI-S + + 1.528 + + + + + + + Nikon + Nikon AF-S Nikkor 85mm f/1.8G 179 + Nikkor AF-S 85mm f/1.8G + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Nikkor 85mm f/1.8 21 + Nikkor AF 85mm f/1.8 + Nikon F AF + 1.523 + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Zoom-Nikkor 24-70mm f/2.8G ED + Nikkor AF-S 24-70mm f/2.8G ED + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Zoom-Nikkor 14-24mm f/2.8G ED 146 + Nikkor AF-S 14-24mm f/2.8G ED + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S VR Zoom-Nikkor 70-300mm f/4.5-5.6G IF-ED + Nikkor AF-S 70-300mm f/4.5-5.6G VR IF-ED + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S VR Zoom-Nikkor 70-300mm f/4.5-5.6G IF-ED + Nikkor AF-S 70-300mm f/4.5-5.6G VR IF-ED + Nikon F AF + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S VR Zoom-Nikkor 70-200mm f/4G IF-ED + Nikkor AF-S 70-200mm f/4G IF-ED VR + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AI-S Nikkor 50mm f/1.2 + Nikkor AI-S 50mm f/1.2 + Nikon F AI + Nikon F AI-S + 1 + + + + + + + + Nikon + Nikon AF-S Nikkor 50mm f/1.8G 176 + Nikkor AF-S 50mm f/1.8G + Nikon F AF + 1.523 + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 50mm f/1.8G + Nikkor AF-S 50mm f/1.8G + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S DX Nikkor 10-24mm f/3.5-4.5G ED + Nikkor AF-S 10-24mm f/3.5-4.5G DX ED + Nikon F AF + 1.558 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S DX Nikkor 55-300mm f/4.5-5.6G ED VR + Nikkor AF-S 55-300mm f/4.5-5.6G DX ED VR + Nikon F AF + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 50mm f/1.4G 160 + Nikkor AF-S 50mm f/1.4G + Nikon F AF + 1.534 + + + + + + + + Nikon + Nikon AF-S Nikkor 50mm f/1.4G + Nikkor AF-S 50mm f/1.4G + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Nikkor 20mm f/2.8D + Nikkor AF 20mm f/2.8D + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AI-S Nikkor 20mm f/2.8 + Nikkor AI-S 20mm f/2.8 + Nikon F AI-S + 1 + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 24-85 mm f/3.5-4.5G ED VR + Nikkor AF-S 24-85mm f/3.5-4.5G ED VR + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 800mm f/5.6E FL ED VR + Nikkor AF-S 800mm f/5.6E FL ED VR + Nikon F AF + + 1 + + + + + + + + + + Nikon + Nikon AF-S Nikkor 600mm f/4G ED VR + Nikkor AF-S 600mm f/4G ED VR + Nikon F AF + + 1 + + + + + + + + + + Nikon + Nikon AF-S DX Nikkor 18-140mm f/3.5-5.6G ED VR + Nikkor AF-S 18-140mm f/3.5-5.6G DX ED VR + Nikon F AF + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AI-S Fisheye-Nikkor 6mm f/2.8 + Nikkor AI-S 6mm f/2.8 Fisheye + Nikon F AI-S + fisheye + 1 + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 28-80mm f/3.3-5.6G + Nikkor AF 28-80mm f/3.3-5.6G + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 28-200mm f/3.5-5.6G IF-ED + Nikkor AF 28-200mm f/3.5-5.6G IF-ED + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 20-35mm f/2.8D IF + Nikkor AF 20-35mm f/2.8D IF + Nikon F AF + 1 + + + + + + + + + + + + + + + Nikon + Nikon Nikkor AI 20mm f/3.5 + Nikkor AI 20mm f/3.5 + Nikon F AI + 1 + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Micro-Nikkor 60mm f/2.8D + Nikkor AF 60mm f/2.8D Micro + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF DX Fisheye-Nikkor 10.5mm f/2.8G ED + Nikkor AF 10.5mm f/2.8G DX ED Fisheye + Nikon F AF + equisolid + 1.523 + + + + + + + + + + Nikon + Nikon AF DX Fisheye-Nikkor 10.5mm f/2.8G ED + Nikkor AF 10.5mm f/2.8G DX ED Fisheye + Nikon F AF + fisheye + 1 + + + + + + + + + Nikon + Nikon AF-S DX Nikkor 18-300mm f/3.5-6.3G ED VR + Nikkor AF-S 18-300mm f/3.5-6.3G DX ED VR + Nikon F AF + 1.523 + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Micro Nikkor 60mm f/2.8G ED + Nikkor AF-S 60mm f/2.8G ED Micro + Nikon F AF + 1.523 + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 85mm f/1.4G + Nikkor AF-S 85mm f/1.4G + Nikon F AF + 1 + + + + + + + + + Nikon + Nikon Lens Series E 28mm f/2.8 + Nikon F AI-S + 1 + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon Lens Series E 50mm f/1.8 + Nikon F AI-S + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon Lens Series E 100mm f/2.8 + Nikon F AI-S + 1 + + + + + + + + + Nikon + Nikon AF Micro-Nikkor 105mm f/2.8D + Nikkor AF 105mm f/2.8D Micro + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + Nikon + Nikkor 55mm f/3.5 Micro + Nikon F + 1.529 + + + + + + + + Nikon + Nikon AF-S Nikkor 300mm f/4E PF ED VR + Nikkor AF-S 300mm f/4E PF ED VR + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S DX Nikkor 18-300mm f/3.5-5.6G ED VR + Nikkor AF-S 18-300mm f/3.5-5.6G DX ED VR + Nikon F AF + 1.534 + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 35mm f/1.8G ED + Nikkor AF-S 35mm f/1.8G ED + Nikon F AF + 1 + + + + + + + + + Nikon + Nikon AF DC-Nikkor 135mm f/2D + Nikkor AF 135mm f/2D DC + Nikon F AF + 1 + + + + + + + + + Nikon + Nikon AF DC-Nikkor 105mm f/2D + Nikkor AF 105mm f/2D DC + Nikon F AF + 1 + + + + + + + + + Nikon + Nikon AF-P DX Nikkor 18-55mm f/3.5-5.6G VR + Nikkor AF-P 18-55mm f/3.5-5.6G DX VR + Nikon F AF + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 70-200mm f/2.8G ED VR II 162 + Nikkor AF-S 70-200mm f/2.8G ED VR II + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 70-200mm f/2.8G ED VR II + 2x extender + Nikkor AF-S 70-200mm f/2.8G ED VR II + Kenko TELE+ HD 2.0X + Nikon F AF + + 1.0 + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 28-70mm f/3.5-4.5D + Nikkor AF 28-70mm f/3.5-4.5D + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 28-105mm f/3.5-4.5D IF + Nikkor AF 28-105mm f/3.5-4.5D IF + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S DX Micro Nikkor 40mm f/2.8G + Nikkor AF-S 40mm f/2.8G DX Micro + Nikon F AF + 1.534 + + + + + + + + + Nikon + Nikon AF-P DX Nikkor 70-300mm f/4.5-6.3G ED VR + Nikkor AF-P 70-300mm f/4.5-6.3G DX ED VR + Nikon F AF + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-P Nikkor 70-300mm f/4.5-5.6E ED VR + Nikkor AF-P 70-300mm f/4.5-5.6E ED VR + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S DX Nikkor 35mm f/1.8G + Nikkor AF-S 35mm f/1.8G DX + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Nikkor 35-70mm f/2.8 + Nikkor AF 35-70mm f/2.8 + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AI-S Nikkor 50mm f/1.4 + Nikkor AI-S 50mm f/1.4 + Nikon F AI-S + 1 + + + + + + + + + + + + + + + + + + + Nikon + Nikon AI-S Nikkor 50mm f/1.8 + Nikkor AI-S 50mm f/1.8 + Nikon F AI-S + 1 + + + + + + + + + + + + + + + + + + + Nikon + Nikon AI-S Nikkor 105mm f/2.5 + Nikkor AI-S 105mm f/2.5 + Nikon F AI + Nikon F AI-S + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AI-S Nikkor 135mm f/2.8 + Nikkor AI-S 135mm f/2.8 + Nikon F AI-S + 1 + + + + + + + + + + + + + + + + + + + Nikon + Nikon AI-S Nikkor 135mm f/3.5 + Nikkor AI-S 135mm f/3.5 + Nikon F AI-S + 1 + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Nikkor 180mm f/2.8D IF-ED + Nikkor AF 180mm f/2.8D IF-ED + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + Nikon + Nikkor AI-S 85mm f/2.0 + Nikon F AI-S + 1 + + + + + + + + + Nikon + Nikon AI-S Nikkor 200mm f/4 + Nikkor AI-S 200mm f/4 + Nikon F AI-S + 1 + + + + + + + + + Nikon + Nikon AI-S Nikkor 300mm f/4.5 + Nikkor AI-S 300mm f/4.5 + Nikon F AI-S + 1 + + + + + + + + + Nikon + Nikon AF-S VR Nikkor 400mm f/2.8G ED + Nikkor AF-S 400mm f/2.8G ED VR + Nikon F AF + 1.0 + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S VR Nikkor 400mm f/2.8G ED + converter TC-14EIII + Nikkor AF-S 400mm f/2.8G ED + converter TC-14EIII + Nikon F AF + + + rectilinear + 1.0 + + + + + + + + + + + + + + + + Nikon + Nikon AF-S VR Nikkor 400mm f/2.8G ED + converter TC-20EIII + Nikkor AF-S 400mm f/2.8G ED + converter TC-20EIII + Nikon F AF + + + rectilinear + 1 + + + + + + + + + + + + + + + + Nikon + Nikon AI-S Nikkor 400mm f/3.5 + Nikkor AI-S 400mm f/3.5 + Nikon F AI-S + 1 + + + + + + + + + Nikon + Nikon AI-S Nikkor 400mm f/3.5 + TC14B teleconverter + Nikkor AI-S 400mm f/3.5 + TC14B teleconverter + Nikon F AI-S + 1 + + + + + + + + + Nikon + Nikon AF-S Nikkor 70-200mm f/2.8E FL ED VR 164 + Nikkor AF-S 70-200mm f/2.8E FL ED VR + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 300mm f/4D IF-ED + Nikkor AF-S 300mm f/4D IF-ED + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF Nikkor 300mm f/4 IF-ED + Nikkor AF 300mm f/4 IF-ED + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 24-70mm f/2.8E ED VR 170 + Nikkor AF-S 24-70mm f/2.8E ED VR + Nikon F AF + 1 + + + + + + + + + + + + + + + + + Nikon + Nikon AF-P DX Nikkor 10-20mm f/4.5-5.6G VR 168 + Nikon AF-P DX Nikkor 10-20mm f/4.5-5.6G VR + Nikkor AF-P 10-20mm f/4.5-5.6G DX VR + Nikon F AF + 1.534 + + + + + + + + + + + + + + + + + + Nikon + 200-500mm F5.6 174 + Nikkor AF-S 200-500mm f/5.6E ED VR + Nikon F AF + 1.534 + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 200-500mm f/5.6E ED VR + Nikkor AF-S 200-500mm f/5.6E ED VR + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AI 80-200mm f/4.5 Zoom New + Nikkor AI 80-200mm f/4.5 Zoom New + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Zoom-Nikkor 17-35mm f/2.8D IF-ED + Nikkor AF-S 17-35mm f/2.8D IF-ED + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 18-35mm f/3.5-4.5G ED + Nikkor AF-S 18-35mm f/3.5-4.5G ED + Nikon F AF + 1 + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 24mm f/1.8G ED + Nikkor AF-S 24mm f/1.8G ED + Nikon F AF + 1.001 + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S VR Zoom-Nikkor 70-200mm f/2.8G IF-ED + Nikkor AF-S 70-200mm f/2.8G IF-ED VR + Nikon F AF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 500mm f/5.6E PF ED VR + Nikkor AF-S 500mm f/5.6E PF ED VR + Nikon F AF + 1.0 + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 600mm f/4E FL ED VR + Nikkor AF-S 600mm f/4E FL ED VR + Nikon F AF + 1.0 + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 600mm f/4E FL ED VR + converter TC-14EIII + Nikkor AF-S 600mm f/4E FL ED VR + converter TC-14EIII + Nikon F AF + + + rectilinear + 1.0 + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S VR Zoom-Nikkor 200-400mm f/4G IF-ED + Nikkor AF-S 200-400mm f/4G IF-ED VR + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Nikkor 35mm f/1.4G + Nikkor AF-S 35mm f/1.4G + Nikon F AF + 1.0 + + + + + + + + + Nikon + Nikon AF-S Nikkor 105mm f/1.4E ED + Nikkor AF-S 105mm f/1.4E ED + Nikon F AF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S Micro Nikkor 60mm f/2.8G ED + Nikkor AF-S 60 mm f/2.8G ED Micro + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + Nikon + Nikon AF-S VR Nikkor 500mm f/4G ED + Nikkor AF-S 500mm f/4G ED VR + Nikon F AF + 1.534 + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 28-200mm f/3.5-5.6D IF + Nikkor AF 28-200mm f/3.5-5.6D IF + Nikon F AF + 1.0 + + + + + + + + + + + + + + + Nikon + Nikon AF Zoom-Nikkor 35-70mm f/3.3-4.5 N + Nikkor AF 35-70mm f/3.3-4.5 N + Nikon F AF + 1.0 + + + + + + + + + + + + Nikon + Nikon AF-S DX Nikkor 55-200mm f/4-5.6G ED VR II + Nikkor AF-S 55-200mm f/4-5.6G DX ED VR II + Nikon F AF + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 4/3 System + M42 + M39/1 + DKL + T2 + Generic + + + + Olympus OM + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Olympus Imaging Corp. + Olympus + E-300 + 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-330 + 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-400 + 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-410 + 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-420 + 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-450 + 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-500 + 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-510 + 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-520 + 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-600 + 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-620 + 4/3 System + 2 + + + + Olympus Optical Co.,Ltd + Olympus + E-10 + olympusE10 + 3.933 + + + + Olympus Optical Co.,Ltd + Olympus + E-20,E-20N,E-20P + E-20, E-20N, E-20P + olympusE10 + 3.933 + + + + Olympus Imaging Corp. + Olympus + E-30 + 4/3 System + 2 + + + + Olympus Corporation + Olympus + E-1 + 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-3 + 4/3 System + 2 + + + + Olympus Imaging Corp. + Olympus + E-5 + 4/3 System + 2 + + + + Olympus + Olympus Zuiko Digital ED 7-14mm f/4.0 + 4/3 System + 2 + 4:3 + + + + + + + + + + + + Olympus + Olympus Zuiko Digital ED 9-18mm f/4.0-5.6 + 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus Zuiko Digital 11-22mm f/2.8-3.5 + 4/3 System + 2 + 4:3 + + + + + + + + + + + + + Olympus + Olympus Zuiko Digital ED 14-42mm f/3.5-5.6 + 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus Zuiko Digital 14-45mm f/3.5-5.6 + 4/3 System + 2 + 4:3 + + + + + + + + + + + Olympus + Olympus Zuiko Digital 14-54mm f/2.8-3.5 + 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + Olympus + Olympus Zuiko Digital 25mm f/2.8 + 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus Zuiko Digital 35mm f/3.5 Macro + 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus Zuiko Digital 40-150mm f/3.5-4.5 + 4/3 System + 2 + 4:3 + + + + + + + + + + + Olympus + Olympus Zuiko Digital ED 40-150mm f/4.0-5.6 + 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus Zuiko Digital ED 50-200mm f/2.8-3.5 + 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus Zuiko Digital ED 50-200mm f/2.8-3.5 SWD + 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus Zuiko Digital ED 50-200mm f/2.8-3.5 SWD + EC-14 1.4x extender + Olympus Zuiko Digital ED 50-200mm f/2.8-3.5 SWD + EC-14 1.4× extender + 4/3 System + 2.0 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus Zuiko Digital ED 50-200mm f/2.8-3.5 SWD + EC-20 2x extender + Olympus Zuiko Digital ED 50-200mm f/2.8-3.5 SWD + EC-20 2× extender + 4/3 System + 2.0 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus Zuiko Digital ED 50mm f/2.0 Macro + 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus E-10 & compatibles (Standard) + fixed lens + festes Objektiv + olympusE10 + 3.933 + + + + + + + + + + + + + + + + + Olympus + Olympus E-10 & compatibles, with WCON-08B + fixed lens, with WCON-08B + festes Objektiv, mit WCON-08B + olympusE10 + 3.933 + + + + + + + + + + + Olympus + Olympus E-10 & compatibles, with B-300 (full tele) + fixed lens, with B-300 (full tele) + festes Objektiv, mit B-300 (längste Brennw.) + olympusE10 + 3.933 + + + + + + + Olympus + Olympus E-10 & compatibles, macro (full tele): 8 inches lens-to-subject + fixed lens, macro (full tele): 8 inches lens-to-subject + festes Objektiv, Makro (längste Brennw.): 8 Zoll Fokusabstand + olympusE10 + 3.933 + + + + + + + Olympus + Olympus E-10 & compatibles, macro (full tele): 12 inches lens-to-subject + fixed lens, macro (full tele): 12 inches lens-to-subject + festes Objektiv, Makro (längste Brennw.): 12 Zoll Fokusabstand + olympusE10 + 3.933 + + + + + + + Olympus + Olympus E-10 & compatibles, macro (full tele): 16 inches lens-to-subject + fixed lens, macro (full tele): 16 inches lens-to-subject + festes Objektiv, Makro (längste Brennw.): 16 Zoll Fokusabstand + olympusE10 + 3.933 + + + + + + + Olympus + Olympus E-10 & compatibles, macro (full tele): 20 inches lens-to-subject + fixed lens, macro (full tele): 20 inches lens-to-subject + festes Objektiv, Makro (längste Brennw.): 20 Zoll Fokusabstand + olympusE10 + 3.933 + + + + + + + Olympus + Olympus Zuiko Digital ED 12-60mm f/2.8-4.0 SWD + 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus Zuiko Digital ED 14-35mm F2.0 SWD + 4/3 System + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Zuiko Auto-S 50mm f/1.8 + Olympus OM + 1.613 + + + + + + + + + + + + + + + + + + + Olympus + Olympus Zuiko Digital Pro ED 35-100mm F2.0 + 4/3 System + 2.0 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus Zuiko Digital 70-300mm F4.0-5.6 + 4/3 System + 2.0 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Olympus + Olympus OM-System Zuiko Auto-S 50 mm f/1.8 (Vers. S/N 5хххххх) + Olympus OM + 2.0 + 4:3 + + + + + + + + + + + + Panasonic + DMC-L1 + 4/3 System + 2 + + + + Panasonic + DMC-L10 + 4/3 System + 2 + + + + + + + + Pentax K + Байонет K + Pentax KA + Pentax KAF + Pentax KAF2 + Pentax KAF3 + Pentax KAF4 + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Pentax KA + Pentax K + Pentax KAF + Pentax KAF2 + Pentax KAF3 + Pentax KAF4 + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Pentax KAF + Pentax K + Pentax KA + Pentax KAF2 + Pentax KAF3 + Pentax KAF4 + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Pentax KAF2 + Pentax K + Pentax KA + Pentax KAF + Pentax KAF3 + Pentax KAF4 + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Pentax KAF3 + Pentax K + Pentax KA + Pentax KAF + Pentax KAF2 + Pentax KAF4 + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Pentax KAF4 + Pentax K + Pentax KA + Pentax KAF + Pentax KAF2 + Pentax KAF3 + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Pentax 645AF2 + Generic + + + + Pentax + 35mm film: full frame + Pentax KAF2 + 1 + + + + Pentax Corporation + Pentax + Pentax *ist DL2 + *ist DL2 + Pentax KAF2 + 1.531 + + + + Pentax Corporation + Pentax + Pentax *ist DL + *ist DL + Pentax KAF2 + 1.531 + + + + Pentax Corporation + Pentax + Pentax *ist DS2 + *ist DS2 + Pentax KAF2 + 1.531 + + + + Pentax Corporation + Pentax + Pentax *ist DS + *ist DS + Pentax KAF2 + 1.531 + + + + Pentax Corporation + Pentax + Pentax *ist D + *ist D + Pentax KAF2 + 1.531 + + + + Pentax + Pentax K-m + K-m + Pentax KAF2 + 1.531 + + + + Pentax Corporation + Pentax + Pentax K100D + K100D + Pentax KAF2 + 1.531 + + + + Pentax Corporation + Pentax + Pentax K100D Super + K100D Super + Pentax KAF2 + 1.531 + + + + Pentax Corporation + Pentax + Pentax K110D + K110D + Pentax KAF2 + 1.531 + + + + Pentax Corporation + Pentax + Pentax K10D + K10D + Pentax KAF2 + 1.531 + + + + Pentax Corporation + Pentax + Pentax K20D + K20D + Pentax KAF2 + 1.538 + + + + Pentax + Pentax K-30 + K-30 + Pentax KAF2 + 1.526 + + + + Pentax + Pentax K-50 + K-50 + Pentax KAF2 + 1.526 + + + + Pentax + Pentax K-500 + K-500 + Pentax KAF2 + 1.534 + + + + Pentax + Pentax K-7 + K-7 + Pentax KAF2 + 1.538 + + + + Pentax + Pentax K-5 + K-5 + Pentax KAF2 + 1.526 + + + + Pentax + Pentax K-5 II + K-5 II + Pentax KAF2 + 1.526 + + + + Pentax + Pentax K-5 II s + K-5 IIs + Pentax KAF2 + 1.526 + + + + Ricoh Imaging Company, Ltd. + Pentax + Pentax K-3 + K-3 + Pentax KAF2 + 1.534 + + + + Ricoh Imaging Company, Ltd. + Pentax + Pentax K-3 II + K-3 II + Pentax KAF2 + 1.534 + + + + Ricoh Imaging Company, Ltd. + Pentax + Pentax K-3 Mark III + K-3 III + Pentax KAF2 + 1.546 + + + + Ricoh Imaging Company, Ltd. + Pentax + Pentax K-3 Mark III Monochrome + K-3 III Monochrome + Pentax KAF2 + 1.546 + + + + Ricoh Imaging Company, Ltd. + Pentax + Pentax K-1 + K-1 + Pentax KAF4 + 1 + + + + Ricoh Imaging Company, Ltd. + Pentax + Pentax K-1 Mark II + K-1 II + Pentax KAF4 + 1.0 + + + + Pentax + Pentax K2000 + K2000 + Pentax KAF2 + 1.531 + + + + Pentax + Pentax K200D + K200D + Pentax KAF2 + 1.531 + + + + Pentax + Pentax K-x + K-x + Pentax KAF2 + 1.531 + + + + Pentax + Pentax K-r + K-r + Pentax KAF2 + 1.523 + + + + Ricoh Imaging Company, Ltd. + Pentax + Pentax K-S2 + K-S2 + Pentax KAF2 + 1.534 + + + + Ricoh Imaging Company, Ltd. + Pentax + Pentax K-S1 + K-S1 + Pentax KAF2 + 1.534 + + + + Ricoh Imaging Company, Ltd. + Pentax + Pentax K-70 + K-70 + Pentax KAF4 + 1.534 + + + + Pentax + Pentax K-01 + K-01 + Pentax KAF2 + 1.522 + + + + Ricoh Imaging Company, Ltd. + Pentax + Pentax KF + KF + Pentax KAF2 + 1.534 + + + + Ricoh Imaging Company, Ltd. + Pentax + Pentax KP + KP + Pentax KAF2 + 1.534 + + + + Pentax + Pentax 645D + 645D + Pentax 645AF2 + 0.79 + + + + Ricoh Imaging Company, Ltd. + Pentax + Pentax 645Z + 645Z + Pentax 645AF2 + 0.79 + + + + Pentax + smc Pentax-DA 12-24mm f/4 ED AL IF + Pentax KAF2 + + 1.53 + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-DA 16-45mm f/4 ED AL + Pentax KAF2 + 1.522 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + HD Pentax-D FA 15-30mm f/2.8 ED SDM WR + Pentax K + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + HD Pentax-DA 16-85mm f/3.5-5.6 ED DC WR + Pentax KAF2 + 1.526 + + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-DA 18-55mm f/3.5-5.6 AL + + Pentax KAF2 + + + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + + smc Pentax-DA 18-55mm f/3.5-5.6 AL II L WR + smc Pentax-DA 18-55mm f/3.5-5.6 AL II/L/WR + Pentax KAF2 + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-DA 18-135mm f/3.5-5.6 ED AL IF DC WR + Pentax K + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-DA 18-250mm f/3.5-6.3 ED AL [IF] + + Pentax KAF2 + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + Pentax-F 28-80mm f/3.5-4.5 + Pentax KAF2 + 1.526 + + + + + + + + + + + + + + + + + Pentax + HD Pentax-D FA 28-105mm f/3.5-5.6 ED DC WR + Pentax KAF3 + 1 + + + + + + + + + + + + + + + + + Pentax + HD Pentax-D FA* 70-200mm f/2.8 ED DC AW + Pentax KAF3 + 1 + + + + + + + + + + + + + + + Pentax + smc Pentax-DA 50-200mm f/4-5.6 DA ED + Pentax KAF2 + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + HD Pentax-DA 55-300mm f/4-5.8 ED WR + Pentax KAF3 + 1 + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-DA 55-300mm f/4-5.8 ED + Pentax KAF2 + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-DA L 55-300mm f/4-5.8 ED + Pentax KAF2 + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-DA 15mm f/4 ED AL Limited + Pentax KAF2 + + 1.53 + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax K 30mm f/2.8 + Pentax K + + 1.53 + + + + + + + + + Pentax + smc Pentax-DA 40mm f/2.8 Limited + Pentax KAF2 + + 1.53 + + + + + + + + + Pentax + smc Pentax-DA 40mm f/2.8 XS + Pentax KAF2 + 1 + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-FA 43mm f/1.9 Limited + Pentax KAF2 + + 1.53 + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-FA 77mm f/1.8 Limited + Pentax KAF3 + 1 + + + + + + + + + + + + + + + + + + + + + + + Pentax + Takumar 135mm f/2.5 Bayonet + Pentax K + + 1.53 + + + + + + + + + Pentax + smc Pentax-M 50mm f/1.7 + Pentax K + 1.526 + + + + + + + + + Pentax + smc Pentax-M 50mm f/2 + Pentax K + + 1.53 + + + + + + + + + Pentax + smc Pentax-D FA Macro 100mm f/2.8 WR + Pentax KAF2 + + 1.53 + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-D FA Macro 100mm f/2.8 WR + Pentax KAF + 1 + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-M 150mm f/3.5 + Pentax K + + 1.53 + + + + + + + + + Pentax + smc Pentax-DA 35mm f/2.4 AL + Pentax KAF2 + 1.526 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-DA 35mm f/2.4 AL + Pentax KAF + 1 + + + + + + + + + + Pentax + HD Pentax-DA 70mm f/2.4 Limited + Pentax KAF2 + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-DA 70mm f/2.4 Limited + Pentax KAF2 + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-DA* 50-135mm f/2.8 ED IF SDM + Pentax KAF2 + 1.526 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-FA 50mm f/1.4 + Pentax KAF2 + 1.526 + + + + + + + + + + + + + + + + Pentax + smc Pentax-FA 50mm f/1.4 + Pentax KAF2 + 1 + + + + + + + + + + + + + + + + + + + Pentax + HD Pentax-DA 21mm f/3.2 ED AL Limited + Pentax KAF2 + 1.526 + + + + + + + + Pentax + smc Pentax-DA 21mm f/3.2 AL Limited + Pentax KAF2 + 1.526 + + + + + + + + Pentax + smc Pentax-FA 28mm f/2.8 AL + Pentax KAF2 + + 1.53 + + + + + + + + + + + + Pentax + smc Pentax-FA 28mm f/2.8 AL + Pentax KAF2 + 1 + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-DA* 16-50mm f/2.8 ED AL IF SDM + Pentax KAF2 + 1.526 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-DA Fish-Eye 10-17mm f/3.5-4.5 ED IF + Pentax KAF2 + equisolid + 1.538 + + + + + + + + + + + + + + + + + Pentax + smc Pentax-A 50mm f/1.7 + Pentax KA + 1 + + + + + + + + + Pentax + smc Pentax-A 50mm f/1.7 + Pentax KA + 1.526 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-A 28mm 1:2.8 + Pentax KA + + 1.538 + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-M 28mm 1:3.5 + Pentax K + 1.538 + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-M 35mm 1:2 + Pentax K + 1.538 + + + + + + + + + Pentax + smc Pentax-FA 31mm f/1.8 AL Limited + Pentax KAF2 + 1.0 + + + + + + + + Pentax + smc Pentax-FA 31mm f/1.8 AL Limited + Pentax KAF2 + 1.526 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-DA 50mm f/1.8 + Pentax KAF2 + 1.526 + + + + + + + + + Pentax + smc Pentax-DA 50mm f/1.8 + Pentax KAF2 + 1 + + + + + + + + + Pentax + HD Pentax-DA 20-40mm f/2.8-4 ED Limited DC WR + Pentax KAF2 + 1.526 + + + + + + + + + + + + + + + Pentax + smc Pentax-M Macro 1:4 50mm + Pentax K + 1.529 + + + + + + + + + Pentax + smc Pentax-M Macro 1:4 100mm + Pentax K + 1.531 + + + + + + + + + + Pentax + smc Pentax-DA L 18-50mm f/4-5.6 DC WR RE + Pentax KAF3 + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-DA L 18-50mm f/4-5.6 DC WR RE + Pentax KAF3 + 1 + + + + + + + + + + + + + + + Pentax + HD Pentax-DA 18-50mm f/4-5.6 DC WR RE + Pentax KAF2 + 1.522 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + HD Pentax-D FA 150-450mm f/4.5-5.6 ED DC AW + Pentax KAF3 + 1 + + + + + + + + + + + + + Pentax + smc Pentax-DA L 50-200mm f/4-5.6 ED WR + Pentax KAF2 + 1.534 + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-DA L 50-200mm f/4-5.6 ED WR + Pentax KAF + 1 + + + + + + + + + + + + + + + Pentax + smc Pentax-DA 17-70mm f/4 AL [IF] SDM + Pentax KAF2 + + 1.53 + + + + + + + + + + + + + + + + Pentax + Super-Takumar 55mm f/1.8 + M42 + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + Pentax + Super-Takumar 50mm f/1.4 + M42 + 1 + + + + + + + + + + Pentax + HD Pentax-D FA 24-70mm f/2.8 ED SDM WR + Pentax KAF3 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-DA 35mm f/2.8 Macro Limited + Pentax KAF3 + 1 + + + + + + + + + + + + + + + + + + + Pentax + Pentax SMC Takumar 50mm f/1.4 + M42 + Sony E + 1 + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-FA 28-70mm f/4 AL + Pentax KAF + 1 + + + + + + + + + + + + + + + Pentax + smc Pentax-A 50mm f/1.4 + Pentax KA + 1.522 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-F 28mm f/2.8 + Pentax KAF + 1.522 + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax DA* 60-250mm f/4 [IF] SDM + smc Pentax DA* 60-250mm f/4 IF SDM + Pentax KAF2 + 1.534 + + + + + + + + + + + + Pentax + HD Pentax-DA 55-300mm f/4.5-6.3 ED PLM WR RE + Pentax KAF2 + 1.534 + + + + + + + + + + + + + + + + + Pentax + smc Pentax-F 35-80mm f/4-5.6 + Pentax KAF2 + 1.531 + + + + + + + + + + + + + + + + + + Pentax + HD Pentax-DA* 11-18mm f/2.8 ED DC AW + Pentax KAF2 + 1.534 + + + + + + + + + + + + + + + + + Pentax + HD Pentax DA* 16-50mm f/2.8 ED PLM AW + Pentax KAF2 + 1.546 + + + + + + + + + + + + + + + + + Pentax + smc Pentax-F ZOOM 35-70mm f/3.5-4.5 + Pentax K + 1.538 + + + + + + + + + + + + + + + + + Pentax + smc Pentax-M 50mm f/1.4 + Pentax K + 1.538 + + + + + + + + + Pentax + smc Pentax-FA 50mm f/1.7 + Pentax KAF2 + 1.538 + + + + + + + + Pentax + smc Pentax-DA* 55mm f/1.4 SDM + Pentax KAF + 1.538 + + + + + + + + + Pentax + smc Pentax Takumar 135mm f/2.5 (V2/43812) + M42 + 1.0 + + + + + + + + + + + + + + + + + + + + + + + Pentax + smc Pentax-M 28mm f/2.8 + Pentax K + 1.0 + + + + + + + + + Pentax + Super-Multi-Coated Takumar 400mm f/5.6 + M42 + 1.0 + + + + + + + + + Ricoh Imaging Company + Pentax + HD PENTAX-D FA 21mm F2.4 ED Limited DC WR + Pentax KAF4 + 1.0 + + + + + + + + + + + + + Ricoh + Ricoh XR Rikenon 1:1.4 50mm + Pentax K + 1.523 + + + + + + + + + Ricoh + Ricoh 50mm 1:2.0 + Pentax K + 1 + + + + + + + + + + + + + + + + + + + + + + Ricoh + Rikenon P 50mm f/2 + Pentax K + 1.538 + + + + + + + + + + + + + Samsung Techwin Co. + Samsung + SAMSUNG GX10 + GX10 + Pentax KAF2 + 1.531 + + + + Samsung Techwin Co. + Samsung + GX20 + GX20 + Pentax KAF2 + 1.538 + + + + Samsung Techwin + Samsung + GX-1S + GX-1S + Pentax KAF2 + 1.531 + + + + Samsung Techwin + Samsung + GX-1L + GX-1L + Pentax KAF2 + 1.531 + + + + + + + + Samyang + Samyang 8mm f/3.5 Fish-Eye CS + Samyang 8mm f/3.5 Fischauge CS + Pentax KAF + Canon EF + Nikon F AI + Fujifilm X + Sony Alpha + Sony E + 4/3 System + Micro 4/3 System + Samsung NX + stereographic + 1.534 + + + + + + + + + + Samyang + Samyang 10mm f/2.8 ED AS NCS CS + Canon EF + Canon EF-M + Fujifilm X + Micro 4/3 System + Nikon F AI + Pentax KAF + Samsung NX + Sony Alpha + Sony E + 1.534 + + + + + + + + + Samyang + Samyang 12mm f/3.1 VDSLR ED AS NCS Fish-eye + Nikon F AF + 1.0 + + + + + + + Samyang + + Samyang 14mm f/2.8 AE ED AS IF UMC + Pentax KAF + Canon EF + Nikon F AI + Fujifilm X + Sony Alpha + Sony E + 4/3 System + Micro 4/3 System + Samsung NX + Nikon CX + Canon EF-M + 1 + + + + + + + + Samyang + + Samyang 14mm f/2.8 AE ED AS IF UMC + Pentax KAF + Canon EF + Nikon F AI + Fujifilm X + Sony Alpha + Sony E + 4/3 System + Micro 4/3 System + Samsung NX + Nikon CX + Canon EF-M + 1.523 + + + + + + + + + + + + + + + + + Samyang + Samyang 16mm f/2.0 ED AS UMC CS + Nikon F AF + Canon EF + Fujifilm X + Sony Alpha + Micro 4/3 System + Samsung NX + Canon EF-M + Pentax KAF + 1.534 + + + + + + + + + Samyang + Samyang 20mm f/1.8 ED AS UMC + Pentax K + Canon EF + Nikon F AI + Fujifilm X + Sony Alpha + Sony E + Micro 4/3 System + Samsung NX + Canon EF-M + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + Samyang + Samyang 500mm f/6.3 MC IF Mirror Lens + Samyang 500mm f/6.3 MC IF Spiegelobjektiv + T2 + + + 1.534 + + + + + + + + + + + Samyang + Samyang 35mm f/1.4 AS UMC + + Nikon F AI + 1 + + + + + + + + Samyang + Samyang T-S 24mm f/3.5 ED AS UMC + Nikon F AI + Canon EF + Sony Alpha + Sony E + Pentax KAF + 1 + + + + + + + + + Samyang + Samyang 12mm f/2.8 Fish-Eye ED AS NCS + Samyang 12mm f/2.8 Fischauge ED AS NCS + Nikon F AI + Canon EF + Sony E + stereographic + 1 + + + + + + + + + + + + + + + + Samyang + Samyang 35mm T1.5 Cine Lens + Canon EF + 1.620 + + + + + + + + Samyang + Samyang 135mm f/2 ED UMC + Nikon F + Canon EF + Pentax KAF + Micro 4/3 System + Sony Alpha + Sony E + Fujifilm X + Samsung NX + + 1 + + + + + + + + + + + + + + + + + + Samyang + Samyang 35mm f/1.4 AS UMC + Canon EF-S + 1.605 + + + + + + + + + Samyang + Samyang 85mm f/1.4 IF UMC Aspherical + Canon EF + Canon EF-M + Fujifilm X + Micro 4/3 System + Nikon F AI + 4/3 System + Pentax KAF + Samsung NX + Sony Alpha + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + Samyang + Samyang 800mm f/8 Mirror DX + T2 + + 1.0 + + + + + + + + + + + + + + Schneider-Kreuznach + PC-Super-Angulon 28mm f/2.8 + Canon EF + Nikon F AI-S + Pentax KAF2 + Sony Alpha + 1 + + + + + + + Schneider + Schneider-Kreuznach + D-Xenon 1:3.5-5.6 18-55mm AL + Pentax KAF2 + + 1.53 + + + + + + + + + + + Schneider + Schneider-Kreuznach + D-Xenon 1:4-5.6 50-200mm AL + Pentax KAF2 + + 1.53 + + + + + + + + + + + + + + Schneider-Kreuznach + Retina-Curtagon 1:4/28mm + DKL + 1.529 + + + + + + + + + Schneider-Kreuznach + Retina-Curtagon 28mm f/4 + DKL + 1.0 + + + + + + + + + Schneider-Kreuznach + Curtagon 35mm f/4 + M42 + 1.0 + + + + + + + + + Schneider-Kreuznach + Retina-Curtagon 35mm f/2.8 + DKL + 1.0 + + + + + + + + + Schneider-Kreuznach + Retina-Tele-Arton 85mm f/4 + DKL + 1.0 + + + + + + + + + Schneider-Kreuznach + Tele-Xenar 90mm f/3.5 + M42 + 1.0 + + + + + + + + + Schneider-Kreuznach + Retina-Tele-Xenar 135mm f/4 + DKL + 1.0 + + + + + + + + + Schneider-Kreuznach + Retina-Xenon 50mm f/1.9 + DKL + 1.0 + + + + + + + + + + + + + Sigma SA + M42 + M39/1 + DKL + T2 + Generic + + + + Sigma + Sigma SD1 + SD1 + Sigma SA + 1.500 + + + + Sigma + Sigma SD1 Merrill + SD1 Merrill + Sigma SA + 1.500 + + + + Sigma + Sigma SD9 + SD9 + Sigma SA + 1.739 + + + + Sigma + Sigma SD10 + SD10 + Sigma SA + 1.739 + + + + Sigma + Sigma SD14 + SD14 + Sigma SA + 1.739 + + + + Sigma + Sigma SD15 + SD15 + Sigma SA + 1.739 + + + + Sigma + Sigma 10-20mm f/4-5.6 EX DC HSM + + Sigma 10-20mm f/4-5.6 EX DC + Nikon F AF + Sigma SA + Canon EF + Pentax KAF2 + Sony Alpha + 4/3 System + + + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 10-20mm f/4-5.6 EX DC HSM + + Sigma 10-20mm f/4-5.6 EX DC + Nikon F AF + Sigma SA + Canon EF + Pentax KAF2 + Sony Alpha + 4/3 System + + + 1.620 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 12-24mm F4 DG HSM | A + Nikon F AF + Sigma SA + Canon EF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 12-24mm f/4.5-5.6 EX DG Aspherical HSM + Sigma SA + Canon EF + Nikon F AF + Pentax KAF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 15-30mm f/3.5-4.5 EX DG Aspherical + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 15-30mm f/3.5-4.5 EX DG Aspherical + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + + 1.611 + + + + + + + + + + + + + + + Sigma + Sigma 17-35mm f/2.8-4 EX DG + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + + 1.53 + + + + + + + + + + + Sigma + Sigma 17-35mm F2.8-4 EX DG Aspherical HSM + Nikon F AF + Sigma SA + Canon EF + Minolta AF + Pentax KAF + 1 + + + + + + + + + + + + Sigma + Sigma 17-70mm f/2.8-4.5 DC Macro + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + + 1.611 + + + + + + + + + + + + + + Sigma + Sigma 17-70mm f/2.8-4.5 DC Macro + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 18-50mm f/2.8 EX DC + Sigma SA + Nikon F AF + Pentax KAF + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 18-50mm f/2.8 EX DC + Canon EF + + 1.611 + + + + + + + + + + + + + Sigma + Sigma 18-50mm f/3.5-5.6 DC + Sigma SA + Canon EF + Nikon F AF + Pentax KAF + 4/3 System + + 1.611 + + + + + + + + + + + + + + + Sigma + Sigma 18-125mm f/3.5-5.6 DC + Sigma SA + Canon EF + Nikon F AF + Pentax KAF + 4/3 System + + 1.53 + + + + + + + + + + + + Sigma + Sigma 18-125mm f/3.5-5.6 DC + Sigma SA + Canon EF + Nikon F AF + Pentax KAF + 4/3 System + + 1.611 + + + + + + + + + + + + + + + Sigma + Sigma 18-200mm f/3.5-6.3 DC + Sigma SA + Nikon F AF + Canon EF + Pentax KAF2 + Sony Alpha + + + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 18-200mm f/3.5-6.3 II DC OS HSM + Sigma + Canon EF + Nikon F AF + Pentax KAF + + 1.53 + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 18-200mm f/3.5-6.3 DC Macro OS HSM + Sigma SA + Nikon F AF + Canon EF-S + Pentax KAF + Minolta AF + Sony Alpha + 1.523 + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 24-60mm f/2.8 EX DG + Nikon F AF + Canon EF + Pentax KAF2 + Sony Alpha + Sigma SA + + + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 24-60mm f/2.8 EX DG + Canon EF + Nikon F AF + Pentax KAF + Sigma SA + Sony Alpha + 1.0 + + + + + + + + + + + + + Sigma + Sigma 24-70mm f/2.8 EX DG Macro + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + + 1.611 + + + + + + + + + + + + + Sigma + Sigma 24-70mm f/2.8 IF EX DG HSM + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + 1.526 + + + + + + + + + + + + Sigma + Sigma 24-70mm f/2.8 IF EX DG HSM + Sigma SA + Canon EF + Sony Alpha + Nikon F AF + Pentax KAF + 1.005 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 28-70mm f/2.8 EX DG + Sigma SA + Canon EF + Nikon F AF + Pentax KAF + 1 + + + + + + + + + + + + + + + Sigma + Sigma 28-70mm f/2.8 AF + Minolta AF + 1 + + + + + + + + + + + Sigma + Sigma 28-300mm f/3.5-6.3 Macro ASP IF + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + + 1.53 + + + + + + + + + + + + + + Sigma + Sigma 50-500mm f/4-6.3 EX DG HSM + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + 4/3 System + + 1.53 + + + + + + + + + + + + + + + Sigma + Sigma 50-500mm f/4.5-6.3 APO DG OS HSM + Sigma SA + Canon EF + Nikon F AF + Pentax KAF + Sony Alpha + 1 + + + + + + + + + + + + + + Sigma + Sigma 55-200mm f/4-5.6 DC + Canon EF + Nikon F AF + Pentax KAF2 + 4/3 System + 1.531 + + + + + + + + + + + + + + Sigma + Sigma 70-300mm f/4-5.6 APO Macro Super II + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + + 1.611 + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 70-300mm f/4-5.6 DG OS + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 70-300mm f/4-5.6 DL Macro + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 150-500mm f/5-6.3 APO DG OS HSM + Nikon F AF + Sigma SA + Canon EF + Sony Alpha + Pentax KAF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 14mm f/1.8 DG HSM | A + Sigma SA + Canon EF + Nikon F + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 14mm f/2.8 EX + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + 1 + + + + + + + Sigma + Sigma 14mm f/3.5 EX + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + + 1.53 + + + + + + + Sigma + Sigma 20mm f/1.8 EX DG + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + 1 + + + + + + + Sigma + Sigma 28mm f/1.8 EX DG + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + + 1.53 + + + + + + + Sigma + Sigma 30mm f/1.4 EX DC HSM + Sigma SA + Canon EF + Minolta AF + Nikon F AF + Pentax KAF + 4/3 System + + 1.53 + + + + + + + + Sigma + Sigma 30mm f/1.4 EX DC HSM + Canon EF + Sigma SA + Nikon F AF + Sony Alpha + Pentax KAF + 1.620 + + + + + + + + + + + + + + + + + + + Sigma + Sigma 50mm f/1.4 EX DG HSM + Sigma SA + Canon EF + Nikon F AF + Sony Alpha + Pentax KAF + 4/3 System + 1 + + + + + + + + + + + + + + + + + + + Sigma + Sigma 50mm f/1.4 EX DG HSM + Sigma SA + Canon EF + Nikon F AF + Sony Alpha + Pentax KAF + 4/3 System + + 1.53 + + + + + + + + + + + + + + + + + + + Sigma + Sigma 70mm f/2.8 EX DG Macro + Sigma SA + Canon EF + Nikon F AF + Sony Alpha + Pentax KAF + 1.534 + + + + + + + + Sigma + Sigma 85mm f/1.4 EX DG HSM + Sigma SA + Canon EF + Nikon F AF + Sony Alpha + Pentax KAF + 1.534 + + + + + + + + + Sigma + Sigma 150mm f/2.8 EX DG APO HSM Macro + 4/3 System + + + 2 + 4:3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 150mm f/2.8 EX DG APO HSM Macro + Canon EF + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + Sigma + Sigma 17-50mm f/2.8 EX DC OS HSM + Sigma SA + Nikon F AF + Canon EF + Pentax KAF2 + Sony Alpha + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 17-50mm f/2.8 EX DC HSM + Pentax KAF3 + 1 + + + + + + + + + + + + + Sigma + Sigma 24mm f/1.4 DG HSM | [A] Art 015 + Sigma 24mm f/1.4 DG HSM | A + Nikon F AF + Sigma SA + Canon EF + Sony E + Leica L + 1 + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 24mm F1.4 DG HSM | A + Sigma 24mm f/1.4 DG HSM | A + Nikon F AF + Sigma SA + Canon EF + Sony E + Leica L + 1.534 + + + + + + + + + + + + + + + + + + + Sigma + Sigma 35mm f/1.4 DG HSM | A + Nikon F AF + Sigma SA + Canon EF + Sony Alpha + Pentax KAF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 8mm f/3.5 EX DG Circular + Sigma 8mm f/3.5 EX DG circular fisheye + Sigma 8mm f/3.5 EX DG zirkulares Fischauge + Nikon F AF + Sigma SA + Canon EF + equisolid + 1.523 + + + + + + + + + Sigma + Sigma 8mm f/3.5 EX DG Circular + Sigma 8mm f/3.5 EX DG circular fisheye + Sigma 8mm f/3.5 EX DG zirkulares Fischauge + Nikon F AF + Sigma SA + Canon EF + equisolid + 1.620 + + + + + + + + + Sigma + Sigma 8mm f/3.5 EX DG Circular + Sigma 8mm f/3.5 EX DG circular fisheye + Sigma 8mm f/3.5 EX DG zirkulares Fischauge + Nikon F AF + Sigma SA + Canon EF + equisolid + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 8-16mm f/4.5-5.6 DC HSM + Sigma SA + Canon EF + Nikon F AF + Pentax KAF + Sony Alpha + 1.613 + + + + + + + + + + + + + + + + + Sigma + Sigma 8-16mm f/4.5-5.6 DC HSM + Sigma SA + Canon EF + Nikon F AF + Pentax KAF + Sony Alpha + 1.534 + + + + + + + + + + + + + + + + + + + Sigma + Sigma 10-20mm f/3.5 EX DC HSM + Nikon F AF + Sigma SA + Canon EF-S + Sony Alpha + Pentax KAF + 1.613 + + + + + + + + + + + + + + + + + + Sigma + Sigma 10-20mm f/3.5 EX DC HSM + Nikon F AF + Sigma SA + Canon EF-S + Sony Alpha + Pentax KAF + 1.534 + + + + + + + + + + + + + + + Sigma + Sigma 17-70mm f/2.8-4 DC Macro OS HSM + Sigma 17-70mm f/2.8-4 DC Macro OS HSM | Contemporary 013 + Nikon F AF + Sigma SA + Canon EF + Sony Alpha + Pentax KAF + 1.523 + + + + + + + + + + + + + + + + + Sigma + Sigma 70-200mm f/2.8 EX DG Macro HSM II + 4/3 System + Sigma SA + Nikon F AF + Sony Alpha + Pentax KAF2 + Canon EF + 1.526 + + + + + + + + + + + + + + + + + Sigma + + Sigma 70-200mm f/2.8 EX DG APO OS HSM + Sigma 70-200mm f/2.8 EX DG OS HSM + Sigma SA + Nikon F AF + Sony Alpha + Canon EF + 1.005 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 70-200mm f/2.8 APO EX HSM + Sigma 70-200mm f/2.8 EX DG HSM + Canon EF + Sigma SA + Nikon F AF + Pentax KAF2 + 1.61 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + + Sigma 70-200mm f/2.8 EX DG APO OS HSM + Sigma 70-200mm f/2.8 EX DG OS HSM + Sigma SA + Nikon F AF + Sony Alpha + Canon EF + Pentax KAF2 + 4/3 System + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 10mm f/2.8 EX DC Fisheye HSM + Sigma 10mm f/2.8 EX DC Fischauge HSM + Sigma SA + Nikon F AF + Sony Alpha + Pentax KAF2 + Canon EF + equisolid + 1.622 + + + + + + + + Sigma + Sigma 10mm f/2.8 EX DC Fisheye HSM + Sigma 10mm f/2.8 EX DC Fischauge HSM + Nikon F AF + Sony Alpha + Pentax KAF2 + Canon EF + fisheye + 1.523 + + + + + + + + Sigma + Sigma 100-300mm f/4 APO EX DG HSM + Sigma SA + Nikon F AF + Sony Alpha + Pentax KAF2 + Canon EF + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 100-300mm f/4 APO EX DG HSM + Sigma SA + Nikon F AF + Sony Alpha + Pentax KAF2 + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 100-300mm f/4 APO EX DG HSM + Kenko Teleplus PRO 300 AF 1.4x DGX extender + Sigma 100-300mm f/4 APO EX DG HSM + Kenko Teleplus PRO 300 AF 1.4× DGX ext. + Sigma 100-300mm f/4 APO EX DG HSM + Kenko Teleplus PRO 300 AF 1.4× DGX Konv. + Sigma SA + Nikon F AF + Sony Alpha + Pentax KAF2 + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 50-150mm f/2.8 APO EX DC HSM II + Sigma SA + Nikon F AF + Sony Alpha + Pentax KAF2 + Canon EF + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 50-150mm f/2.8 APO EX DC HSM II + Sigma SA + Nikon F AF + Sony Alpha + Pentax KAF2 + Canon EF + 1.620 + + + + + + + + + + + + + Sigma + Sigma 50-150mm f/2.8 APO EX DC OS HSM + Sigma SA + Nikon F AF + Sony Alpha + Pentax KAF2 + Canon EF + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 105mm f/2.8 EX DG OS HSM Macro + Nikon F AF + Sigma SA + Canon EF + Sony Alpha + 1.523 + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 105mm f/2.8 EX DG OS HSM Macro + Nikon F AF + Canon EF + 1 + + + + + + + + + + + + + + + + + + + Sigma + Sigma 80-400mm f/4.5-5.6 EX DG OS + Canon EF + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 24-105mm f/4.0 DG OS HSM [A] + Canon EF + Sigma SA + Nikon F AF + Sony Alpha + 1.005 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 18-250mm f/3.5-6.3 DC OS Macro HSM + Canon EF + Sigma SA + Nikon F AF + Sony Alpha + Pentax KAF2 + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 18-35mm f/1.8 DC HSM [A] + Canon EF + Sigma SA + Nikon F AF + Sony Alpha + Pentax KAF2 + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 180mm f/2.8 EX DG OS HSM APO Macro + Canon EF + Sigma SA + Nikon F AF + Sony Alpha + 1 + + + + + + + + + + + + Sigma + Sigma 50mm f/1.4 DG HSM [A] + Canon EF + Sigma SA + Nikon F AF + Sony Alpha + 1.005 + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 180mm f/5.6 APO Macro + Sony Alpha + Olympus OM + Canon FD + Pentax K + Nikon F + 1.523 + + + + + + + + + + + + + + + + + Sigma + Sigma 70-300mm f/4-5.6 DG Macro + Sony Alpha + Sigma SA + Pentax KAF2 + Canon EF + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + Sigma + Sigma 4.5mm f/2.8 EX DC HSM circular fisheye + Sigma 4.5mm f/2.8 EX DC HSM Zirkular-Fischauge + Canon EF + Nikon F AF + Sony Alpha + Pentax KAF2 + Sigma SA + fisheye + 1.534 + + + + + + + + + + Sigma + Sigma 50-100mm f/1.8 DC HSM Art + Canon EF + Nikon F + Sigma SA + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 17-70mm f/2.8-4 DC MACRO OS HSM Contemporary + Sigma 17-70mm f/2.8-4 DC Macro OS HSM | C + Nikon F AF + Sigma SA + Canon EF + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 24mm f/2.8 Super Wide II + Minolta AF + Pentax KAF + 1.523 + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 20mm f/1.4 DG HSM | Art 015 + Sigma 20mm f/1.4 DG HSM | A + Canon EF + Nikon F AF + Sigma SA + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 150-600mm f/5-6.3 DG OS HSM | C + Canon EF + Sigma SA + Nikon F AF + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 85mm f/1.4 EX DG HSM + Pentax KAF3 + Nikon F AF + Sigma SA + Canon EF + Sony Alpha + 1 + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 150-600mm f/5-6.3 DG OS HSM | C + Canon EF + Sigma SA + Nikon F AF + 1.534 + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 150-600mm f/5-6.3 DG OS HSM | C + Canon EF + Sigma SA + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + 100-400mm F5-6.3 DG OS HSM | Contemporary 017 + 100-400mm F5-6.3 DG OS HSM | C + Canon EF + Sigma SA + Nikon F AF + Sony E + 1 + + + + + + + + + + + + + + + Sigma + 70-200mm F2.8 DG OS HSM | Sports 018 + 70-200mm F2.8 DG OS HSM | S + Canon EF + Sigma SA + Nikon F + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 18-300mm f/3.5-6.3 DC Macro OS HSM + + Sigma 18-300mm f/3.5-6.3 DC Macro HSM + Sigma SA + Canon EF + Nikon F AF + Sony Alpha + Pentax KAF + 1.613 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 60-600mm f/4.5-6.3 DG OS HSM | S + Sigma 60-600mm F4.5-6.3 DG OS HSM | Sports 018 + Canon EF-S + Nikon F AF + Sigma SA + 1.605 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + 60-600mm f/4.5-6.3 DG OS HSM | Sports 018 +1.4x extender + Sigma 60-600mm F4.5-6.3 DG OS HSM | Sports 018 + 1.4× ext. + Canon EF-S + 1.605 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 14mm f/2.8 EX Aspherical HSM + Canon EF + Nikon F + Sigma SA + Sony Alpha + Pentax KAF + 1 + + + + + + + + + Sigma + Sigma 15mm f/2.8 EX DG Diagonal Fisheye + Canon EF + Sigma SA + Nikon F + Sony Alpha + Pentax KAF + 1.613 + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 24-70mm F2.8 DG OS HSM | Art 017 + Sigma SA + Canon EF + Nikon F + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + Sigma + Sigma 30mm F1.4 DC HSM | Art 013 + Canon EF + Nikon F + Sigma SA + Sony Alpha + Pentax KAF + 1.613 + + + + + + + + + + + + + + + + + + + Sigma + Sigma 12-24mm F4.5-5.6 II DG HSM + Nikon F AF + Canon EF + Pentax KAF + Sigma SA + Sony Alpha + 1.0 + + + + + + + + + + + + + + + Sigma + Sigma 35–80mm f/4–5.6 DL-II AF + Sony Alpha + Canon EF + Nikon F + Pentak K + Minolta AF + 1.0 + + + + + + + + + + + Sigma + Sigma 90mm f/2.8 Macro AF + Sony Alpha + Sigma SA + Nikon F AF + Canon EF-S + Pentax KAF + Minolta AF + 1.534 + + + + + + + + + + + + Soligor + MC Soligor C/D Wide-Auto 1:2.8 f=24mm + Pentax KAF2 + 1.531 + + + + + + + + + + + + + Sony Alpha + Minolta AF + M42 + M39/1 + DKL + T2 + Tamron Adaptall + Generic + + + + Sony + SLT-A33 + Alpha 33 + Sony Alpha + 1.523 + + + + Sony + SLT-A35 + Alpha 35 + Sony Alpha + 1.523 + + + + Sony + SLT-A37 + Alpha 37 + Sony Alpha + 1.523 + + + + Sony + SLT-A55V + Alpha 55 + Sony Alpha + 1.523 + + + + Sony + SLT-A57 + Alpha 57 + Sony Alpha + 1.523 + + + + Sony + SLT-A58 + Alpha 58 + Sony Alpha + 1.523 + + + + Sony + SLT-A65V + Alpha 65 + Sony Alpha + 1.523 + + + + Sony + ILCA-68 + Alpha 68 + Sony Alpha + 1.534 + + + + Sony + SLT-A77V + Alpha 77 + Sony Alpha + 1.534 + + + + Sony + ILCA-77M2 + Alpha 77 II + Sony Alpha + 1.534 + + + + Sony + SLT-A99 + Alpha 99 + Sony Alpha + 1.005 + + + + Sony + SLT-A99V + Alpha 99V + Sony Alpha + 1.005 + + + + Sony + DSLR-A100 + Alpha 100 + Sony Alpha + 1.523 + + + + Sony + DSLR-A200 + Alpha 200 + Sony Alpha + 1.523 + + + + Sony + DSLR-A230 + Alpha 230 + Sony Alpha + 1.523 + + + + Sony + DSLR-A290 + Alpha 290 + Sony Alpha + 1.523 + + + + Sony + DSLR-A300 + Alpha 300 + Sony Alpha + 1.534 + + + + Sony + DSLR-A330 + Alpha 330 + Sony Alpha + 1.534 + + + + Sony + DSLR-A350 + Alpha 350 + Sony Alpha + 1.534 + + + + Sony + DSLR-A380 + Alpha 380 + Sony Alpha + 1.528 + + + + Sony + DSLR-A390 + Alpha 390 + Sony Alpha + 1.523 + + + + Sony + DSLR-A450 + Alpha 450 + Sony Alpha + 1.534 + + + + Sony + DSLR-A500 + Alpha 500 + Sony Alpha + 1.534 + + + + Sony + DSLR-A550 + Alpha 550 + Sony Alpha + 1.534 + + + + Sony + DSLR-A560 + Alpha 560 + Sony Alpha + 1.523 + + + + Sony + DSLR-A580 + Alpha 580 + Sony Alpha + 1.523 + + + + Sony + DSLR-A700 + Alpha 700 + Sony Alpha + 1.534 + + + + Sony + DSLR-A850 + Alpha 850 + Sony Alpha + 1 + + + + Sony + DSLR-A900 + Alpha 900 + Sony Alpha + 1 + + + + Sony + ILCA-99M2 + Alpha 99 II + Sony Alpha + 1 + + + + Sony + Sony AF DT 16-105mm f/3.5-5.6 + Sony Alpha + + 1.527 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + Sony DT 16-50mm f/2.8 SSM (SAL1650) + Sony DT 16-50mm f/2.8 SSM + Sony Alpha + + 1.527 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + Sony DT 18-55mm f/3.5-5.6 SAM (SAL1855) + Sony DT 18-55mm f/3.5-5.6 SAM + Sony Alpha + + + 1.527 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + Minolta/Sony AF DT 18-70mm f/3.5-5.6 (D) + Sony Alpha + + 1.527 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + Sony AF DT 55-200mm f/4-5.6 SAM (SAL55200-2) + Sony AF DT 55-200mm f/4-5.6 SAM + Sony Alpha + + rectilinear + + 1.527 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + Sony 50mm f/1.4 (SAL50F14) + Sony 50mm f/1.4 + Sony Alpha + 1.534 + + + + + + + + + + + + + + + + + + + + + + + Sony + Sony DT 35mm f/1.8 SAM (SAL35F18) + Sony DT 35mm f/1.8 SAM + Sony Alpha + 1.523 + + + + + + + + + + + + + + + + + + + Sony + Sony DT 50mm f/1.8 SAM + Sony Alpha + 1.523 + + + + + + + + + + + + + + + + + + + Sony + Sony DT 55-300mm f/4.5-5.6 SAM (SAL55300) + Sony DT 55-300mm f/4.5-5.6 SAM + Sony Alpha + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + Sony DT 18-135mm f/3.5-5.6 SAM (SAL18135) + Sony DT 18-135mm f/3.5-5.6 SAM + Sony Alpha + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + Sony AF DT 30mm f/2.8 SAM Macro (SAL30M28) + Sony AF DT 30mm f/2.8 SAM Macro + Sony Alpha + 1.523 + + + + + + + + + + + + + + + + + + + + + Sony + Sony AF DT 18-250mm f/3.5-6.3 (SAL18250) + Sony AF DT 18-250mm f/3.5-6.3 + Sony Alpha + 1.523 + + + + + + + + + + + + + + Sony + Minolta/Sony AF 500mm F8 Reflex + Sony AF 500mm F8 Reflex + Sony Alpha + 1 + + + + + + + + + + Sony + Minolta/Sony AF 100mm F2.8 Macro (D) + Sony AF 100mm F2.8 Macro + Sony Alpha + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + Carl Zeiss Vario-Sonnar T* 16-35mm f/2.8 ZA SSM II (SAL1635Z2) + Zeiss Vario-Sonnar T* 16-35mm f/2.8 ZA SSM II + Sony Alpha + 1 + + + + + + + + + + + + + + + + + Sony + Carl Zeiss Vario-Sonnar T* 24-70mm f/2.8 ZA SSM II (SAL2470Z2) + Zeiss Vario-Sonnar T* 24-70mm f/2.8 ZA SSM II + Sony Alpha + 1 + + + + + + + + + + + + + + + + + Sony + Sony 70-300mm f/4.5-5.6 G SSM II (SAL70300G2) + Sony 70-300mm f/4.5-5.6 G SSM II + Sony Alpha + 1 + + + + + + + + + + + + + Sony + Sony 35mm F1.4 G (SAL35F14G) + Sony 35mm f/1.4 G + Sony Alpha + 1 + + + + + + + + + + + + + + + + + + + + + + + + + Sony + Sony Carl Zeiss Planar T* 50mm F1.4 ZA SSM (SALF0F14Z) + Zeiss Planar T* 50mm f/1.4 ZA SSM + Sony Alpha + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + Carl Zeiss Distagon T* 24mm F2 ZA SSM (SAL24F20Z) + Sony Alpha + 1.0 + + + + + + + + Sony + Sony 28-75mm F2.8 SAM (SAL2875) + Sony 28-75mm F2.8 SAM + Sony Alpha + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sony + Sony 85mm F2.8 SAM (SAL85F28) + Sony Alpha + 1.5 + + + + + + + + + + + + + + + + + Sony + Carl Zeiss Sonnar T* 135mm F1.8 ZA (SAL135F18Z) + Sony Alpha + 1 + + + + + + + + + + + + + Tamron Adaptall + Generic + + + + Tamron + Tamron SP AF 10-24mm f/3.5-4.5 Di II LD Aspherical (IF) + Canon EF + Nikon F AF + Pentax KAF + Sony Alpha + + 1.53 + + + + + + + + + + + + + + + + + Tamron + Tamron 10-24mm F/3.5-4.5 Di II VC HLD B023 + Tamron 10-24mm f/3.5-4.5 Di II VC HLD + Nikon F AF + Canon EF + 1.528 + + + + + + + + + + + + + + + + + Tamron + Tamron SP AF 17-35mm f/2.8-4 Di LD Aspherical (IF) + Canon EF + Nikon F AF + Pentax KAF + 1 + + + + + + + + + + + + + + + + + + + Tamron + Tamron 17-35mm f/2.8-4 Di OSD (A037) + Canon EF + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron AF 17-50mm f/2.8 XR Di-II LD (Model A16) + Canon EF + Nikon F AF + Pentax KAF + Sony Alpha + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP AF 17-50mm f/2.8 XR Di II LD Aspherical (IF) + Canon EF + Nikon F AF + Pentax KAF + Sony Alpha + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP AF 17-50mm f/2.8 XR Di II VC LD Aspherical (IF) + Canon EF + Nikon F AF + 1.613 + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF) Macro A14 + Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF) Macro + Canon EF + Nikon F AF + Pentax KAF + Sony Alpha + + 1.53 + + + + + + + + + + + + + + + Tamron + Tamron 18-200mm f/3.5-6.3 Di II VC + Canon EF + Nikon F AF + Sony Alpha + 1.558 + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF) Macro + Canon EF + Nikon F AF + Pentax KAF + Sony Alpha + + 1.611 + + + + + + + + + + + + + + + + Tamron + Tamron AF 18-250mm f/3.5-6.3 Di II LD Aspherical (IF) Macro + Canon EF + Nikon F AF + Pentax KAF + Sony Alpha + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron AF 19-35mm f/3.5-4.5 + Canon EF + Nikon F AF + Pentax KAF + + 1.611 + + + + + + + + + + + Tamron + Tamron SP 24-70mm f/2.8 Di VC USD + Canon EF + Nikon F AF + 1 + + + + + + + + + + + + + + Tamron + + Tamron SP 24-70mm F/2.8 Di VC USD G2 (A032) + + + Canon EF + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP AF 24-135mm f/3.5-5.6 AD Aspherical (IF) Macro + Canon EF + Nikon F AF + Pentax KAF + + 1.611 + + + + + + + + + + + + + + + + Tamron + Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical (IF) Macro + Canon EF + Nikon F AF + Pentax KAF + Sony Alpha + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP AF 28-105mm f/2.8 LD Aspherical IF + Canon EF + Nikon F AF + Pentax KAF + 1 + + + + + + + + + + + + + + + Tamron + Tamron AF 28-300mm f/3.5-6.3 XR Di LD Aspherical (IF) + Canon EF + Nikon F AF + Pentax KAF + Sony Alpha + + 1.53 + + + + + + + + + + + + + + Tamron + Tamron 28-300mm f/3.5-6.3 Di VC PZD A010 + Tamron 28-300mm f/3.5-6.3 Di VC PZD + Canon EF + Nikon F AF + Sony Alpha + 1.005 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + + Tamron 35-70mm f/3.5 CF Macro + Nikon F + Pentax K + + 1.53 + + + + + + + + + + + + + + + + + + Tamron + Tamron SP 35mm f/1.8 Di VC USD F012 + Canon EF + Nikon F AF + Sony Alpha + 1.0 + + + + + + + + Tamron + Tamron AF 70-300mm F4-5.6 LD Macro 1:2 + Tamron AF 70-300mm f/4-5.6 Di LD Tele-Macro (1:2) + Pentax KAF2 + Canon EF + Nikon F AF + Sony Alpha + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron AF 70-300mm f/4-5.6 LD Macro 1:2 + Canon EF + Nikon F AF + Pentax KAF2 + Sony Alpha + + 1.53 + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP 70-300mm f/4-5.6 Di VC USD (A005) + Canon EF + Nikon F AF + Sony Alpha + 1 + + + + + + + + + + + + Tamron + Tamron SP 70-300mm f/4-5.6 Di USD + Sony Alpha + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron AF 18-270mm f/3.5-6.3 Di II VC PZD + Canon EF + Nikon F AF + Sony Alpha + 1.613 + + + + + + + + + + + + + + + + Tamron + Tamron AF 18-270mm F/3.5-6.3 Di II VC PZD + Nikon F AF + Canon EF + Sony Alpha + 1.534 + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP AF 90mm f/2.8 Di Macro 1:1 + Nikon F AF + Canon EF + Pentax KAF2 + Sony Alpha + + + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP AF 90mm F2.8 (172E) + Tamron SP AF 90mm f/2.8 Di Macro 172E + Nikon F AF + Canon EF + Pentax KAF2 + Sony Alpha + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP AF 11-18mm f/4.5-5.6 Di-II LD Aspherical (IF) + Canon EF + Nikon F AF + Sony Alpha + Pentax KAF2 + 1.620 + + + + + + + + + + + + + + + + + Tamron + Tamron 16-300mm f/3.5-6.3 Di II VC PZD Macro B016 + Canon EF + 1.613 + + + + + + + + + + + + + + + + Tamron + Tamron 16-300mm f/3.5-6.3 Di II VC PZD Macro B016 + Nikon F AF + Sony Alpha + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP AF 150-600mm f/5-6.3 Di VC USD (A011) + Tamron SP 150-600mm f/5-6.3 Di VC USD + Canon EF + Nikon F AF + Sony Alpha + 1.534 + + + + + + + + + + + + + Tamron + Tamron SP AF 150-600mm F/5-6.3 Di VC USD G2 (A022) + Canon EF + Nikon F AF + Sony Alpha + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP AF 60mm f/2 Di II LD (IF) Macro 1:1 + Tamron SP AF 60mm f/2 Di II LD (IF) Macro + Canon EF + Nikon F AF + Sony Alpha + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP AF 70-200mm f/2.8 Di LD (IF) Macro (A001) + Tamron SP AF 70-200mm f/2.8 Di LD (IF) Macro + Canon EF + Nikon F AF + Sony Alpha + Pentax KAF2 + 1 + + + + + + + + + + + + + + + + + Tamron + Tamron AF 80-210mm f/4.5-5.6 280D + Nikon F AF + Canon EF + Sony Alpha + Pentax KAF2 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP 70-200mm f/2.8 Di VC USD A009 + Tamron SP 70-200mm f/2.8 Di VC USD + Nikon F AF + Canon EF + Sony Alpha + 1.005 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP 70-200mm F/2.8 Di VC USD G2 + Canon EF + Nikon F AF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP 90mm F/2.8 Di VC USD MACRO 1:1 F004 + Tamron SP 90mm f/2.8 Di VC USD Macro 1:1 + Canon EF + Sony Alpha + Nikon F AF + 1.0 + + + + + + + + Tamron + Tamron SP 90mm f/2.8 Di VC USD Macro 1:1 F004 + Tamron SP 90mm f/2.8 Di VC USD Macro 1:1 + Nikon F AF + Canon EF + Sony Alpha + 1.613 + + + + + + + + + Tamron + Tamron AF 18-270mm F/3.5-6.3 Di II VC LD Aspherical (IF) Macro + Canon EF + Nikon F AF + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron 200mm f/3.5 CT-200 BBAR + Tamron Adaptall + 2 + 4:3 + + + + + + + + + Tamron + Tamron SP 15-30mm f/2.8 Di VC USD (A012) + Tamron SP 15-30mm f/2.8 Di VC USD + Nikon F AF + Canon EF + Sony Alpha + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP 15-30mm f/2.8 Di VC USD G2 (A041) + + + Canon EF + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron AF 18-400mm f/3.5-6.3 Di II VC HLD (B028) + Canon EF + Nikon F AF + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP 35mm f/1.4 Di USD + Nikon F AF + Canon EF + 1 + + + + + + + + + + + + + + + + + + Tamron + Tamron 100-400mm F/4.5-6.3 Di VC USD A035 + Nikon F AF + Canon EF + 1.0 + + + + + + + + + + + + + + + + + + Tamron + Tamron 35-150mm f/2.8-4.0 Di VC OSD A043 + Tamron 35-150mm f/2.8-4 Di VC OSD (A043) + Nikon F AF + Canon EF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tamron + Tamron SP 45mm F/1.8 Di VC USD + Nikon F AF + Canon EF + Sony Alpha + 1.0 + + + + + + + + + Tamron + Tamron SP AF 24-135mm F/3.5-5.6 AD Aspherical (IF) Macro + Nikon F AF + Canon EF + Sony Alpha + Pentax KAF2 + 1.0 + + + + + + + + + + + + + + + + Tamron + Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical (IF) Macro (A20) + Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical (IF) Macro + Nikon F AF + Canon EF + 1.0 + + + + + + + + + + + + + + + + + + + + + + + Tokina + Tokina 11-16mm f/2.8 AT-X 116 AF Pro DX + Tokina AF 11-16mm f/2.8 AT-X Pro DX + Canon EF + Nikon F AF + Sony Alpha + + 1 + + + + + + + + + + + + Tokina + Tokina 11-16mm f/2.8 AT-X 116 AF Pro DX + Tokina AF 11-16mm f/2.8 AT-X Pro DX + Canon EF + Nikon F AF + Sony Alpha + + 1.53 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tokina + Tokina ATX-i 11-20mm F2.8 CF + Nikon F AF + Canon EF + 1.523 + + + + + + + + + + + + + + + + Tokina + Tokina 12-24mm f/4 AT-X 124 AF Pro DX + Tokina AF 12-24mm f/4 AT-X Pro DX + Canon EF + Nikon F AF + + 1.53 + + + + + + + + + + + + + Tokina + Tokina AT-X 14-20 F2 PRO DX + Nikon F AF + Canon EF + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tokina + Tokina 19-35mm f/3.5-4.5 AF 193 + Tokina AF 19-35mm f/3.5-4.5 + Canon EF + Nikon F AF + + 1.611 + + + + + + + + + + + + + + Tokina + Tokina 28-70mm f/2.8 AT-X 287 Pro SV + Tokina 28-70mm f/2.8 AT-X Pro SV + Canon EF + Nikon F AF + Pentax KAF + + 1.611 + + + + + + + + + + + + + Tokina + Tokina AT-X 24-70mm f/2.8 PRO FX + Canon EF + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tokina + Tokina 80-200mm f/4.5-5.6 SZ-X + Canon EF + Nikon F AF + Pentax KAF + + 1.53 + + + + + + + + + + + + Tokina + Tokina 17mm f/3.5 AT-X 17 AF Pro + Tokina AF 17mm f/3.5 AT-X Pro + Canon EF + Nikon F AF + + 1.53 + + + + + + + Tokina + Tokina 17mm f/3.5 AT-X 17 AF Pro + Tokina AF 17mm f/3.5 AT-X Pro + Canon EF + Nikon F AF + + 1.611 + + + + + + + Tokina + Tokina 17mm f/3.5 AT-X 17 AF Pro + Canon EF + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tokina + Tokina 500mm f/8 RMC Mirror Lens + Tokina 500mm f/8 RMC Spiegelobjektiv + Pentax K + Canon FD + Minolta M + Olympus OM + Nikon F AI + + + + 1.53 + + + + + + + Tokina + Tokina AF 16-28mm f/2.8 AT-X Pro SD FX + Canon EF + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + + + Tokina + Tokina AF 12-28mm f/4 AT-X Pro DX + Canon EF + Nikon F AF + 1.534 + + + + + + + + + + + + + + + Tokina + Tokina AT-X M100 100mm f/2.8 Pro D Macro AF + Tokina AF 100mm f/2.8 AT-X Pro D Macro + Nikon F AF + 1.534 + + + + + + + + + Tokina + Tokina AF 80-200mm f/2.8 AT-X 828 Pro + Pentax KAF + Canon EF + Sony Alpha + Nikon F AF + 1 + + + + + + + + + + + + + + + + + Tokina + Tokina AF 28-80mm f/2.8 AT-X 280 Pro + Pentax KAF + Canon EF + Sony Alpha + Nikon F AF + 1 + + + + + + + + + + + + + + Tokina + Tokina AF 11-20mm f/2.8 AT-X Pro DX + Nikon F AF + Canon EF + 1.534 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tokina + Tokina AT-X 11-20 F2.8 PRO DX Aspherical 11-20mm f/2.8 + Tokina AT-X 11-20 F2.8 PRO DX + Canon EF + Nikon F AF + 1.61 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tokina + Tokina AF 100mm f/2.8 AT-X Pro D M100 Macro + Canon EF + Nikon F AF + 1 + + + + + + + + + + + + + + + + + + + Tokina + Tokina 17mm f/3.5 RMC II + Nikon F AI + 1.0 + + + + + + + + + Tokina + Tokina atx-i 11-16mm F2.8 CF + Nikon F AF + Canon EF-S + 1.523 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tokina + Tokina 20-35mm f/3.5-4.5 AF-235 II + Canon EF + Sony Alpha + Nikon F AF + Pentax KAF + 1.0 + + + + + + + + + + + + + + + + + Tokina + RMC Tokina 28mm f/2.8 + 4/3 System + M42 + 2 + + + + + + + Tokina + Tokina AT-X AF SD 80-400mm f/4.5-5.6 + Pentax KAF + Canon EF + Nikon F AF + Sony Alpha + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tokina + Tokina TELE-AUTO 135mm f/2.8 + M42 + 4/3 System + Minolta MD + 1.534 + + + + + + + + + + + + + KMZ + КМЗ + Zenit 122 + Зенит 122 + M42 + 1 + + + + KMZ + КМЗ + Zenit 122K + Зенит 122K + Pentax K + 1 + + + + KMZ + КМЗ + Zenit 212K + Зенит 212K + Pentax K + 1 + + + + KMZ + КМЗ + Zenit 312K + Зенит 312K + Pentax K + 1 + + + + KMZ + КМЗ + Zenit 412LS + Зенит 412LS + M42 + 1 + + + + KMZ + КМЗ + Zenit KM + Зенит KM + Pentax K + 1 + + + + KMZ + КМЗ + MC MTO 11CA 10/1000 + МС МТО 11СА + M42 + + + 1.531 + + + + + + + KMZ + КМЗ + MC Helios-44M-4 58mm 1:2 + МС Гелиос-44М-4 58мм 1:2 + M42 + 1.538 + + + + + + + + + + + + + + + + + + + + + + + KMZ + КМЗ + MC Helios-44M-4 58mm 1:2 + МС Гелиос-44М-4 58мм 1:2 + M42 + 1 + + + + + + + + + + + + + + + + + + + + + + + KMZ + КМЗ + Helios-44 58mm 1:2 + Гелиос-44 58мм 1:2 + M42 + 1 + + + + + + + + + + + + + + + + + + + + + + + MTO + МТО + MTO-500 500mm f/8 mirror lens + МТО-500 500мм f/8 + M39/1 + 1.529 + + + + + + + + + KMZ + КМЗ + MIR-1B 37mm f/2.8 + МИР-1В 37мм f/2.8 + M42 + 1.523 + + + + + + + + + + + + + + + + + + + + + KMZ + КМЗ + MIR-1B 37mm f/2.8 + МИР-1B 2.8/37 + M42 + 1 + + + + + + + + + + + + + + + + + + + + + KMZ + КМЗ + Helios-40 85mm f/1.5 + Гелиос-40 85мм f/1.5 + M39 + Sony E + 1 + + + + + + + + + + + + + + + + + + + + + + KMZ + КМЗ + Industar-50-2 3.5/50 + ИНДУСТАР-50-2 3.5/50 + M42 + 1 + + + + + + + + + + + + + + + + + + + + + KMZ + КМЗ + Jupiter-37AM MC 3.5/135 + ЮПИТЕР-37AM MC 3.5/135 + M42 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + Vivitar + Vivitar 100mm f/3.5 AF Macro + Canon EF + Sony Alpha + Nikon F AF + 1.523 + + + + + + + + + + + Vivitar + + Vivitar Series One 70-210mm 1:3.5 SN 22... + Vivitar Series 1 70-210mm 1:3.5 SN 22… + Nikon F + Pentax K + Canon FD + Canon FL + Olympus OM + M42 + + + 1.534 + + + + + + + + + + + + + + + + + + + Zeiss + Carl Zeiss Distagon T* 2/35 ZF.2 + Nikon F AI-S + Canon EF + Pentax KAF2 + 1 + + + + + + + + + + + + + + + + + + + + Zeiss + Carl Zeiss Distagon T* 2.8/21 ZF.2 + Nikon F AI-S + Canon EF + Pentax KAF2 + 1 + + + + + + + + + Zeiss + Carl Zeiss Jena 1Q Biotar 1:2 f=58mm T + M42 + 1.538 + + + + + + + + + Zeiss + Zeiss Distagon T* 25mm f/2.8 ZF.2 + Nikon F AI-S + Pentax KAF2 + 1 + + + + + + + + + + + + + + + + + Zeiss + Zeiss Milvus 1.4/50 + Canon EF + Nikon F AI-S + 1 + + + + + + + + + Zeiss + Zeiss Otus 85mm f/1.4 + Nikon F AF + Canon EF + 1 + + + + + + + + Zeiss + Carl Zeiss Planar T* 1.4/50 ZF.2 + Nikon F AF + Canon EF + Pentax KAF2 + 1.523 + + + + + + + + Zeiss + Carl Zeiss Distagon T* 3.5/18 ZF.2 + Nikon F AF + Canon EF + Pentax KAF2 + 1.0 + + + + + + + + Zeiss + Carl Zeiss Planar T* 1.4/50 ZF.2 + Nikon F AF + 1.0 + + + + + + + + + Zeiss + Carl Zeiss Distagon T* 3.5/18 ZF.2 + Nikon F AF + Canon EF + Pentax KAF2 + 1.523 + + + + + + + + + Zeiss + Touit 2.8/50M + Fujifilm X + 1.529 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Zeiss + Zeiss Makro-Planar T* 2/100 ZF.2 + Makro-Planar T* 2/100 + Nikon F AF + Canon EF + Pentax KAF4 + 1.0 + + + + + + + + + Zeiss + Carl Zeiss Jena Flektogon 20mm f/4 + M42 + 1.0 + + + + + + + + + Zeiss + Carl Zeiss Jena Flektogon 35mm f/2.4 + M42 + 1.0 + + + + + + + + + Zeiss + Carl Zeiss Jena Tessar 50mm f/2.8 + M42 + 1.0 + + + + + + + + + Zeiss + Carl Zeiss Jena Pancolar 50mm f/1.8 + M42 + 1.0 + + + + + + + + + Zeiss + Carl Zeiss Jena Biotar 58mm f/2 + M42 + 1.0 + + + + + + + + + Zeiss + Carl Zeiss Jena Sonnar 135mm f/3.5 + M42 + 1.0 + + + + + + + + + + + + + + + + + + + + + Zeiss + Carl Zeiss Jena Triotar-v2 135mm f/4 + M42 + 1.0 + + + + + + + + + Zeiss + Carl Zeiss Sonnar T* 180mm f/2.8 MMJ + Contax/Yashica + 1.0 + + + + + + + +1577948414 diff --git a/public/lensfun/lensfun-core.js b/public/lensfun/lensfun-core.js new file mode 100644 index 0000000..53e83cc --- /dev/null +++ b/public/lensfun/lensfun-core.js @@ -0,0 +1,2 @@ +var createLensfunCoreModule=(()=>{var _scriptName=globalThis.document?.currentScript?.src;return async function(moduleArg={}){var moduleRtn;var Module=moduleArg;var ENVIRONMENT_IS_WEB=!!globalThis.window;var ENVIRONMENT_IS_WORKER=!!globalThis.WorkerGlobalScope;var ENVIRONMENT_IS_NODE=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";if(!Module["expectedDataFileDownloads"])Module["expectedDataFileDownloads"]=0;Module["expectedDataFileDownloads"]++;(()=>{var isPthread=typeof ENVIRONMENT_IS_PTHREAD!="undefined"&&ENVIRONMENT_IS_PTHREAD;var isWasmWorker=typeof ENVIRONMENT_IS_WASM_WORKER!="undefined"&&ENVIRONMENT_IS_WASM_WORKER;if(isPthread||isWasmWorker)return;async function loadPackage(metadata){var PACKAGE_PATH="";if(typeof window==="object"){PACKAGE_PATH=window["encodeURIComponent"](window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/")}else if(typeof process==="undefined"&&typeof location!=="undefined"){PACKAGE_PATH=encodeURIComponent(location.pathname.substring(0,location.pathname.lastIndexOf("/"))+"/")}var PACKAGE_NAME="lensfun-core.data";var REMOTE_PACKAGE_BASE="lensfun-core.data";var REMOTE_PACKAGE_NAME=Module["locateFile"]?Module["locateFile"](REMOTE_PACKAGE_BASE,""):REMOTE_PACKAGE_BASE;var REMOTE_PACKAGE_SIZE=metadata["remote_package_size"];async function fetchRemotePackage(packageName,packageSize){if(!Module["dataFileDownloads"])Module["dataFileDownloads"]={};try{var response=await fetch(packageName)}catch(e){throw new Error(`Network Error: ${packageName}`,{e})}if(!response.ok){throw new Error(`${response.status}: ${response.url}`)}const chunks=[];const headers=response.headers;const total=Number(headers.get("Content-Length")||packageSize);let loaded=0;Module["setStatus"]&&Module["setStatus"]("Downloading data...");const reader=response.body.getReader();while(1){var{done,value}=await reader.read();if(done)break;chunks.push(value);loaded+=value.length;Module["dataFileDownloads"][packageName]={loaded,total};let totalLoaded=0;let totalSize=0;for(const download of Object.values(Module["dataFileDownloads"])){totalLoaded+=download.loaded;totalSize+=download.total}Module["setStatus"]&&Module["setStatus"](`Downloading data... (${totalLoaded}/${totalSize})`)}const packageData=new Uint8Array(chunks.map(c=>c.length).reduce((a,b)=>a+b,0));let offset=0;for(const chunk of chunks){packageData.set(chunk,offset);offset+=chunk.length}return packageData.buffer}var fetchPromise;var fetched=Module["getPreloadedPackage"]&&Module["getPreloadedPackage"](REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE);if(!fetched){fetchPromise=fetchRemotePackage(REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE)}async function runWithFS(Module){function assert(check,msg){if(!check)throw new Error(msg)}Module["FS_createPath"]("/","lensfun-db",true,true);for(var file of metadata["files"]){var name=file["filename"];Module["addRunDependency"](`fp ${name}`)}async function processPackageData(arrayBuffer){assert(arrayBuffer,"Loading data file failed.");assert(arrayBuffer.constructor.name===ArrayBuffer.name,"bad input to processPackageData "+arrayBuffer.constructor.name);var byteArray=new Uint8Array(arrayBuffer);for(var file of metadata["files"]){var name=file["filename"];var data=byteArray.subarray(file["start"],file["end"]);Module["FS_createDataFile"](name,null,data,true,true,true);Module["removeRunDependency"](`fp ${name}`)}Module["removeRunDependency"]("datafile_lensfun-core.data")}Module["addRunDependency"]("datafile_lensfun-core.data");if(!Module["preloadResults"])Module["preloadResults"]={};Module["preloadResults"][PACKAGE_NAME]={fromCache:false};if(!fetched){fetched=await fetchPromise}processPackageData(fetched)}if(Module["calledRun"]){runWithFS(Module)}else{if(!Module["preRun"])Module["preRun"]=[];Module["preRun"].push(runWithFS)}}loadPackage({files:[{filename:"/lensfun-db/6x6.xml",start:0,end:29550},{filename:"/lensfun-db/actioncams.xml",start:29550,end:46738},{filename:"/lensfun-db/compact-canon.xml",start:46738,end:293556},{filename:"/lensfun-db/compact-casio.xml",start:293556,end:300445},{filename:"/lensfun-db/compact-fujifilm.xml",start:300445,end:368399},{filename:"/lensfun-db/compact-kodak.xml",start:368399,end:370490},{filename:"/lensfun-db/compact-konica-minolta.xml",start:370490,end:383839},{filename:"/lensfun-db/compact-leica.xml",start:383839,end:392021},{filename:"/lensfun-db/compact-nikon.xml",start:392021,end:432024},{filename:"/lensfun-db/compact-olympus.xml",start:432024,end:466478},{filename:"/lensfun-db/compact-panasonic.xml",start:466478,end:527373},{filename:"/lensfun-db/compact-pentax.xml",start:527373,end:534062},{filename:"/lensfun-db/compact-ricoh.xml",start:534062,end:551316},{filename:"/lensfun-db/compact-samsung.xml",start:551316,end:565191},{filename:"/lensfun-db/compact-sigma.xml",start:565191,end:567586},{filename:"/lensfun-db/compact-sony.xml",start:567586,end:693661},{filename:"/lensfun-db/contax.xml",start:693661,end:695357},{filename:"/lensfun-db/generic.xml",start:695357,end:700773},{filename:"/lensfun-db/lensfun-database.dtd",start:700773,end:703196},{filename:"/lensfun-db/lensfun-database.xsd",start:703196,end:709391},{filename:"/lensfun-db/mil-canon.xml",start:709391,end:955707},{filename:"/lensfun-db/mil-fujifilm.xml",start:955707,end:1165257},{filename:"/lensfun-db/mil-hasselblad.xml",start:1165257,end:1166305},{filename:"/lensfun-db/mil-leica.xml",start:1166305,end:1177722},{filename:"/lensfun-db/mil-nikon.xml",start:1177722,end:1345310},{filename:"/lensfun-db/mil-olympus.xml",start:1345310,end:1492433},{filename:"/lensfun-db/mil-panasonic.xml",start:1492433,end:1791237},{filename:"/lensfun-db/mil-pentax.xml",start:1791237,end:1792622},{filename:"/lensfun-db/mil-samsung.xml",start:1792622,end:1805629},{filename:"/lensfun-db/mil-samyang.xml",start:1805629,end:1830923},{filename:"/lensfun-db/mil-sigma.xml",start:1830923,end:1940321},{filename:"/lensfun-db/mil-sony.xml",start:1940321,end:2212927},{filename:"/lensfun-db/mil-tamron.xml",start:2212927,end:2299085},{filename:"/lensfun-db/mil-tokina.xml",start:2299085,end:2300099},{filename:"/lensfun-db/mil-zeiss.xml",start:2300099,end:2319270},{filename:"/lensfun-db/misc.xml",start:2319270,end:2486554},{filename:"/lensfun-db/om-system.xml",start:2486554,end:2510852},{filename:"/lensfun-db/rf-leica.xml",start:2510852,end:2517564},{filename:"/lensfun-db/slr-canon.xml",start:2517564,end:3297917},{filename:"/lensfun-db/slr-hasselblad.xml",start:3297917,end:3298559},{filename:"/lensfun-db/slr-konica-minolta.xml",start:3298559,end:3345223},{filename:"/lensfun-db/slr-leica.xml",start:3345223,end:3345655},{filename:"/lensfun-db/slr-nikon.xml",start:3345655,end:3888148},{filename:"/lensfun-db/slr-olympus.xml",start:3888148,end:4004750},{filename:"/lensfun-db/slr-panasonic.xml",start:4004750,end:4005169},{filename:"/lensfun-db/slr-pentax.xml",start:4005169,end:4210033},{filename:"/lensfun-db/slr-ricoh.xml",start:4210033,end:4212902},{filename:"/lensfun-db/slr-samsung.xml",start:4212902,end:4214012},{filename:"/lensfun-db/slr-samyang.xml",start:4214012,end:4230823},{filename:"/lensfun-db/slr-schneider.xml",start:4230823,end:4236713},{filename:"/lensfun-db/slr-sigma.xml",start:4236713,end:4667556},{filename:"/lensfun-db/slr-soligor.xml",start:4667556,end:4668129},{filename:"/lensfun-db/slr-sony.xml",start:4668129,end:4756994},{filename:"/lensfun-db/slr-tamron.xml",start:4756994,end:4954663},{filename:"/lensfun-db/slr-tokina.xml",start:4954663,end:5040890},{filename:"/lensfun-db/slr-ussr.xml",start:5040890,end:5059914},{filename:"/lensfun-db/slr-vivitar.xml",start:5059914,end:5062071},{filename:"/lensfun-db/slr-zeiss.xml",start:5062071,end:5077028},{filename:"/lensfun-db/timestamp.txt",start:5077028,end:5077039}],remote_package_size:5077039})})();var arguments_=[];var thisProgram="./this.program";if(ENVIRONMENT_IS_WORKER){_scriptName=self.location.href}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}{if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{}var out=console.log.bind(console);var err=console.error.bind(console);var wasmBinary;var ABORT=false;var readyPromiseResolve,readyPromiseReject;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;var HEAP64,HEAPU64;var runtimeInitialized=false;function updateMemoryViews(){var b=wasmMemory.buffer;HEAP8=new Int8Array(b);HEAP16=new Int16Array(b);HEAPU8=new Uint8Array(b);HEAPU16=new Uint16Array(b);HEAP32=new Int32Array(b);HEAPU32=new Uint32Array(b);HEAPF32=new Float32Array(b);HEAPF64=new Float64Array(b);HEAP64=new BigInt64Array(b);HEAPU64=new BigUint64Array(b)}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.initialized)FS.init();TTY.init();wasmExports["p"]();FS.ignorePermissions=false}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(onPostRuns)}function abort(what){Module["onAbort"]?.(what);what="Aborted("+what+")";err(what);ABORT=true;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject?.(e);throw e}var wasmBinaryFile;function findWasmBinary(){return locateFile("lensfun-core.wasm")}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(binaryFile){if(!wasmBinary){try{var response=await readAsync(binaryFile);return new Uint8Array(response)}catch{}}return getBinarySync(binaryFile)}async function instantiateArrayBuffer(binaryFile,imports){try{var binary=await getWasmBinary(binaryFile);var instance=await WebAssembly.instantiate(binary,imports);return instance}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)}}async function instantiateAsync(binary,binaryFile,imports){if(!binary){try{var response=fetch(binaryFile,{credentials:"same-origin"});var instantiationResult=await WebAssembly.instantiateStreaming(response,imports);return instantiationResult}catch(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation")}}return instantiateArrayBuffer(binaryFile,imports)}function getWasmImports(){var imports={a:wasmImports};return imports}async function createWasm(){function receiveInstance(instance,module){wasmExports=instance.exports;assignWasmExports(wasmExports);updateMemoryViews();return wasmExports}function receiveInstantiationResult(result){return receiveInstance(result["instance"])}var info=getWasmImports();if(Module["instantiateWasm"]){return new Promise((resolve,reject)=>{Module["instantiateWasm"](info,(inst,mod)=>{resolve(receiveInstance(inst,mod))})})}wasmBinaryFile??=findWasmBinary();var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);var exports=receiveInstantiationResult(result);return exports}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPostRuns=[];var addOnPostRun=cb=>onPostRuns.push(cb);var onPreRuns=[];var addOnPreRun=cb=>onPreRuns.push(cb);var noExitRuntime=true;var stackRestore=val=>__emscripten_stack_restore(val);var stackSave=()=>_emscripten_stack_get_current();class ExceptionInfo{constructor(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24}set_type(type){HEAPU32[this.ptr+4>>2]=type}get_type(){return HEAPU32[this.ptr+4>>2]}set_destructor(destructor){HEAPU32[this.ptr+8>>2]=destructor}get_destructor(){return HEAPU32[this.ptr+8>>2]}set_caught(caught){caught=caught?1:0;HEAP8[this.ptr+12]=caught}get_caught(){return HEAP8[this.ptr+12]!=0}set_rethrown(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13]=rethrown}get_rethrown(){return HEAP8[this.ptr+13]!=0}init(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor)}set_adjusted_ptr(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr}get_adjusted_ptr(){return HEAPU32[this.ptr+16>>2]}}var exceptionLast=0;var uncaughtExceptionCount=0;var ___cxa_throw=(ptr,type,destructor)=>{var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw exceptionLast};var syscallGetVarargI=()=>{var ret=HEAP32[+SYSCALLS.varargs>>2];SYSCALLS.varargs+=4;return ret};var syscallGetVarargP=syscallGetVarargI;var PATH={isAbs:path=>path.charAt(0)==="/",splitPath:filename=>{var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:(parts,allowAboveRoot)=>{var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:path=>{var isAbsolute=PATH.isAbs(path),trailingSlash=path.slice(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(p=>!!p),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:path=>{var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.slice(0,-1)}return root+dir},basename:path=>path&&path.match(/([^\/]+|\/)\/*$/)[1],join:(...paths)=>PATH.normalize(paths.join("/")),join2:(l,r)=>PATH.normalize(l+"/"+r)};var initRandomFill=()=>view=>crypto.getRandomValues(view);var randomFill=view=>{(randomFill=initRandomFill())(view)};var PATH_FS={resolve:(...args)=>{var resolvedPath="",resolvedAbsolute=false;for(var i=args.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?args[i]:FS.cwd();if(typeof path!="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=PATH.isAbs(path)}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(p=>!!p),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:(from,to)=>{from=PATH_FS.resolve(from).slice(1);to=PATH_FS.resolve(to).slice(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i{var maxIdx=idx+maxBytesToRead;if(ignoreNul)return maxIdx;while(heapOrArray[idx]&&!(idx>=maxIdx))++idx;return idx};var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead,ignoreNul)=>{var endPtr=findStringEnd(heapOrArray,idx,maxBytesToRead,ignoreNul);if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx>10,56320|ch&1023)}}return str};var FS_stdin_getChar_buffer=[];var lengthBytesUTF8=str=>{var len=0;for(var i=0;i=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;i++}}heap[outIdx]=0;return outIdx-startIdx};var intArrayFromString=(stringy,dontAddNull,length)=>{var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array};var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var result=null;if(globalThis.window?.prompt){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else{}if(!result){return null}FS_stdin_getChar_buffer=intArrayFromString(result,true)}return FS_stdin_getChar_buffer.shift()};var TTY={ttys:[],init(){},shutdown(){},register(dev,ops){TTY.ttys[dev]={input:[],output:[],ops};FS.registerDevice(dev,TTY.stream_ops)},stream_ops:{open(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(43)}stream.tty=tty;stream.seekable=false},close(stream){stream.tty.ops.fsync(stream.tty)},fsync(stream){stream.tty.ops.fsync(stream.tty)},read(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(60)}var bytesRead=0;for(var i=0;i0){out(UTF8ArrayToString(tty.output));tty.output=[]}},ioctl_tcgets(tty){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(tty,optional_actions,data){return 0},ioctl_tiocgwinsz(tty){return[24,80]}},default_tty1_ops:{put_char(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output));tty.output=[]}else{if(val!=0)tty.output.push(val)}},fsync(tty){if(tty.output?.length>0){err(UTF8ArrayToString(tty.output));tty.output=[]}}}};var mmapAlloc=size=>{abort()};var MEMFS={ops_table:null,mount(mount){return MEMFS.createNode(null,"/",16895,0)},createNode(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63)}MEMFS.ops_table||={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}};var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.atime=node.mtime=node.ctime=Date.now();if(parent){parent.contents[name]=node;parent.atime=parent.mtime=parent.ctime=node.atime}return node},getFileDataAsTypedArray(node){if(!node.contents)return new Uint8Array(0);if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents)},expandFileStorage(node,newCapacity){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.atime);attr.mtime=new Date(node.mtime);attr.ctime=new Date(node.ctime);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr(node,attr){for(const key of["mode","atime","mtime","ctime"]){if(attr[key]!=null){node[key]=attr[key]}}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup(parent,name){if(!MEMFS.doesNotExistError){MEMFS.doesNotExistError=new FS.ErrnoError(44);MEMFS.doesNotExistError.stack=""}throw MEMFS.doesNotExistError},mknod(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename(old_node,new_dir,new_name){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){if(FS.isDir(old_node.mode)){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}FS.hashRemoveNode(new_node)}delete old_node.parent.contents[old_node.name];new_dir.contents[new_name]=old_node;old_node.name=new_name;new_dir.ctime=new_dir.mtime=old_node.parent.ctime=old_node.parent.mtime=Date.now()},unlink(parent,name){delete parent.contents[name];parent.ctime=parent.mtime=Date.now()},rmdir(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.ctime=parent.mtime=Date.now()},readdir(node){return[".","..",...Object.keys(node.contents)]},symlink(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length{var flagModes={r:0,"r+":2,w:512|64|1,"w+":512|64|2,a:1024|64|1,"a+":1024|64|2};var flags=flagModes[str];if(typeof flags=="undefined"){throw new Error(`Unknown file open mode: ${str}`)}return flags};var FS_getMode=(canRead,canWrite)=>{var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode};var asyncLoad=async url=>{var arrayBuffer=await readAsync(url);return new Uint8Array(arrayBuffer)};var FS_createDataFile=(...args)=>FS.createDataFile(...args);var getUniqueRunDependency=id=>id;var runDependencies=0;var dependenciesFulfilled=null;var removeRunDependency=id=>{runDependencies--;Module["monitorRunDependencies"]?.(runDependencies);if(runDependencies==0){if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}};var addRunDependency=id=>{runDependencies++;Module["monitorRunDependencies"]?.(runDependencies)};var preloadPlugins=[];var FS_handledByPreloadPlugin=async(byteArray,fullname)=>{if(typeof Browser!="undefined")Browser.init();for(var plugin of preloadPlugins){if(plugin["canHandle"](fullname)){return plugin["handle"](byteArray,fullname)}}return byteArray};var FS_preloadFile=async(parent,name,url,canRead,canWrite,dontCreateFile,canOwn,preFinish)=>{var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency(`cp ${fullname}`);addRunDependency(dep);try{var byteArray=url;if(typeof url=="string"){byteArray=await asyncLoad(url)}byteArray=await FS_handledByPreloadPlugin(byteArray,fullname);preFinish?.();if(!dontCreateFile){FS_createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}}finally{removeRunDependency(dep)}};var FS_createPreloadedFile=(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish)=>{FS_preloadFile(parent,name,url,canRead,canWrite,dontCreateFile,canOwn,preFinish).then(onload).catch(onerror)};var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,filesystems:null,syncFSRequests:0,ErrnoError:class{name="ErrnoError";constructor(errno){this.errno=errno}},FSStream:class{shared={};get object(){return this.node}set object(val){this.node=val}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(val){this.shared.flags=val}get position(){return this.shared.position}set position(val){this.shared.position=val}},FSNode:class{node_ops={};stream_ops={};readMode=292|73;writeMode=146;mounted=null;constructor(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.rdev=rdev;this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(val){val?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(val){val?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return FS.isDir(this.mode)}get isDevice(){return FS.isChrdev(this.mode)}},lookupPath(path,opts={}){if(!path){throw new FS.ErrnoError(44)}opts.follow_mount??=true;if(!PATH.isAbs(path)){path=FS.cwd()+"/"+path}linkloop:for(var nlinks=0;nlinks<40;nlinks++){var parts=path.split("/").filter(p=>!!p);var current=FS.root;var current_path="/";for(var i=0;i>>0)%FS.nameTable.length},hashAddNode(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode(node){FS.hashRemoveNode(node)},isRoot(node){return node===node.parent},isMountpoint(node){return!!node.mounted},isFile(mode){return(mode&61440)===32768},isDir(mode){return(mode&61440)===16384},isLink(mode){return(mode&61440)===40960},isChrdev(mode){return(mode&61440)===8192},isBlkdev(mode){return(mode&61440)===24576},isFIFO(mode){return(mode&61440)===4096},isSocket(mode){return(mode&49152)===49152},flagsToPermissionString(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}if(perms.includes("w")&&!(node.mode&146)){return 2}if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup(dir){if(!FS.isDir(dir.mode))return 54;var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate(dir,name){if(!FS.isDir(dir.mode)){return 54}try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else if(FS.isDir(node.mode)){return 31}return 0},mayOpen(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}var mode=FS.flagsToPermissionString(flags);if(FS.isDir(node.mode)){if(mode!=="r"||flags&(512|64)){return 31}}return FS.nodePermissions(node,mode)},checkOpExists(op,err){if(!op){throw new FS.ErrnoError(err)}return op},MAX_OPEN_FDS:4096,nextfd(){for(var fd=0;fd<=FS.MAX_OPEN_FDS;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStreamChecked(fd){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8)}return stream},getStream:fd=>FS.streams[fd],createStream(stream,fd=-1){stream=Object.assign(new FS.FSStream,stream);if(fd==-1){fd=FS.nextfd()}stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream(fd){FS.streams[fd]=null},dupStream(origStream,fd=-1){var stream=FS.createStream(origStream,fd);stream.stream_ops?.dup?.(stream);return stream},doSetAttr(stream,node,attr){var setattr=stream?.stream_ops.setattr;var arg=setattr?stream:node;setattr??=node.node_ops.setattr;FS.checkOpExists(setattr,63);setattr(arg,attr)},chrdev_stream_ops:{open(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;stream.stream_ops.open?.(stream)},llseek(){throw new FS.ErrnoError(70)}},major:dev=>dev>>8,minor:dev=>dev&255,makedev:(ma,mi)=>ma<<8|mi,registerDevice(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:dev=>FS.devices[dev],getMounts(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push(...m.mounts)}return mounts},syncfs(populate,callback){if(typeof populate=="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`)}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}for(var mount of mounts){if(mount.type.syncfs){mount.type.syncfs(mount,populate,done)}else{done(null)}}},mount(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type,opts,mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);for(var[hash,current]of Object.entries(FS.nameTable)){while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}}node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup(parent,name){return parent.node_ops.lookup(parent,name)},mknod(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name){throw new FS.ErrnoError(28)}if(name==="."||name===".."){throw new FS.ErrnoError(20)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},statfs(path){return FS.statfsNode(FS.lookupPath(path,{follow:true}).node)},statfsStream(stream){return FS.statfsNode(stream.node)},statfsNode(node){var rtn={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:FS.nextInode,ffree:FS.nextInode-1,fsid:42,flags:2,namelen:255};if(node.node_ops.statfs){Object.assign(rtn,node.node_ops.statfs(node.mount.opts.root))}return rtn},create(path,mode=438){mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir(path,mode=511){mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree(path,mode){var dirs=path.split("/");var d="";for(var dir of dirs){if(!dir)continue;if(d||PATH.isAbs(path))d+="/";d+=dir;try{FS.mkdir(d,mode)}catch(e){if(e.errno!=20)throw e}}},mkdev(path,mode,dev){if(typeof dev=="undefined"){dev=mode;mode=438}mode|=8192;return FS.mknod(path,mode,dev)},symlink(oldpath,newpath){if(!PATH_FS.resolve(oldpath)){throw new FS.ErrnoError(44)}var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44)}var newname=PATH.basename(newpath);var errCode=FS.mayCreate(parent,newname);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.symlink){throw new FS.ErrnoError(63)}return parent.node_ops.symlink(parent,newname,oldpath)},rename(old_path,new_path){var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);var lookup,old_dir,new_dir;lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node;if(!old_dir||!new_dir)throw new FS.ErrnoError(44);if(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(75)}var old_node=FS.lookupNode(old_dir,old_name);var relative=PATH_FS.relative(old_path,new_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(28)}relative=PATH_FS.relative(new_path,old_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(55)}var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(old_node===new_node){return}var isdir=FS.isDir(old_node.mode);var errCode=FS.mayDelete(old_dir,old_name,isdir);if(errCode){throw new FS.ErrnoError(errCode)}errCode=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(errCode){throw new FS.ErrnoError(errCode)}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(63)}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(10)}if(new_dir!==old_dir){errCode=FS.nodePermissions(old_dir,"w");if(errCode){throw new FS.ErrnoError(errCode)}}FS.hashRemoveNode(old_node);try{old_dir.node_ops.rename(old_node,new_dir,new_name);old_node.parent=new_dir}catch(e){throw e}finally{FS.hashAddNode(old_node)}},rmdir(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,true);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(63)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}parent.node_ops.rmdir(parent,name);FS.destroyNode(node)},readdir(path){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;var readdir=FS.checkOpExists(node.node_ops.readdir,54);return readdir(node)},unlink(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44)}var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,false);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.unlink){throw new FS.ErrnoError(63)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}parent.node_ops.unlink(parent,name);FS.destroyNode(node)},readlink(path){var lookup=FS.lookupPath(path);var link=lookup.node;if(!link){throw new FS.ErrnoError(44)}if(!link.node_ops.readlink){throw new FS.ErrnoError(28)}return link.node_ops.readlink(link)},stat(path,dontFollow){var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;var getattr=FS.checkOpExists(node.node_ops.getattr,63);return getattr(node)},fstat(fd){var stream=FS.getStreamChecked(fd);var node=stream.node;var getattr=stream.stream_ops.getattr;var arg=getattr?stream:node;getattr??=node.node_ops.getattr;FS.checkOpExists(getattr,63);return getattr(arg)},lstat(path){return FS.stat(path,true)},doChmod(stream,node,mode,dontFollow){FS.doSetAttr(stream,node,{mode:mode&4095|node.mode&~4095,ctime:Date.now(),dontFollow})},chmod(path,mode,dontFollow){var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}FS.doChmod(null,node,mode,dontFollow)},lchmod(path,mode){FS.chmod(path,mode,true)},fchmod(fd,mode){var stream=FS.getStreamChecked(fd);FS.doChmod(stream,stream.node,mode,false)},doChown(stream,node,dontFollow){FS.doSetAttr(stream,node,{timestamp:Date.now(),dontFollow})},chown(path,uid,gid,dontFollow){var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}FS.doChown(null,node,dontFollow)},lchown(path,uid,gid){FS.chown(path,uid,gid,true)},fchown(fd,uid,gid){var stream=FS.getStreamChecked(fd);FS.doChown(stream,stream.node,false)},doTruncate(stream,node,len){if(FS.isDir(node.mode)){throw new FS.ErrnoError(31)}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(28)}var errCode=FS.nodePermissions(node,"w");if(errCode){throw new FS.ErrnoError(errCode)}FS.doSetAttr(stream,node,{size:len,timestamp:Date.now()})},truncate(path,len){if(len<0){throw new FS.ErrnoError(28)}var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node}else{node=path}FS.doTruncate(null,node,len)},ftruncate(fd,len){var stream=FS.getStreamChecked(fd);if(len<0||(stream.flags&2097155)===0){throw new FS.ErrnoError(28)}FS.doTruncate(stream,stream.node,len)},utime(path,atime,mtime){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;var setattr=FS.checkOpExists(node.node_ops.setattr,63);setattr(node,{atime,mtime})},open(path,flags,mode=438){if(path===""){throw new FS.ErrnoError(44)}flags=typeof flags=="string"?FS_modeStringToFlags(flags):flags;if(flags&64){mode=mode&4095|32768}else{mode=0}var node;var isDirPath;if(typeof path=="object"){node=path}else{isDirPath=path.endsWith("/");var lookup=FS.lookupPath(path,{follow:!(flags&131072),noent_okay:true});node=lookup.node;path=lookup.path}var created=false;if(flags&64){if(node){if(flags&128){throw new FS.ErrnoError(20)}}else if(isDirPath){throw new FS.ErrnoError(31)}else{node=FS.mknod(path,mode|511,0);created=true}}if(!node){throw new FS.ErrnoError(44)}if(FS.isChrdev(node.mode)){flags&=~512}if(flags&65536&&!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}if(!created){var errCode=FS.mayOpen(node,flags);if(errCode){throw new FS.ErrnoError(errCode)}}if(flags&512&&!created){FS.truncate(node,0)}flags&=~(128|512|131072);var stream=FS.createStream({node,path:FS.getPath(node),flags,seekable:true,position:0,stream_ops:node.stream_ops,ungotten:[],error:false});if(stream.stream_ops.open){stream.stream_ops.open(stream)}if(created){FS.chmod(node,mode&511)}return stream},close(stream){if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if(stream.getdents)stream.getdents=null;try{if(stream.stream_ops.close){stream.stream_ops.close(stream)}}catch(e){throw e}finally{FS.closeStream(stream.fd)}stream.fd=null},isClosed(stream){return stream.fd===null},llseek(stream,offset,whence){if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(70)}if(whence!=0&&whence!=1&&whence!=2){throw new FS.ErrnoError(28)}stream.position=stream.stream_ops.llseek(stream,offset,whence);stream.ungotten=[];return stream.position},read(stream,buffer,offset,length,position){if(length<0||position<0){throw new FS.ErrnoError(28)}if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if((stream.flags&2097155)===1){throw new FS.ErrnoError(8)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31)}if(!stream.stream_ops.read){throw new FS.ErrnoError(28)}var seeking=typeof position!="undefined";if(!seeking){position=stream.position}else if(!stream.seekable){throw new FS.ErrnoError(70)}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead},write(stream,buffer,offset,length,position,canOwn){if(length<0||position<0){throw new FS.ErrnoError(28)}if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(8)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31)}if(!stream.stream_ops.write){throw new FS.ErrnoError(28)}if(stream.seekable&&stream.flags&1024){FS.llseek(stream,0,2)}var seeking=typeof position!="undefined";if(!seeking){position=stream.position}else if(!stream.seekable){throw new FS.ErrnoError(70)}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;return bytesWritten},mmap(stream,length,position,prot,flags){if((prot&2)!==0&&(flags&2)===0&&(stream.flags&2097155)!==2){throw new FS.ErrnoError(2)}if((stream.flags&2097155)===1){throw new FS.ErrnoError(2)}if(!stream.stream_ops.mmap){throw new FS.ErrnoError(43)}if(!length){throw new FS.ErrnoError(28)}return stream.stream_ops.mmap(stream,length,position,prot,flags)},msync(stream,buffer,offset,length,mmapFlags){if(!stream.stream_ops.msync){return 0}return stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags)},ioctl(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(59)}return stream.stream_ops.ioctl(stream,cmd,arg)},readFile(path,opts={}){opts.flags=opts.flags||0;opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){abort(`Invalid encoding type "${opts.encoding}"`)}var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){buf=UTF8ArrayToString(buf)}FS.close(stream);return buf},writeFile(path,data,opts={}){opts.flags=opts.flags||577;var stream=FS.open(path,opts.flags,opts.mode);if(typeof data=="string"){data=new Uint8Array(intArrayFromString(data,true))}if(ArrayBuffer.isView(data)){FS.write(stream,data,0,data.byteLength,undefined,opts.canOwn)}else{abort("Unsupported data type")}FS.close(stream)},cwd:()=>FS.currentPath,chdir(path){var lookup=FS.lookupPath(path,{follow:true});if(lookup.node===null){throw new FS.ErrnoError(44)}if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(54)}var errCode=FS.nodePermissions(lookup.node,"x");if(errCode){throw new FS.ErrnoError(errCode)}FS.currentPath=lookup.path},createDefaultDirectories(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")},createDefaultDevices(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(stream,buffer,offset,length,pos)=>length,llseek:()=>0});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var randomBuffer=new Uint8Array(1024),randomLeft=0;var randomByte=()=>{if(randomLeft===0){randomFill(randomBuffer);randomLeft=randomBuffer.byteLength}return randomBuffer[--randomLeft]};FS.createDevice("/dev","random",randomByte);FS.createDevice("/dev","urandom",randomByte);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")},createSpecialDirectories(){FS.mkdir("/proc");var proc_self=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount(){var node=FS.createNode(proc_self,"fd",16895,73);node.stream_ops={llseek:MEMFS.stream_ops.llseek};node.node_ops={lookup(parent,name){var fd=+name;var stream=FS.getStreamChecked(fd);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>stream.path},id:fd+1};ret.parent=ret;return ret},readdir(){return Array.from(FS.streams.entries()).filter(([k,v])=>v).map(([k,v])=>k.toString())}};return node}},{},"/proc/self/fd")},createStandardStreams(input,output,error){if(input){FS.createDevice("/dev","stdin",input)}else{FS.symlink("/dev/tty","/dev/stdin")}if(output){FS.createDevice("/dev","stdout",null,output)}else{FS.symlink("/dev/tty","/dev/stdout")}if(error){FS.createDevice("/dev","stderr",null,error)}else{FS.symlink("/dev/tty1","/dev/stderr")}var stdin=FS.open("/dev/stdin",0);var stdout=FS.open("/dev/stdout",1);var stderr=FS.open("/dev/stderr",1)},staticInit(){FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={MEMFS}},init(input,output,error){FS.initialized=true;input??=Module["stdin"];output??=Module["stdout"];error??=Module["stderr"];FS.createStandardStreams(input,output,error)},quit(){FS.initialized=false;for(var stream of FS.streams){if(stream){FS.close(stream)}}},findObject(path,dontResolveLastLink){var ret=FS.analyzePath(path,dontResolveLastLink);if(!ret.exists){return null}return ret.object},analyzePath(path,dontResolveLastLink){try{var lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});path=lookup.path}catch(e){}var ret={isRoot:false,exists:false,error:0,name:null,path:null,object:null,parentExists:false,parentPath:null,parentObject:null};try{var lookup=FS.lookupPath(path,{parent:true});ret.parentExists=true;ret.parentPath=lookup.path;ret.parentObject=lookup.node;ret.name=PATH.basename(path);lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});ret.exists=true;ret.path=lookup.path;ret.object=lookup.node;ret.name=lookup.node.name;ret.isRoot=lookup.path==="/"}catch(e){ret.error=e.errno}return ret},createPath(parent,path,canRead,canWrite){parent=typeof parent=="string"?parent:FS.getPath(parent);var parts=path.split("/").reverse();while(parts.length){var part=parts.pop();if(!part)continue;var current=PATH.join2(parent,part);try{FS.mkdir(current)}catch(e){if(e.errno!=20)throw e}parent=current}return current},createFile(parent,name,properties,canRead,canWrite){var path=PATH.join2(typeof parent=="string"?parent:FS.getPath(parent),name);var mode=FS_getMode(canRead,canWrite);return FS.create(path,mode)},createDataFile(parent,name,data,canRead,canWrite,canOwn){var path=name;if(parent){parent=typeof parent=="string"?parent:FS.getPath(parent);path=name?PATH.join2(parent,name):parent}var mode=FS_getMode(canRead,canWrite);var node=FS.create(path,mode);if(data){if(typeof data=="string"){var arr=new Array(data.length);for(var i=0,len=data.length;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]}setDataGetter(getter){this.getter=getter}cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))abort("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(from,to)=>{if(from>to)abort("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)abort("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))abort("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}return intArrayFromString(xhr.responseText||"",true)};var lazyArray=this;lazyArray.setDataGetter(chunkNum=>{var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]=="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]=="undefined")abort("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true}get length(){if(!this.lengthKnown){this.cacheLength()}return this._length}get chunkSize(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}if(globalThis.XMLHttpRequest){if(!ENVIRONMENT_IS_WORKER)abort("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var lazyArray=new LazyUint8Array;var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};for(const[key,fn]of Object.entries(node.stream_ops)){stream_ops[key]=(...args)=>{FS.forceLoadFile(node);return fn(...args)}}function writeChunks(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i{FS.forceLoadFile(node);return writeChunks(stream,buffer,offset,length,position)};stream_ops.mmap=(stream,length,position,prot,flags)=>{FS.forceLoadFile(node);var ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48)}writeChunks(stream,HEAP8,ptr,length,position);return{ptr,allocated:true}};node.stream_ops=stream_ops;return node}};var UTF8ToString=(ptr,maxBytesToRead,ignoreNul)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead,ignoreNul):"";var SYSCALLS={calculateAt(dirfd,path,allowEmpty){if(PATH.isAbs(path)){return path}var dir;if(dirfd===-100){dir=FS.cwd()}else{var dirstream=SYSCALLS.getStreamFromFD(dirfd);dir=dirstream.path}if(path.length==0){if(!allowEmpty){throw new FS.ErrnoError(44)}return dir}return dir+"/"+path},writeStat(buf,stat){HEAPU32[buf>>2]=stat.dev;HEAPU32[buf+4>>2]=stat.mode;HEAPU32[buf+8>>2]=stat.nlink;HEAPU32[buf+12>>2]=stat.uid;HEAPU32[buf+16>>2]=stat.gid;HEAPU32[buf+20>>2]=stat.rdev;HEAP64[buf+24>>3]=BigInt(stat.size);HEAP32[buf+32>>2]=4096;HEAP32[buf+36>>2]=stat.blocks;var atime=stat.atime.getTime();var mtime=stat.mtime.getTime();var ctime=stat.ctime.getTime();HEAP64[buf+40>>3]=BigInt(Math.floor(atime/1e3));HEAPU32[buf+48>>2]=atime%1e3*1e3*1e3;HEAP64[buf+56>>3]=BigInt(Math.floor(mtime/1e3));HEAPU32[buf+64>>2]=mtime%1e3*1e3*1e3;HEAP64[buf+72>>3]=BigInt(Math.floor(ctime/1e3));HEAPU32[buf+80>>2]=ctime%1e3*1e3*1e3;HEAP64[buf+88>>3]=BigInt(stat.ino);return 0},writeStatFs(buf,stats){HEAPU32[buf+4>>2]=stats.bsize;HEAPU32[buf+60>>2]=stats.bsize;HEAP64[buf+8>>3]=BigInt(stats.blocks);HEAP64[buf+16>>3]=BigInt(stats.bfree);HEAP64[buf+24>>3]=BigInt(stats.bavail);HEAP64[buf+32>>3]=BigInt(stats.files);HEAP64[buf+40>>3]=BigInt(stats.ffree);HEAPU32[buf+48>>2]=stats.fsid;HEAPU32[buf+64>>2]=stats.flags;HEAPU32[buf+56>>2]=stats.namelen},doMsync(addr,stream,len,flags,offset){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43)}if(flags&2){return 0}var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},getStreamFromFD(fd){var stream=FS.getStreamChecked(fd);return stream},varargs:undefined,getStr(ptr){var ret=UTF8ToString(ptr);return ret}};function ___syscall_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=syscallGetVarargI();if(arg<0){return-28}while(FS.streams[arg]){arg++}var newStream;newStream=FS.dupStream(stream,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=syscallGetVarargI();stream.flags|=arg;return 0}case 12:{var arg=syscallGetVarargP();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0}return-28}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);function ___syscall_getdents64(fd,dirp,count){try{var stream=SYSCALLS.getStreamFromFD(fd);stream.getdents||=FS.readdir(stream.path);var struct_size=280;var pos=0;var off=FS.llseek(stream,0,1);var startIdx=Math.floor(off/struct_size);var endIdx=Math.min(stream.getdents.length,startIdx+Math.floor(count/struct_size));for(var idx=startIdx;idx>3]=BigInt(id);HEAP64[dirp+pos+8>>3]=BigInt((idx+1)*struct_size);HEAP16[dirp+pos+16>>1]=280;HEAP8[dirp+pos+18]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:{if(!stream.tty)return-59;return 0}case 21505:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tcgets){var termios=stream.tty.ops.ioctl_tcgets(stream);var argp=syscallGetVarargP();HEAP32[argp>>2]=termios.c_iflag||0;HEAP32[argp+4>>2]=termios.c_oflag||0;HEAP32[argp+8>>2]=termios.c_cflag||0;HEAP32[argp+12>>2]=termios.c_lflag||0;for(var i=0;i<32;i++){HEAP8[argp+i+17]=termios.c_cc[i]||0}return 0}return 0}case 21510:case 21511:case 21512:{if(!stream.tty)return-59;return 0}case 21506:case 21507:case 21508:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tcsets){var argp=syscallGetVarargP();var c_iflag=HEAP32[argp>>2];var c_oflag=HEAP32[argp+4>>2];var c_cflag=HEAP32[argp+8>>2];var c_lflag=HEAP32[argp+12>>2];var c_cc=[];for(var i=0;i<32;i++){c_cc.push(HEAP8[argp+i+17])}return stream.tty.ops.ioctl_tcsets(stream.tty,op,{c_iflag,c_oflag,c_cflag,c_lflag,c_cc})}return 0}case 21519:{if(!stream.tty)return-59;var argp=syscallGetVarargP();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21537:case 21531:{var argp=syscallGetVarargP();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tiocgwinsz){var winsize=stream.tty.ops.ioctl_tiocgwinsz(stream.tty);var argp=syscallGetVarargP();HEAP16[argp>>1]=winsize[0];HEAP16[argp+2>>1]=winsize[1]}return 0}case 21524:{if(!stream.tty)return-59;return 0}case 21515:{if(!stream.tty)return-59;return 0}default:return-28}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_openat(dirfd,path,flags,varargs){SYSCALLS.varargs=varargs;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);var mode=varargs?syscallGetVarargI():0;return FS.open(path,flags,mode).fd}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.writeStat(buf,FS.stat(path))}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}var __abort_js=()=>abort("");var getHeapMax=()=>2147483648;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var oldHeapSize=wasmMemory.buffer.byteLength;var pages=(size-oldHeapSize+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var ENV={};var getExecutableName=()=>thisProgram||"./this.program";var getEnvStrings=()=>{if(!getEnvStrings.strings){var lang=(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8";var env={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:lang,_:getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(`${x}=${env[x]}`)}getEnvStrings.strings=strings}return getEnvStrings.strings};var _environ_get=(__environ,environ_buf)=>{var bufSize=0;var envp=0;for(var string of getEnvStrings()){var ptr=environ_buf+bufSize;HEAPU32[__environ+envp>>2]=ptr;bufSize+=stringToUTF8(string,ptr,Infinity)+1;envp+=4}return 0};var _environ_sizes_get=(penviron_count,penviron_buf_size)=>{var strings=getEnvStrings();HEAPU32[penviron_count>>2]=strings.length;var bufSize=0;for(var string of strings){bufSize+=lengthBytesUTF8(string)+1}HEAPU32[penviron_buf_size>>2]=bufSize;return 0};function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var doReadv=(stream,iov,iovcnt,offset)=>{var ret=0;for(var i=0;i>2];var len=HEAPU32[iov+4>>2];iov+=8;var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var INT53_MAX=9007199254740992;var INT53_MIN=-9007199254740992;var bigintToI53Checked=num=>numINT53_MAX?NaN:Number(num);function _fd_seek(fd,offset,whence,newOffset){offset=bigintToI53Checked(offset);try{if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd);FS.llseek(stream,offset,whence);HEAP64[newOffset>>3]=BigInt(stream.position);if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var doWritev=(stream,iov,iovcnt,offset)=>{var ret=0;for(var i=0;i>2];var len=HEAPU32[iov+4>>2];iov+=8;var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var getCFunc=ident=>{var func=Module["_"+ident];return func};var writeArrayToMemory=(array,buffer)=>{HEAP8.set(array,buffer)};var stackAlloc=sz=>__emscripten_stack_alloc(sz);var stringToUTF8OnStack=str=>{var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret};var ccall=(ident,returnType,argTypes,args,opts)=>{var toC={string:str=>{var ret=0;if(str!==null&&str!==undefined&&str!==0){ret=stringToUTF8OnStack(str)}return ret},array:arr=>{var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string"){return UTF8ToString(ret)}if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i{var numericArgs=!argTypes||argTypes.every(type=>type==="number"||type==="boolean");var numericRet=returnType!=="string";if(numericRet&&numericArgs&&!opts){return getCFunc(ident)}return(...args)=>ccall(ident,returnType,argTypes,args,opts)};var FS_createPath=(...args)=>FS.createPath(...args);var FS_unlink=(...args)=>FS.unlink(...args);var FS_createLazyFile=(...args)=>FS.createLazyFile(...args);var FS_createDevice=(...args)=>FS.createDevice(...args);FS.createPreloadedFile=FS_createPreloadedFile;FS.preloadFile=FS_preloadFile;FS.staticInit();{if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(Module["preloadPlugins"])preloadPlugins=Module["preloadPlugins"];if(Module["print"])out=Module["print"];if(Module["printErr"])err=Module["printErr"];if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].shift()()}}}Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["cwrap"]=cwrap;Module["UTF8ToString"]=UTF8ToString;Module["stringToUTF8"]=stringToUTF8;Module["lengthBytesUTF8"]=lengthBytesUTF8;Module["FS_preloadFile"]=FS_preloadFile;Module["FS_unlink"]=FS_unlink;Module["FS_createPath"]=FS_createPath;Module["FS_createDevice"]=FS_createDevice;Module["FS_createDataFile"]=FS_createDataFile;Module["FS_createLazyFile"]=FS_createLazyFile;var _lfw_init,_lfw_dispose,_lfw_find_lenses_json,_lfw_find_cameras_json,_lfw_available_mods,_lfw_build_geometry_map,_lfw_build_tca_map,_lfw_build_vignetting_map,_lfw_free,_malloc,_free,__emscripten_stack_restore,__emscripten_stack_alloc,_emscripten_stack_get_current,memory,__indirect_function_table,wasmMemory;function assignWasmExports(wasmExports){_lfw_init=Module["_lfw_init"]=wasmExports["q"];_lfw_dispose=Module["_lfw_dispose"]=wasmExports["r"];_lfw_find_lenses_json=Module["_lfw_find_lenses_json"]=wasmExports["s"];_lfw_find_cameras_json=Module["_lfw_find_cameras_json"]=wasmExports["t"];_lfw_available_mods=Module["_lfw_available_mods"]=wasmExports["u"];_lfw_build_geometry_map=Module["_lfw_build_geometry_map"]=wasmExports["v"];_lfw_build_tca_map=Module["_lfw_build_tca_map"]=wasmExports["w"];_lfw_build_vignetting_map=Module["_lfw_build_vignetting_map"]=wasmExports["x"];_lfw_free=Module["_lfw_free"]=wasmExports["y"];_malloc=Module["_malloc"]=wasmExports["z"];_free=Module["_free"]=wasmExports["A"];__emscripten_stack_restore=wasmExports["B"];__emscripten_stack_alloc=wasmExports["C"];_emscripten_stack_get_current=wasmExports["D"];memory=wasmMemory=wasmExports["o"];__indirect_function_table=wasmExports["__indirect_function_table"]}var wasmImports={a:___cxa_throw,e:___syscall_fcntl64,k:___syscall_getdents64,m:___syscall_ioctl,c:___syscall_openat,h:___syscall_stat64,i:__abort_js,n:_emscripten_resize_heap,f:_environ_get,g:_environ_sizes_get,b:_fd_close,l:_fd_read,j:_fd_seek,d:_fd_write};function run(){if(runDependencies>0){dependenciesFulfilled=run;return}preRun();if(runDependencies>0){dependenciesFulfilled=run;return}function doRun(){Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve?.(Module);Module["onRuntimeInitialized"]?.();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(()=>{setTimeout(()=>Module["setStatus"](""),1);doRun()},1)}else{doRun()}}var wasmExports;wasmExports=await (createWasm());run();if(runtimeInitialized){moduleRtn=Module}else{moduleRtn=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject})} +;return moduleRtn}})();if(typeof exports==="object"&&typeof module==="object"){module.exports=createLensfunCoreModule;module.exports.default=createLensfunCoreModule}else if(typeof define==="function"&&define["amd"])define([],()=>createLensfunCoreModule); diff --git a/public/lensfun/lensfun-core.wasm b/public/lensfun/lensfun-core.wasm new file mode 100755 index 0000000..f28e262 Binary files /dev/null and b/public/lensfun/lensfun-core.wasm differ diff --git a/public/luminary-user-guide.pdf b/public/luminary-user-guide.pdf new file mode 100644 index 0000000..2503b84 Binary files /dev/null and b/public/luminary-user-guide.pdf differ diff --git a/server/auth.mjs b/server/auth.mjs new file mode 100644 index 0000000..c21d0e0 --- /dev/null +++ b/server/auth.mjs @@ -0,0 +1,60 @@ +import crypto from 'node:crypto'; +import { SESSION_DAYS } from './config.mjs'; +import { sessions, users } from './db.mjs'; + +const KEYLEN = 64; + +export function hashPassword(password) { + const salt = crypto.randomBytes(16); + const hash = crypto.scryptSync(password, salt, KEYLEN); + return `scrypt$${salt.toString('hex')}$${hash.toString('hex')}`; +} + +export function verifyPassword(password, stored) { + const [scheme, saltHex, hashHex] = String(stored).split('$'); + if (scheme !== 'scrypt' || !saltHex || !hashHex) return false; + const expected = Buffer.from(hashHex, 'hex'); + const actual = crypto.scryptSync(password, Buffer.from(saltHex, 'hex'), expected.length); + return expected.length === actual.length && crypto.timingSafeEqual(expected, actual); +} + +export function createSession(userId) { + const token = crypto.randomBytes(32).toString('hex'); + const expiresAt = Date.now() + SESSION_DAYS * 24 * 60 * 60 * 1000; + sessions.purge(); + sessions.create(token, userId, expiresAt); + return token; +} + +export function publicUser(row) { + if (!row) return null; + return { + id: row.id, + email: row.email, + name: row.name ?? '', + role: row.role ?? 'member', + }; +} + +export function authenticate(req) { + const header = String(req.headers.authorization ?? ''); + const token = header.startsWith('Bearer ') ? header.slice(7).trim() : ''; + if (!token) return null; + const session = sessions.find(token); + if (!session) return null; + if (Number(session.expires_at) < Date.now()) { + sessions.destroy(token); + return null; + } + const user = users.byId(session.user_id); + if (!user || user.disabled) return null; + return publicUser(user); +} + +export function normalizeEmail(value) { + return typeof value === 'string' ? value.trim().toLowerCase() : ''; +} + +export function validEmail(email) { + return /^[^@\s]+@[^@\s]+\.[^@\s]{2,}$/.test(email); +} diff --git a/server/bridge.mjs b/server/bridge.mjs new file mode 100644 index 0000000..b7966ec --- /dev/null +++ b/server/bridge.mjs @@ -0,0 +1,265 @@ +/** + * Bridge to the Media Team Hub dashboard. + * + * The dashboard signs a short-lived token scoped to one event; this module + * verifies it, exchanges it for a service token, mirrors the event's photo list + * into the local catalog, and proxies bytes/save-backs for as long as the + * bridge session lives. Nothing here is reachable without a valid token. + */ + +import crypto from 'node:crypto'; +import { BRIDGE_SECRET, BRIDGE_TTL_HOURS, GLENLOCH_URL } from './config.mjs'; +import { db, removeEvent, removePhoto, saveEvent, savePhoto } from './db.mjs'; +import { removeAsset } from './storage.mjs'; + +const VERSION = 'g1'; + +/* ------------------------------------------------------------------- tokens */ + +export function bridgeConfigured() { + return Boolean(BRIDGE_SECRET && GLENLOCH_URL); +} + +export function verifyBridgeToken(token, now = Date.now()) { + if (!BRIDGE_SECRET || typeof token !== 'string') return null; + const parts = token.split('.'); + if (parts.length !== 3 || parts[0] !== VERSION) return null; + const [, body, signature] = parts; + + const expected = crypto.createHmac('sha256', BRIDGE_SECRET).update(body).digest(); + let supplied; + try { + supplied = Buffer.from(signature.replace(/-/g, '+').replace(/_/g, '/'), 'base64'); + } catch { + return null; + } + if ( + supplied.length !== expected.length || + !crypto.timingSafeEqual(supplied, expected) + ) { + return null; + } + + let payload; + try { + payload = JSON.parse(Buffer.from(body, 'base64url').toString('utf8')); + } catch { + return null; + } + if ( + !payload || + typeof payload.sid !== 'string' || + typeof payload.eid !== 'string' || + typeof payload.uid !== 'string' || + typeof payload.email !== 'string' || + (payload.kind !== 'login' && payload.kind !== 'service') || + typeof payload.exp !== 'number' || + payload.exp * 1000 <= now + ) { + return null; + } + return payload; +} + +async function dashboardJson(url, token, init = {}) { + const res = await fetch(url, { + ...init, + headers: { + ...(init.headers ?? {}), + authorization: `Bearer ${token}`, + }, + }); + const text = await res.text(); + let body = null; + try { + body = text ? JSON.parse(text) : null; + } catch { + body = null; + } + if (!res.ok) { + throw new Error(body?.error || `Dashboard request failed (${res.status})`); + } + return body; +} + +/** Swap the one browser-hop login token for a longer server-side token. */ +export async function exchangeBridgeToken(loginToken, sessionId) { + return dashboardJson( + `${GLENLOCH_URL}/api/bridge/sessions/${encodeURIComponent(sessionId)}/exchange`, + loginToken, + { method: 'POST' }, + ); +} + +/* ------------------------------------------------------------------ storage */ + +const bridgeInsert = db.prepare(` + INSERT INTO bridge_events (event_id, session_id, token, glenloch_url, source_event_id, return_url, expires_at, created_at) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) + ON CONFLICT(event_id) DO UPDATE SET + session_id = excluded.session_id, + token = excluded.token, + glenloch_url = excluded.glenloch_url, + source_event_id = excluded.source_event_id, + return_url = excluded.return_url, + expires_at = excluded.expires_at, + created_at = excluded.created_at +`); +const bridgeGet = db.prepare('SELECT * FROM bridge_events WHERE event_id = ?'); +const bridgeExpired = db.prepare('SELECT event_id FROM bridge_events WHERE expires_at < ?'); +const bridgeDelete = db.prepare('DELETE FROM bridge_events WHERE event_id = ?'); +const photosForEvent = db.prepare('SELECT id FROM photos WHERE event_id = ?'); + +export function bridgeEventId(sourceEventId) { + return `br-${sourceEventId}`; +} + +export function bridgePhotoId(sourcePhotoId) { + return `br-${sourcePhotoId}`; +} + +export function bridgeForEvent(eventId) { + return bridgeGet.get(eventId) ?? null; +} + +/** Deletes an imported event, its rows and any cached previews/thumbnails. */ +function dropBridgeEvent(eventId) { + for (const row of photosForEvent.all(eventId)) { + removePhoto(row.id); + removeAsset(row.id).catch(() => undefined); + } + removeEvent(eventId); + bridgeDelete.run(eventId); +} + +/** Removes events whose bridge session has expired. Safe to call often. */ +export function purgeExpiredBridges(now = Date.now()) { + for (const row of bridgeExpired.all(now)) { + dropBridgeEvent(row.event_id); + } +} + +function eventRecordFrom(listing, eventId, sessionId, returnUrl, expiresAt) { + const source = listing.event; + return { + id: eventId, + name: source.title || 'Advanced edit', + date: source.startsAt ? Date.parse(source.startsAt) : Date.now(), + createdAt: Date.now(), + notes: source.description ?? undefined, + bridge: { + sessionId, + sourceEventId: source.id, + dashboardUrl: returnUrl ?? `${GLENLOCH_URL}/events/${source.id}`, + expiresAt, + }, + }; +} + +function photoRecordFrom(photo, eventId, sessionId, index) { + const id = bridgePhotoId(photo.id); + const raw = photo.kind === 'raw'; + return { + id, + eventId, + order: index, + name: photo.filename, + width: photo.width || 0, + height: photo.height || 0, + size: photo.sizeBytes || 0, + mime: photo.mimeType || 'application/octet-stream', + addedAt: Date.now(), + takenAt: photo.takenAt ? Date.parse(photo.takenAt) : undefined, + meta: {}, + thumb: '', + thumbUrl: `/api/photos/${id}/thumb`, + rating: 0, + flag: 'none', + color: '', + keywords: [], + edits: {}, + history: [], + raw, + previewUrl: raw ? `/api/photos/${id}/preview` : undefined, + bridgeSource: { sessionId, sourceId: photo.id }, + }; +} + +/** + * Mirrors one event into the local catalog. The photo bytes stay on the + * dashboard; only metadata, previews and thumbnails are temporary here. + */ +export async function importBridgeEvent({ serviceToken, sessionId, ownerId = '' }) { + const expiresAt = + Date.now() + Math.max(1, BRIDGE_TTL_HOURS) * 60 * 60 * 1000; + + const listing = await dashboardJson( + `${GLENLOCH_URL}/api/bridge/sessions/${encodeURIComponent(sessionId)}`, + serviceToken, + ); + const eventId = bridgeEventId(listing.event.id); + dropBridgeEvent(eventId); + + const returnUrl = listing.editor?.returnUrl ?? null; + saveEvent(eventRecordFrom(listing, eventId, sessionId, returnUrl, expiresAt), 0, ownerId); + listing.photos.forEach((photo, index) => { + savePhoto(photoRecordFrom(photo, eventId, sessionId, index), Date.now(), ownerId); + }); + bridgeInsert.run( + eventId, + sessionId, + serviceToken, + GLENLOCH_URL, + listing.event.id, + returnUrl, + expiresAt, + Date.now(), + ); + + return { + eventId, + photoCount: listing.photos.length, + sessionId, + expiresAt, + }; +} + +/* ----------------------------------------------------------------- proxying */ + +export function bridgeSourceUrl(row, sourcePhotoId, variant) { + const params = new URLSearchParams({ variant }); + return `${row.glenloch_url}/api/bridge/sessions/${encodeURIComponent( + row.session_id, + )}/photos/${encodeURIComponent(sourcePhotoId)}/source?${params}`; +} + +export async function fetchBridgeImage(row, sourcePhotoId, variant) { + return fetch(bridgeSourceUrl(row, sourcePhotoId, variant), { + headers: { authorization: `Bearer ${row.token}` }, + }); +} + +/** Forwards a browser-rendered JPEG and recipe to the dashboard. */ +export async function forwardBridgeRender(row, sourcePhotoId, payload) { + const res = await fetch( + `${row.glenloch_url}/api/bridge/sessions/${encodeURIComponent( + row.session_id, + )}/photos/${encodeURIComponent(sourcePhotoId)}/render`, + { + method: 'POST', + headers: { + 'content-type': 'application/json', + authorization: `Bearer ${row.token}`, + }, + body: JSON.stringify(payload), + }, + ); + const text = await res.text(); + let body = null; + try { + body = text ? JSON.parse(text) : null; + } catch { + body = null; + } + return { status: res.status, body }; +} diff --git a/server/config.mjs b/server/config.mjs new file mode 100644 index 0000000..9f68ce1 --- /dev/null +++ b/server/config.mjs @@ -0,0 +1,85 @@ +import os from 'node:os'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const here = path.dirname(fileURLToPath(import.meta.url)); + +export const ROOT = path.resolve(here, '..'); + +/** Read a Luminary setting, falling back to its pre-rebrand LUMENROOM_ name. */ +function setting(name, fallback = '') { + return process.env[`LUMINARY_${name}`] || process.env[`LUMENROOM_${name}`] || fallback; +} + +const dataDir = setting('DATA'); +export const DATA_DIR = dataDir ? path.resolve(dataDir) : path.join(here, 'data'); + +export const ORIGINAL_DIR = path.join(DATA_DIR, 'originals'); +export const PREVIEW_DIR = path.join(DATA_DIR, 'previews'); +export const THUMB_DIR = path.join(DATA_DIR, 'thumbs'); +// Keep the original filename so an existing catalog opens without a migration. +export const DB_PATH = path.join(DATA_DIR, 'lumenroom.db'); +export const DIST_DIR = path.join(ROOT, 'dist'); + +export const PORT = Number(process.env.PORT || 8787); +export const HOST = process.env.HOST || '0.0.0.0'; + +/** Shared invite code required to register after the first account exists. */ +export const INVITE = setting('INVITE'); + +/** Base URL of the dashboard this editor is bridged to, e.g. http://hub:3000. */ +export const GLENLOCH_URL = (process.env.GLENLOCH_URL || '').replace(/\/+$/, ''); + +/** Shared HMAC secret for bridge tokens; must match the dashboard's value. */ +export const BRIDGE_SECRET = process.env.BRIDGE_SECRET || ''; + +/** How long an imported bridge event survives without being reopened. */ +export const BRIDGE_TTL_HOURS = Number(setting('BRIDGE_TTL_HOURS', '12')); + +/** Upload ceiling in bytes (300 MB default, bigger than any consumer raw). */ +export const MAX_UPLOAD = Number(setting('MAX_UPLOAD', String(300 * 1024 * 1024))); + +/** Per-account storage allowance. 100 GiB unless the admin changes it. */ +export const QUOTA_BYTES = Number(setting('QUOTA_BYTES', String(100 * 1024 * 1024 * 1024))); + +/** Fraction of the quota at which the account is warned (0.9 = 90%). */ +export const QUOTA_WARN_RATIO = Math.min( + 0.99, + Math.max(0.5, Number(setting('QUOTA_WARN_RATIO', '0.9')) || 0.9), +); + +/** Scheduled prunes always leave at least this much room below the cap. */ +export const QUOTA_TARGET_RATIO = Math.min( + 0.95, + Math.max(0.5, Number(setting('QUOTA_TARGET_RATIO', '0.8')) || 0.8), +); + +/** Public URL used in notification emails. Empty falls back to localhost. */ +export const PUBLIC_URL = setting('PUBLIC_URL').replace(/\/+$/, ''); + +/** Gmail SMTP defaults; the admin can override these in Administration. */ +export const SMTP_HOST = setting('SMTP_HOST', 'smtp.gmail.com'); +export const SMTP_PORT = Number(setting('SMTP_PORT', '465')); +export const SMTP_SECURE = setting('SMTP_SECURE', 'true') !== 'false'; +export const SMTP_USER = setting('SMTP_USER'); +export const SMTP_APP_PASSWORD = setting('SMTP_APP_PASSWORD'); +export const SMTP_FROM = setting('SMTP_FROM', SMTP_USER); + +/** Long edge used for the editable proxy of raw files. */ +export const RAW_PREVIEW_EDGE = Number(setting('RAW_EDGE', '6000')); + +export const SESSION_DAYS = 30; + +/** How many raws decode at once. One core is left for the HTTP server. */ +export const RAW_WORKERS = Math.max( + 1, + Number( + setting( + 'RAW_WORKERS', + String(Math.min(4, Math.max(1, (os.availableParallelism?.() ?? os.cpus().length) - 1))), + ), + ), +); + +/** Idle decoder workers are disposed after this long to release memory. */ +export const RAW_IDLE_MS = Number(setting('RAW_IDLE_MS', '90000')); diff --git a/server/db.mjs b/server/db.mjs new file mode 100644 index 0000000..5ced803 --- /dev/null +++ b/server/db.mjs @@ -0,0 +1,592 @@ +import fs from 'node:fs'; +import { DatabaseSync } from 'node:sqlite'; +import { DATA_DIR, DB_PATH } from './config.mjs'; + +fs.mkdirSync(DATA_DIR, { recursive: true }); + +export const db = new DatabaseSync(DB_PATH); + +db.exec(` + PRAGMA journal_mode = WAL; + PRAGMA foreign_keys = ON; + + CREATE TABLE IF NOT EXISTS users ( + id TEXT PRIMARY KEY, + email TEXT NOT NULL UNIQUE, + name TEXT NOT NULL DEFAULT '', + pass_hash TEXT NOT NULL, + role TEXT NOT NULL DEFAULT 'member', + disabled INTEGER NOT NULL DEFAULT 0, + created_at INTEGER NOT NULL + ); + + CREATE TABLE IF NOT EXISTS sessions ( + token TEXT PRIMARY KEY, + user_id TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE, + created_at INTEGER NOT NULL, + expires_at INTEGER NOT NULL + ); + + CREATE TABLE IF NOT EXISTS events ( + id TEXT PRIMARY KEY, + owner_id TEXT NOT NULL DEFAULT '', + sort_index REAL NOT NULL DEFAULT 0, + created_at INTEGER NOT NULL, + data TEXT NOT NULL + ); + + CREATE TABLE IF NOT EXISTS photos ( + id TEXT PRIMARY KEY, + owner_id TEXT NOT NULL DEFAULT '', + event_id TEXT NOT NULL DEFAULT '', + sort_index REAL NOT NULL DEFAULT 0, + updated_at INTEGER NOT NULL, + raw INTEGER NOT NULL DEFAULT 0, + data TEXT NOT NULL + ); + + CREATE INDEX IF NOT EXISTS photos_event ON photos(event_id); + CREATE INDEX IF NOT EXISTS photos_updated ON photos(updated_at); + + CREATE TABLE IF NOT EXISTS kv ( + key TEXT PRIMARY KEY, + value TEXT NOT NULL + ); + + CREATE TABLE IF NOT EXISTS gallery_picks ( + token TEXT NOT NULL, + photo_id TEXT NOT NULL, + client_id TEXT NOT NULL, + client_name TEXT NOT NULL DEFAULT '', + picked INTEGER NOT NULL DEFAULT 1, + updated_at INTEGER NOT NULL, + PRIMARY KEY (token, photo_id, client_id) + ); + + CREATE INDEX IF NOT EXISTS gallery_picks_token ON gallery_picks(token); + + CREATE TABLE IF NOT EXISTS gallery_comments ( + id TEXT PRIMARY KEY, + token TEXT NOT NULL, + photo_id TEXT NOT NULL, + client_id TEXT NOT NULL, + client_name TEXT NOT NULL DEFAULT '', + body TEXT NOT NULL, + created_at INTEGER NOT NULL + ); + + CREATE INDEX IF NOT EXISTS gallery_comments_token ON gallery_comments(token); + + CREATE TABLE IF NOT EXISTS gallery_reviews ( + token TEXT NOT NULL, + photo_id TEXT NOT NULL, + client_id TEXT NOT NULL, + client_name TEXT NOT NULL DEFAULT '', + status TEXT NOT NULL, + updated_at INTEGER NOT NULL, + PRIMARY KEY (token, photo_id, client_id) + ); + + CREATE INDEX IF NOT EXISTS gallery_reviews_token ON gallery_reviews(token); + + CREATE TABLE IF NOT EXISTS invites ( + token TEXT PRIMARY KEY, + email TEXT NOT NULL DEFAULT '', + role TEXT NOT NULL DEFAULT 'member', + created_by TEXT NOT NULL DEFAULT '', + created_at INTEGER NOT NULL, + expires_at INTEGER NOT NULL, + accepted_at INTEGER, + accepted_by TEXT, + revoked_at INTEGER + ); + + CREATE INDEX IF NOT EXISTS invites_created ON invites(created_at); + + CREATE TABLE IF NOT EXISTS bridge_events ( + event_id TEXT PRIMARY KEY, + session_id TEXT NOT NULL, + token TEXT NOT NULL, + glenloch_url TEXT NOT NULL, + source_event_id TEXT NOT NULL, + return_url TEXT, + expires_at INTEGER NOT NULL, + created_at INTEGER NOT NULL + ); + + CREATE TABLE IF NOT EXISTS user_quota ( + user_id TEXT PRIMARY KEY REFERENCES users(id) ON DELETE CASCADE, + bytes_limit INTEGER NOT NULL DEFAULT 100 * 1024 * 1024 * 1024, + prune_at INTEGER, + prune_plan TEXT, + prune_notified_at INTEGER, + last_quota_email_at INTEGER + ); +`); + +/* Databases created before account disabling existed get the column in place. */ +const userColumns = db.prepare('PRAGMA table_info(users)').all().map((c) => c.name); +if (!userColumns.includes('disabled')) { + db.exec('ALTER TABLE users ADD COLUMN disabled INTEGER NOT NULL DEFAULT 0'); +} + +/* Quota rows created before scheduled-prune plans were stored need the columns. */ +const quotaColumns = db.prepare('PRAGMA table_info(user_quota)').all().map((c) => c.name); +if (!quotaColumns.includes('prune_plan')) { + db.exec('ALTER TABLE user_quota ADD COLUMN prune_plan TEXT'); +} +if (!quotaColumns.includes('prune_notified_at')) { + db.exec('ALTER TABLE user_quota ADD COLUMN prune_notified_at INTEGER'); +} + +/** + * Workspaces arrived after the first shared library. Existing events and photos + * are handed to the oldest account (the admin who created them) once; new rows + * always carry the account that uploaded them. + */ +for (const table of ['events', 'photos']) { + const columns = db.prepare(`PRAGMA table_info(${table})`).all().map((c) => c.name); + if (columns.includes('owner_id')) continue; + db.exec(`ALTER TABLE ${table} ADD COLUMN owner_id TEXT NOT NULL DEFAULT ''`); + db.exec(`CREATE INDEX IF NOT EXISTS ${table}_owner ON ${table}(owner_id)`); + db.exec( + `UPDATE ${table} SET owner_id = COALESCE((SELECT id FROM users ORDER BY created_at ASC LIMIT 1), '') WHERE owner_id = ''`, + ); +} + +/* Proofing links arrived after the first release: events carry their token, + and every client pick is stored against that token. */ +const eventColumns = db.prepare('PRAGMA table_info(events)').all().map((c) => c.name); +if (!eventColumns.includes('share_token')) { + db.exec('ALTER TABLE events ADD COLUMN share_token TEXT'); +} +db.exec('CREATE UNIQUE INDEX IF NOT EXISTS events_share_token ON events(share_token)'); + +const q = { + upsertEvent: db.prepare(` + INSERT INTO events (id, owner_id, sort_index, created_at, data) VALUES (?, ?, ?, ?, ?) + ON CONFLICT(id) DO UPDATE SET + sort_index = excluded.sort_index, + data = excluded.data, + owner_id = events.owner_id + `), + deleteEvent: db.prepare('DELETE FROM events WHERE id = ?'), + allEvents: db.prepare('SELECT data FROM events ORDER BY sort_index ASC, created_at ASC'), + allEventsByOwner: db.prepare( + 'SELECT data FROM events WHERE owner_id = ? ORDER BY sort_index ASC, created_at ASC', + ), + eventOwner: db.prepare('SELECT owner_id FROM events WHERE id = ?'), + eventByShare: db.prepare('SELECT id, owner_id, data FROM events WHERE share_token = ?'), + shareTokenFor: db.prepare('SELECT share_token FROM events WHERE id = ?'), + setShareToken: db.prepare('UPDATE events SET share_token = ? WHERE id = ?'), + clearPicks: db.prepare('DELETE FROM gallery_picks WHERE token = ?'), + clearComments: db.prepare('DELETE FROM gallery_comments WHERE token = ?'), + clearReviews: db.prepare('DELETE FROM gallery_reviews WHERE token = ?'), + commentsByToken: db.prepare( + 'SELECT id, photo_id, client_id, client_name, body, created_at FROM gallery_comments WHERE token = ? ORDER BY created_at ASC', + ), + commentsByOwner: db.prepare(` + SELECT e.id AS event_id, c.photo_id, c.client_name, c.body, c.created_at + FROM gallery_comments c JOIN events e ON e.share_token = c.token + WHERE e.owner_id = ? ORDER BY c.created_at ASC + `), + insertComment: db.prepare(` + INSERT INTO gallery_comments (id, token, photo_id, client_id, client_name, body, created_at) + VALUES (?, ?, ?, ?, ?, ?, ?) + `), + deleteCommentsForPhoto: db.prepare('DELETE FROM gallery_comments WHERE photo_id = ?'), + reviewsByToken: db.prepare( + 'SELECT photo_id, client_id, client_name, status, updated_at FROM gallery_reviews WHERE token = ?', + ), + reviewsByOwner: db.prepare(` + SELECT e.id AS event_id, r.photo_id, r.client_name, r.status, r.updated_at + FROM gallery_reviews r JOIN events e ON e.share_token = r.token + WHERE e.owner_id = ? + `), + upsertReview: db.prepare(` + INSERT INTO gallery_reviews (token, photo_id, client_id, client_name, status, updated_at) + VALUES (?, ?, ?, ?, ?, ?) + ON CONFLICT(token, photo_id, client_id) DO UPDATE SET + client_name = excluded.client_name, + status = excluded.status, + updated_at = excluded.updated_at + `), + deleteReview: db.prepare('DELETE FROM gallery_reviews WHERE token = ? AND photo_id = ? AND client_id = ?'), + deleteReviewsForPhoto: db.prepare('DELETE FROM gallery_reviews WHERE photo_id = ?'), + picksByToken: db.prepare( + 'SELECT photo_id, client_id, client_name, picked, updated_at FROM gallery_picks WHERE token = ?', + ), + picksByOwner: db.prepare(` + SELECT e.id AS event_id, p.photo_id, p.client_id, p.client_name, p.picked, p.updated_at + FROM gallery_picks p JOIN events e ON e.share_token = p.token + WHERE e.owner_id = ? + `), + upsertPick: db.prepare(` + INSERT INTO gallery_picks (token, photo_id, client_id, client_name, picked, updated_at) + VALUES (?, ?, ?, ?, 1, ?) + ON CONFLICT(token, photo_id, client_id) DO UPDATE SET + client_name = excluded.client_name, + picked = 1, + updated_at = excluded.updated_at + `), + deletePick: db.prepare('DELETE FROM gallery_picks WHERE token = ? AND photo_id = ? AND client_id = ?'), + deletePicksForPhoto: db.prepare('DELETE FROM gallery_picks WHERE photo_id = ?'), + + upsertPhoto: db.prepare(` + INSERT INTO photos (id, owner_id, event_id, sort_index, updated_at, raw, data) VALUES (?, ?, ?, ?, ?, ?, ?) + ON CONFLICT(id) DO UPDATE SET + event_id = excluded.event_id, + sort_index = excluded.sort_index, + updated_at = excluded.updated_at, + raw = excluded.raw, + data = excluded.data, + owner_id = photos.owner_id + `), + deletedPhotoBytes: db.prepare( + `SELECT COALESCE(SUM(json_extract(data, '$.size')), 0) AS bytes + FROM photos WHERE owner_id = ? AND json_extract(data, '$.deletedAt') IS NOT NULL`, + ), + deletePhoto: db.prepare('DELETE FROM photos WHERE id = ?'), + allPhotos: db.prepare('SELECT data FROM photos ORDER BY sort_index ASC, updated_at ASC'), + allPhotosByOwner: db.prepare( + 'SELECT data FROM photos WHERE owner_id = ? ORDER BY sort_index ASC, updated_at ASC', + ), + photoOwner: db.prepare('SELECT owner_id FROM photos WHERE id = ?'), + photo: db.prepare('SELECT data FROM photos WHERE id = ?'), + photoCount: db.prepare('SELECT COUNT(*) AS n FROM photos'), + + findUserByEmail: db.prepare('SELECT * FROM users WHERE email = ?'), + insertUser: db.prepare( + 'INSERT INTO users (id, email, name, pass_hash, role, created_at) VALUES (?, ?, ?, ?, ?, ?)', + ), + userCount: db.prepare('SELECT COUNT(*) AS n FROM users'), + findUserById: db.prepare('SELECT id, email, name, role, disabled, created_at FROM users WHERE id = ?'), + allUsers: db.prepare( + 'SELECT id, email, name, role, disabled, created_at FROM users ORDER BY created_at ASC', + ), + activeAdmins: db.prepare("SELECT COUNT(*) AS n FROM users WHERE role = 'admin' AND disabled = 0"), + setUserName: db.prepare('UPDATE users SET name = ? WHERE id = ?'), + setUserRole: db.prepare('UPDATE users SET role = ? WHERE id = ?'), + setUserDisabled: db.prepare('UPDATE users SET disabled = ? WHERE id = ?'), + setUserPassword: db.prepare('UPDATE users SET pass_hash = ? WHERE id = ?'), + deleteUser: db.prepare('DELETE FROM users WHERE id = ?'), + quotaForUser: db.prepare( + 'SELECT user_id, bytes_limit, prune_at, prune_plan, prune_notified_at, last_quota_email_at FROM user_quota WHERE user_id = ?', + ), + upsertQuota: db.prepare(` + INSERT INTO user_quota (user_id, bytes_limit, prune_at, prune_plan, prune_notified_at, last_quota_email_at) + VALUES (?, ?, ?, ?, ?, ?) + ON CONFLICT(user_id) DO UPDATE SET + bytes_limit = excluded.bytes_limit, + prune_at = excluded.prune_at, + prune_plan = excluded.prune_plan, + prune_notified_at = excluded.prune_notified_at, + last_quota_email_at = excluded.last_quota_email_at + `), + photoIdsByEvent: db.prepare('SELECT id FROM photos WHERE event_id = ?'), + // Trashed photos are excluded everywhere a library total is shown: a photo in + // the trash is no longer part of the shoot, and its bytes are freed when the + // trash is emptied. + eventTotals: db.prepare(` + SELECT event_id, COUNT(*) AS n, COALESCE(SUM(json_extract(data, '$.size')), 0) AS bytes + FROM photos + WHERE json_extract(data, '$.deletedAt') IS NULL + GROUP BY event_id + `), + livePhotoCount: db.prepare( + "SELECT COUNT(*) AS n FROM photos WHERE json_extract(data, '$.deletedAt') IS NULL", + ), + livePhotoBytes: db.prepare(` + SELECT COALESCE(SUM(json_extract(data, '$.size')), 0) AS bytes + FROM photos WHERE json_extract(data, '$.deletedAt') IS NULL + `), + livePhotoBytesByOwner: db.prepare(` + SELECT COALESCE(SUM(json_extract(data, '$.size')), 0) AS bytes + FROM photos WHERE owner_id = ? AND json_extract(data, '$.deletedAt') IS NULL + `), + allQuotas: db.prepare('SELECT * FROM user_quota'), + + insertSession: db.prepare( + 'INSERT INTO sessions (token, user_id, created_at, expires_at) VALUES (?, ?, ?, ?)', + ), + findSession: db.prepare('SELECT * FROM sessions WHERE token = ?'), + deleteSession: db.prepare('DELETE FROM sessions WHERE token = ?'), + deleteUserSessions: db.prepare('DELETE FROM sessions WHERE user_id = ?'), + purgeSessions: db.prepare('DELETE FROM sessions WHERE expires_at < ?'), + + insertInvite: db.prepare(` + INSERT INTO invites (token, email, role, created_by, created_at, expires_at) + VALUES (?, ?, ?, ?, ?, ?) + `), + findInvite: db.prepare('SELECT * FROM invites WHERE token = ?'), + allInvites: db.prepare('SELECT * FROM invites ORDER BY created_at DESC LIMIT 100'), + revokeInvite: db.prepare( + 'UPDATE invites SET revoked_at = ? WHERE token = ? AND accepted_at IS NULL AND revoked_at IS NULL', + ), + acceptInvite: db.prepare(` + UPDATE invites SET accepted_at = ?, accepted_by = ? + WHERE token = ? AND accepted_at IS NULL AND revoked_at IS NULL AND expires_at > ? + `), + pendingInvites: db.prepare( + 'SELECT COUNT(*) AS n FROM invites WHERE accepted_at IS NULL AND revoked_at IS NULL AND expires_at > ?', + ), + + kvGet: db.prepare('SELECT value FROM kv WHERE key = ?'), + kvSet: db.prepare( + 'INSERT INTO kv (key, value) VALUES (?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value', + ), +}; + +function parse(json) { + if (!json) return null; + try { + return JSON.parse(json); + } catch { + return null; + } +} + +export function listEvents(ownerId = null) { + const rows = ownerId ? q.allEventsByOwner.all(ownerId) : q.allEvents.all(); + return rows.map((r) => parse(r.data)).filter((r) => r !== null); +} + +export function eventOwner(id) { + return q.eventOwner.get(id)?.owner_id ?? null; +} + +export function saveEvent(record, sortIndex = 0, ownerId = '') { + q.upsertEvent.run(record.id, ownerId, sortIndex, record.createdAt ?? Date.now(), JSON.stringify(record)); +} + +export function removeEvent(id) { + q.deleteEvent.run(id); +} + +export function shareTokenFor(id) { + return q.shareTokenFor.get(id)?.share_token ?? null; +} + +export function eventByShareToken(token) { + const row = q.eventByShare.get(token); + if (!row) return null; + const record = parse(row.data); + if (!record) return null; + return { id: row.id, ownerId: row.owner_id, event: record }; +} + +/** Sets or clears the event's token; revoking also drops the picks made with it. */ +export function setShareToken(id, token) { + const previous = shareTokenFor(id); + q.setShareToken.run(token, id); + if (token === null && previous) { + q.clearPicks.run(previous); + q.clearComments.run(previous); + q.clearReviews.run(previous); + } + return token; +} + +export function picksForToken(token) { + return q.picksByToken.all(token).map((row) => ({ + photoId: row.photo_id, + clientId: row.client_id, + clientName: row.client_name, + picked: Boolean(row.picked), + updatedAt: row.updated_at, + })); +} + +export function picksByOwner(ownerId) { + return q.picksByOwner.all(ownerId).map((row) => ({ + eventId: row.event_id, + photoId: row.photo_id, + clientId: row.client_id, + clientName: row.client_name, + picked: Boolean(row.picked), + updatedAt: row.updated_at, + })); +} + +export function galleryPick(token, photoId, clientId, clientName, picked) { + if (!picked) { + q.deletePick.run(token, photoId, clientId); + return; + } + q.upsertPick.run(token, photoId, clientId, clientName, Date.now()); +} + +export function commentsForToken(token) { + return q.commentsByToken.all(token).map((row) => ({ + id: row.id, + photoId: row.photo_id, + clientId: row.client_id, + clientName: row.client_name, + body: row.body, + createdAt: row.created_at, + })); +} + +export function commentsByOwner(ownerId) { + return q.commentsByOwner.all(ownerId).map((row) => ({ + eventId: row.event_id, + photoId: row.photo_id, + clientName: row.client_name, + body: row.body, + createdAt: row.created_at, + })); +} + +export function addGalleryComment({ id, token, photoId, clientId, clientName, body }) { + q.insertComment.run(id, token, photoId, clientId, clientName, body, Date.now()); +} + +export function reviewsForToken(token) { + return q.reviewsByToken.all(token).map((row) => ({ + photoId: row.photo_id, + clientId: row.client_id, + clientName: row.client_name, + status: row.status, + updatedAt: row.updated_at, + })); +} + +export function reviewsByOwner(ownerId) { + return q.reviewsByOwner.all(ownerId).map((row) => ({ + eventId: row.event_id, + photoId: row.photo_id, + clientName: row.client_name, + status: row.status, + updatedAt: row.updated_at, + })); +} + +export function setGalleryReview({ token, photoId, clientId, clientName, status }) { + if (!status || status === 'none') { + q.deleteReview.run(token, photoId, clientId); + return; + } + q.upsertReview.run(token, photoId, clientId, clientName, status, Date.now()); +} + +export function listPhotos(ownerId = null) { + const rows = ownerId ? q.allPhotosByOwner.all(ownerId) : q.allPhotos.all(); + return rows.map((r) => parse(r.data)).filter((r) => r !== null); +} + +export function getPhoto(id) { + const row = q.photo.get(id); + return row ? parse(row.data) : null; +} + +export function photoOwner(id) { + return q.photoOwner.get(id)?.owner_id ?? null; +} + +export function savePhoto(record, updatedAt = Date.now(), ownerId = '') { + q.upsertPhoto.run( + record.id, + ownerId, + record.eventId ?? '', + typeof record.order === 'number' ? record.order : 0, + updatedAt, + record.raw ? 1 : 0, + JSON.stringify(record), + ); +} + +export function removePhoto(id) { + q.deletePhoto.run(id); + // A permanently deleted photo must not keep client feedback alive anywhere. + q.deletePicksForPhoto.run(id); + q.deleteCommentsForPhoto.run(id); + q.deleteReviewsForPhoto.run(id); +} + +export function countPhotos() { + return Number(q.livePhotoCount.get()?.n ?? 0); +} + +/** Bytes of live photo records, excluding anything sitting in the trash. */ +export function livePhotoBytes() { + return Number(q.livePhotoBytes.get()?.bytes ?? 0); +} + +/** Bytes of an account's photos that are sitting in the trash. */ +export function deletedPhotoBytes(ownerId) { + return Number(q.deletedPhotoBytes.get(ownerId)?.bytes ?? 0); +} + +export function livePhotoBytesByOwner(ownerId) { + const row = q.livePhotoBytesByOwner.get(ownerId); + return Number(row?.bytes ?? 0); +} + +export function quotaRow(userId) { + return q.quotaForUser.get(userId) ?? null; +} + +export function saveQuota(userId, patch = {}) { + const row = quotaRow(userId); + q.upsertQuota.run( + userId, + patch.bytesLimit ?? row?.bytes_limit ?? 100 * 1024 * 1024 * 1024, + patch.pruneAt !== undefined ? patch.pruneAt : (row?.prune_at ?? null), + patch.prunePlan !== undefined + ? (patch.prunePlan === null ? null : JSON.stringify(patch.prunePlan)) + : (row?.prune_plan ?? null), + patch.pruneNotifiedAt !== undefined ? patch.pruneNotifiedAt : (row?.prune_notified_at ?? null), + patch.lastQuotaEmailAt !== undefined ? patch.lastQuotaEmailAt : (row?.last_quota_email_at ?? null), + ); + return quotaRow(userId); +} + +export function allQuotaRows() { + return q.allQuotas.all(); +} + +export const users = { + count: () => Number(q.userCount.get()?.n ?? 0), + byEmail: (email) => q.findUserByEmail.get(String(email).toLowerCase()), + byId: (id) => q.findUserById.get(id), + list: () => q.allUsers.all().map((row) => ({ ...row, disabled: Boolean(row.disabled) })), + activeAdmins: () => Number(q.activeAdmins.get()?.n ?? 0), + create: (user) => + q.insertUser.run(user.id, user.email.toLowerCase(), user.name, user.passHash, user.role, Date.now()), + update: (id, patch) => { + if (typeof patch.name === 'string') q.setUserName.run(patch.name, id); + if (typeof patch.role === 'string') q.setUserRole.run(patch.role, id); + if (typeof patch.disabled === 'boolean') q.setUserDisabled.run(patch.disabled ? 1 : 0, id); + if (typeof patch.passHash === 'string') q.setUserPassword.run(patch.passHash, id); + return q.findUserById.get(id); + }, + remove: (id) => q.deleteUser.run(id), + photoIdsByEvent: (eventId) => q.photoIdsByEvent.all(eventId).map((row) => row.id), + eventTotals: () => q.eventTotals.all(), +}; + +export const invites = { + create: ({ token, email, role, createdBy, expiresAt }) => + q.insertInvite.run(token, email, role, createdBy, Date.now(), expiresAt), + byToken: (token) => q.findInvite.get(token) ?? null, + all: () => q.allInvites.all(), + pendingCount: () => Number(q.pendingInvites.get(Date.now())?.n ?? 0), + revoke: (token) => q.revokeInvite.run(Date.now(), token).changes > 0, + accept: (token, userId) => q.acceptInvite.run(Date.now(), userId, token, Date.now()).changes > 0, +}; + +export const sessions = { + create: (token, userId, expiresAt) => q.insertSession.run(token, userId, Date.now(), expiresAt), + find: (token) => q.findSession.get(token), + destroy: (token) => q.deleteSession.run(token), + destroyForUser: (userId) => q.deleteUserSessions.run(userId), + purge: () => q.purgeSessions.run(Date.now()), +}; + +export const kv = { + get: (key) => { + const row = q.kvGet.get(key); + return row ? parse(row.value) : null; + }, + set: (key, value) => q.kvSet.run(key, JSON.stringify(value)), +}; diff --git a/server/denoise-worker.mjs b/server/denoise-worker.mjs new file mode 100644 index 0000000..c46bcd6 --- /dev/null +++ b/server/denoise-worker.mjs @@ -0,0 +1,62 @@ +/** + * Denoise one proxy. Runs in a worker thread: this is seconds of solid CPU and + * the request thread is also serving the rest of the library. + * + * The proxy is decoded rather than the raw file, deliberately -- these are the + * exact pixels the editor edits, so the result lines up with the canvas and with + * the client's export path. + */ +import { parentPort, workerData } from 'node:worker_threads'; +import fs from 'node:fs/promises'; +import sharp from 'sharp'; +import { denoiseRgb } from './denoise/rgbPipeline.ts'; +import { guidedDenoiser } from './denoise/standin.ts'; + +try { + const { sourcePath, outPath } = workerData; + const buffer = await fs.readFile(sourcePath); + const { data, info } = await sharp(buffer) + .rotate() + .toColourspace('srgb') + .removeAlpha() + .raw() + .toBuffer({ resolveWithObject: true }); + + const { width, height, channels } = info; + const rgb = new Uint8Array(width * height * 3); + if (channels === 3) { + rgb.set(data); + } else { + for (let i = 0; i < width * height; i++) { + const s = i * channels; + rgb[i * 3] = data[s]; + rgb[i * 3 + 1] = data[Math.min(s + 1, s + channels - 1)]; + rgb[i * 3 + 2] = data[Math.min(s + 2, s + channels - 1)]; + } + } + + const started = performance.now(); + // Always full strength: the Amount slider blends on the client, so one render + // serves every setting and the cache key does not move with the slider. + const out = await denoiseRgb({ rgb, width, height }, { amount: 1 }, guidedDenoiser()); + // 4:4:4 so the chroma work is not immediately thrown away by the encoder. + const jpeg = await sharp(Buffer.from(out.rgb), { raw: { width, height, channels: 3 } }) + .jpeg({ quality: 95, chromaSubsampling: '4:4:4' }) + .toBuffer(); + await fs.writeFile(outPath, jpeg); + + parentPort?.postMessage({ + type: 'done', + ms: Math.round(performance.now() - started), + bytes: jpeg.length, + stats: { + amount: out.stats.amount, + autoGate: out.stats.autoGate, + gate: out.stats.gateCoverage, + noise: out.stats.noise.global, + baseWidth: out.stats.baseWidth, + }, + }); +} catch (error) { + parentPort?.postMessage({ type: 'error', error: error?.message ?? String(error) }); +} diff --git a/server/denoise.mjs b/server/denoise.mjs new file mode 100644 index 0000000..e3a9e1f --- /dev/null +++ b/server/denoise.mjs @@ -0,0 +1,157 @@ +/** + * Job runner for the detail-preserving denoise. + * + * `server/denoise/` is a verbatim copy of the dependency-free pipeline from the + * raw-noise package. It reconstructs from a per-pixel crossfade between the + * source and a denoised base, so the result is bounded by the original pixels and + * cannot ring or overshoot; flat noise is replaced, structure is given back + * verbatim. The GPU's own `noise` sliders are a separate, much simpler path. + * + * Three things here are deliberate: + * + * - Amount belongs to the client. The worker always renders the full-strength + * denoise and the renderer applies the blend, so the slider is instant, one + * file serves every amount, and the amount cannot be applied twice. + * - The key carries a pipeline version. A change to `server/denoise/` has to + * re-key, or the old renders keep being served as if they were current. + * - Each run is seconds of solid CPU, so runs go through a capped queue and a + * second request for the same photo joins the run already in progress + * instead of starting an identical one. + */ +import crypto from 'node:crypto'; +import os from 'node:os'; +import { Worker } from 'node:worker_threads'; +import { denoisedPath, findDenoised, removeDenoised } from './storage.mjs'; + +/** Lookup used by the download route; storage owns where the files live. */ +export function findDenoisedFor(photoId, key) { + return findDenoised(photoId, key); +} + +/** Drop the renders for a photo, e.g. when its edit is cleared. */ +export function clearDenoised(photoId) { + return removeDenoised(photoId); +} + +/** + * Bump whenever the copied modules under `server/denoise/` change output. The key + * is the only thing between a fixed pipeline and a stale cached file. + */ +const PIPELINE_VERSION = 'guided-5'; + +const MAX_JOBS = 40; +/** + * A burst of clicks must not pin every core: the raw decoders have their own + * budget and the request thread still has the rest of the library to serve. + */ +const MAX_WORKERS = Math.max( + 1, + Math.min(4, Number(process.env.LUMINARY_DENOISE_WORKERS) || (os.cpus().length || 2) - 1), +); + +const jobs = new Map(); +/** key -> job that is queued or running, so a repeat request joins it. */ +const byKey = new Map(); +const queue = []; +let active = 0; + +export function getDenoiseJob(id) { + return jobs.get(id) ?? null; +} + +/** Stable for a photo and a pipeline version -- Amount is the client's business. */ +export function denoiseKey(photoId) { + return crypto + .createHash('sha1') + .update(`${photoId}|${PIPELINE_VERSION}`) + .digest('hex') + .slice(0, 12); +} + +export function startDenoise({ photoId, sourcePath }) { + const key = denoiseKey(photoId); + + const joined = byKey.get(key); + if (joined) return joined; + + const url = `/api/photos/${encodeURIComponent(photoId)}/denoised?v=${key}`; + const job = { id: crypto.randomUUID(), photoId, key, state: 'running', startedAt: Date.now() }; + + // Re-running after the edit was cleared, or a second browser, should not pay + // for the CPU again. The file is the cache; the job just reports it. + if (findDenoised(photoId, key)) { + job.state = 'done'; + job.cached = true; + job.url = url; + jobs.set(job.id, job); + pruneJobs(); + return job; + } + + job.sourcePath = sourcePath; + job.url = url; + jobs.set(job.id, job); + byKey.set(key, job); + queue.push(job); + pruneJobs(); + pump(); + return job; +} + +function pump() { + while (active < MAX_WORKERS && queue.length > 0) { + run(queue.shift()); + } +} + +function run(job) { + active += 1; + const outPath = denoisedPath(job.photoId, job.key); + const worker = new Worker(new URL('./denoise-worker.mjs', import.meta.url), { + workerData: { sourcePath: job.sourcePath, outPath }, + }); + + worker.on('message', (message) => { + if (message?.type === 'done') { + job.state = 'done'; + job.ms = message.ms; + job.bytes = message.bytes; + job.stats = message.stats; + // A version bump (or an older build) leaves its render behind; keep the + // current one and drop the rest so the folder cannot grow without bound. + try { + removeDenoised(job.photoId, job.key); + } catch { + /* cleanup is best effort -- never fail a finished job over it */ + } + } else if (message?.type === 'error') { + job.state = 'error'; + job.error = message.error; + } + }); + worker.on('error', (error) => { + job.state = 'error'; + job.error = error?.message ?? 'denoise worker failed'; + }); + worker.on('exit', () => { + // A crash inside the pipeline would otherwise leave the UI polling forever. + if (job.state === 'running') { + job.state = 'error'; + job.error = 'denoise worker exited unexpectedly'; + } + active -= 1; + byKey.delete(job.key); + job.sourcePath = null; + pump(); + }); +} + +/** Keep the newest finished jobs; never drop one that is queued or running. */ +function pruneJobs() { + if (jobs.size <= MAX_JOBS) return; + for (const [id, job] of jobs) { + if (jobs.size <= MAX_JOBS) break; + if (job.state === 'running') continue; + jobs.delete(id); + } +} diff --git a/server/denoise/color.ts b/server/denoise/color.ts new file mode 100644 index 0000000..4ae4fc5 --- /dev/null +++ b/server/denoise/color.ts @@ -0,0 +1,56 @@ +/** + * Interleaved RGB <-> luma/chroma, so luma and chroma can take different + * denoise paths. + * + * Chroma noise is low-frequency and the eye has little chroma acuity, so it is + * worth smoothing hard; luma carries all the detail and is the expensive, + * gated path. The transform is the standard sRGB-weighted one and round-trips + * to within rounding. + */ + +export interface RgbImage { + /** Interleaved 8-bit RGB, `width * height * 3` bytes. */ + rgb: Uint8Array; + width: number; + height: number; +} + +export interface YccPlanes { + y: Float32Array; + cb: Float32Array; + cr: Float32Array; +} + +export function toYcc(image: RgbImage): YccPlanes { + const { rgb, width, height } = image; + const n = width * height; + const y = new Float32Array(n); + const cb = new Float32Array(n); + const cr = new Float32Array(n); + for (let i = 0, p = 0; i < n; i++, p += 3) { + const r = rgb[p]; + const g = rgb[p + 1]; + const b = rgb[p + 2]; + y[i] = 0.299 * r + 0.587 * g + 0.114 * b; + cb[i] = 128 - 0.168736 * r - 0.331264 * g + 0.5 * b; + cr[i] = 128 + 0.5 * r - 0.418688 * g - 0.081312 * b; + } + return { y, cb, cr }; +} + +export function fromYcc(planes: YccPlanes, width: number, height: number): Uint8Array { + const n = width * height; + const out = new Uint8Array(n * 3); + for (let i = 0, p = 0; i < n; i++, p += 3) { + const y = planes.y[i]; + const cb = planes.cb[i] - 128; + const cr = planes.cr[i] - 128; + const r = y + 1.402 * cr; + const g = y - 0.344136 * cb - 0.714136 * cr; + const b = y + 1.772 * cb; + out[p] = r < 0 ? 0 : r > 255 ? 255 : r + 0.5; + out[p + 1] = g < 0 ? 0 : g > 255 ? 255 : g + 0.5; + out[p + 2] = b < 0 ? 0 : b > 255 ? 255 : b + 0.5; + } + return out; +} diff --git a/server/denoise/detail.ts b/server/denoise/detail.ts new file mode 100644 index 0000000..22aba5d --- /dev/null +++ b/server/denoise/detail.ts @@ -0,0 +1,253 @@ +/** + * Detail / structure separation. + * + * The whole feature rests on one idea: a denoiser may only remove things that + * do *not* look like structure. This module produces the map that decides + * that, from three cheap local measurements: + * + * 1. `detail` -- the high-frequency residual of an edge-preserving filter. + * 2. `sigma` -- the noise level expected at this luminance. + * 3. `coherence` -- how organised the local gradient is (a curve vs. grain). + * + * A pixel with detail well above the noise floor, or with a coherent edge + * through it, gets `gate -> 1` and its original values are restored verbatim + * after denoising. Flat grain gets `gate -> 0` and is replaced wholesale. + */ + +import { boxBlur, clamp, clamp01, resample, smoothstep } from './planes.ts'; + +/** + * Guided filter (He et al.), O(1) per pixel. + * + * Used instead of a bilateral filter because it needs no per-pixel search: + * four box passes, and the edge-preserving behaviour is exactly what the + * base/detail split needs. `eps` is a variance, so it is the noise sigma + * squared, scaled by how aggressively we want to smooth. + */ +export function guidedFilter( + src: Float32Array, + width: number, + height: number, + radius: number, + eps: number, +): Float32Array { + const a = boxBlur(src, width, height, radius); + const b = new Float32Array(src.length); + for (let i = 0; i < src.length; i++) b[i] = src[i] * src[i]; + boxBlur(b, width, height, radius, b); + + // b <- a (the guided-filter gain), a <- mean * (1 - gain). + const e = Math.max(eps, 1e-6); + for (let i = 0; i < src.length; i++) { + const mean = a[i]; + const variance = b[i] - mean * mean; + const gain = variance / (variance + e); + b[i] = gain; + a[i] = mean * (1 - gain); + } + + boxBlur(b, width, height, radius, b); + boxBlur(a, width, height, radius, a); + + const out = new Float32Array(src.length); + for (let i = 0; i < src.length; i++) out[i] = b[i] * src[i] + a[i]; + return out; +} + +export interface StructureMap { + /** 0 = isotropic (grain, flat), 1 = a clean line or edge. */ + data: Float32Array; + width: number; + height: number; +} + +/** + * Structure-tensor coherence, computed at reduced resolution. + * + * Coherence is a geometric property of edges and varies slowly across the + * frame, so measuring it at 1/`stride` and interpolating back is visually + * identical and ~`stride^2` cheaper in both time and memory. + */ +export function structureMap( + gray: Float32Array, + width: number, + height: number, + radius = 2, + stride = 2, + sigmaFloor = 1, +): StructureMap { + const sw = Math.max(2, Math.floor(width / stride)); + const sh = Math.max(2, Math.floor(height / stride)); + const small = resample(gray, width, height, sw, sh); + + const gx = new Float32Array(sw * sh); + const gy = new Float32Array(sw * sh); + for (let y = 0; y < sh; y++) { + const y0 = clamp(y - 1, 0, sh - 1) * sw; + const y1 = clamp(y + 1, 0, sh - 1) * sw; + const row = y * sw; + for (let x = 0; x < sw; x++) { + const x0 = clamp(x - 1, 0, sw - 1); + const x1 = clamp(x + 1, 0, sw - 1); + // Scharr kernels: better rotational symmetry than Sobel at this size. + gx[row + x] = + (3 * (small[y0 + x1] - small[y0 + x0]) + 10 * (small[row + x1] - small[row + x0]) + 3 * (small[y1 + x1] - small[y1 + x0])) / 16; + gy[row + x] = + (3 * (small[y1 + x0] - small[y0 + x0]) + 10 * (small[y1 + x] - small[y0 + x]) + 3 * (small[y1 + x1] - small[y0 + x1])) / 16; + } + } + + const jxx = new Float32Array(sw * sh); + const jyy = new Float32Array(sw * sh); + const jxy = new Float32Array(sw * sh); + for (let i = 0; i < gx.length; i++) { + jxx[i] = gx[i] * gx[i]; + jyy[i] = gy[i] * gy[i]; + jxy[i] = gx[i] * gy[i]; + } + boxBlur(jxx, sw, sh, radius, jxx); + boxBlur(jyy, sw, sh, radius, jyy); + boxBlur(jxy, sw, sh, radius, jxy); + + const data = new Float32Array(sw * sh); + const floor = sigmaFloor * sigmaFloor; + for (let i = 0; i < data.length; i++) { + const trace = jxx[i] + jyy[i]; + const disc = Math.sqrt(Math.max(0, (jxx[i] - jyy[i]) * (jxx[i] - jyy[i]) + 4 * jxy[i] * jxy[i])); + if (trace <= floor) continue; + data[i] = clamp01(disc / trace); + } + return { data, width: sw, height: sh }; +} + +/** + * Mean |detail| of pure Gaussian noise, relative to sigma. + * + * The statistic compared against the threshold is a mean absolute value over + * the 3x3-smoothed high-pass of a noise field, which measures ~1.0 sigma when + * the noise model is correct. Calibrated against a flat ISO 6400 sky, where + * |detail|/sigma had median 1.05. Expressing the ramp in these units puts 1.0 + * at "indistinguishable from grain" instead of at "one sigma", which is not + * the same thing at all. + */ +const NOISE_MAGNITUDE = 1.0; + +export interface GateOptions { + /** Below this multiple of the expected noise magnitude, detail is noise. */ + lo: number; + /** Above this multiple, detail is unambiguously signal. */ + hi: number; + /** + * How much an organised edge lowers the amplitude needed to open the gate. + * 1.0 means a perfectly coherent line needs half the contrast of grain to be + * believed; 0 disables the structure term entirely. + */ + coherenceBoost: number; + /** + * Isolated points have no coherence, so the structure term cannot save them + * and the 3x3 magnitude average below shrinks them toward the noise floor. A + * pixel that is the local maximum of |detail| and clears this many noise + * magnitudes on its own opens the gate anyway. + */ + pointLo: number; + /** Above this multiple, an isolated point is unambiguously real. */ + pointHi: number; +} + +// 1.0 measured on three D700 frames with synthetic sigma=6: fine-texture +// retention 48/52/24% -> 78/79/45% against 0 (no structure term), edge +// retention up, global grain unchanged. 1.5 reaches 97-98% but at 14% gate +// coverage it starts keeping the grain that sits on the texture, which is not +// separable at this scale anyway -- 1.0 is the knee. +// pointLo/Hi measured by injecting 1 px sources into a real ISO 6400 sky. The +// old gate kept 8% of a 5-sigma point's contrast and 44% of an 8-sigma one. +// +// The threshold looks high for a reason: the rule is a *local maximum*, and the +// max of nine correlated grain samples routinely reaches ~2 sigma, so 2.2 both +// protected grain and failed the corpus guard (grain 0.55 -> 1.36). 3.0 is the +// lowest value that leaves grain and chroma unchanged across the guarded corpus +// while keeping 5-sigma points (~0.9 of their contrast) and 8-sigma points +// (~1.0). A 3-sigma point stays smoothed -- at this scale it is not separable +// from the brightest grain beside it, and pretending otherwise costs the frame. +export const DEFAULT_GATE: GateOptions = { + lo: 1.15, + hi: 2.1, + coherenceBoost: 1.0, + pointLo: 3.0, + pointHi: 4.0, +}; + +/** + * Per-pixel "how much of this pixel is real" map, 0..1. + * *`detail` is the signed residual, `sigma` the expected noise at each pixel. + * The detail magnitude is box-smoothed so a single stray pixel cannot open the + * gate on its own, and `coherence` scales the amplitude required to open it. + * The one exception is an isolated peak large enough to be a point source: + * smoothing would erase exactly the detail (stars, specular pinpoints) this + * feature exists to keep, so local maxima get their own path. + */ +export function detailGate( + detail: Float32Array, + width: number, + height: number, + sigma: Float32Array, + coherence: Float32Array, + options: GateOptions = DEFAULT_GATE, +): Float32Array { + const magnitude = new Float32Array(detail.length); + for (let i = 0; i < detail.length; i++) magnitude[i] = detail[i] < 0 ? -detail[i] : detail[i]; + boxBlur(magnitude, width, height, 1, magnitude); + + const gate = new Float32Array(detail.length); + const pointOn = options.pointHi > 0 && options.pointHi > options.pointLo; + for (let i = 0; i < detail.length; i++) { + const s = sigma[i] < 0.05 ? 0.05 : sigma[i]; + // 1.0 means "exactly what a flat noisy patch measures", not "one sigma". + const ratio = magnitude[i] / (NOISE_MAGNITUDE * s); + // Coherence of pure noise measures ~0.49, so it cannot be applied linearly: + // that leaks ~0.12 of gate onto every grain pixel. Cubing it keeps ordinary + // noise at ~0.12 while a real edge (0.9) still reaches 0.73. + const organised = coherence[i] * coherence[i] * coherence[i]; + // Coherence *lowers the bar*, it does not add to the answer. Adding an + // independent term (the previous form) meant an organised line still had to + // clear the full amplitude threshold on its own, so low-contrast 2-3 px + // texture -- which is exactly what "detail soft" looks like -- got nothing. + // Scaling the ratio instead says: a line needs less contrast to be believed, + // which is the same claim the threshold makes about grain. + const belief = 1 + options.coherenceBoost * organised; + let g = smoothstep(options.lo, options.hi, ratio * belief); + + // Isolated-point path. The 3x3 average above shrinks a 1 px source toward + // the noise floor, so the crossfade replaced it with the softened base -- + // measured: a 5-sigma point kept 8%, an 8-sigma point 44%. The threshold sits + // above the local maximum grain reaches (see DEFAULT_GATE). Ties pass so a + // 2 px highlight is not lost to the comparison. + if (pointOn) { + const a = detail[i] < 0 ? -detail[i] : detail[i]; + const own = a / (NOISE_MAGNITUDE * s); + if (own > options.pointLo) { + const x = i % width; + const y = (i - x) / width; + if (x > 0 && y > 0 && x < width - 1 && y < height - 1) { + let peak = true; + for (let dy = -1; dy <= 1 && peak; dy++) { + for (let dx = -1; dx <= 1; dx++) { + if (dx === 0 && dy === 0) continue; + const n = detail[i + dy * width + dx]; + if ((n < 0 ? -n : n) > a) { + peak = false; + break; + } + } + } + if (peak) { + const opened = smoothstep(options.pointLo, options.pointHi, own); + if (opened > g) g = opened; + } + } + } + } + gate[i] = g; + } + return gate; +} diff --git a/server/denoise/noise.ts b/server/denoise/noise.ts new file mode 100644 index 0000000..cfae6fb --- /dev/null +++ b/server/denoise/noise.ts @@ -0,0 +1,176 @@ +/** + * Noise level estimation from a single finished image. + * + * The model is the Poisson-Gaussian one the rest of the pipeline assumes: + * + * var(luma) = shot * luma + read + * + * but measured in 8-bit sRGB units directly, because the thing we can actually + * see and measure is the finished proxy -- after demosaic, tone curve and JPEG. + * Fitting a sensor model and then pushing it through LibRaw's tone curve would + * be more principled and much less reliable. + * + * Two details make the estimate usable on real photographs: + * + * - The high-pass residual is taken over 16x16 blocks, and texture (which + * raises the local MAD) is kept out of the answer by a two-step statistic: + * a low quantile of the per-block sigmas sets the scale, blocks near it are + * kept, and the median of those is the estimate. See the comment at the + * computation for why neither statistic works alone. + * - A 3x3 box high-pass attenuates white noise by sqrt(8/9); that gain is + * divided back out, otherwise every sigma is 6% low. + */ + +import { boxBlur, clamp, quantile } from './planes.ts'; + +/** White-noise gain of `I - boxBlur(I, 1)`; sqrt(1 - 2/9 + 1/9). */ +const HP_NOISE_GAIN = Math.sqrt(8 / 9); +/** MAD -> sigma for a Gaussian. */ +const MAD_TO_SIGMA = 1 / 0.6745; +/** Below this, an 8-bit sRGB image has no measurable noise. */ +export const SIGMA_FLOOR = 0.35; + +export type NoiseTrend = 'fit' | 'flat'; + +export interface NoiseModel { + /** sigma = a + b * luma, 8-bit units. */ + a: number; + b: number; + /** Whether the luminance trend was trusted, or a flat floor was used. */ + trend: NoiseTrend; + /** Per-bin measurements that produced the fit (diagnostics). */ + bins: { luma: number; sigma: number; blocks: number }[]; + /** Robust global floor, ignoring the luminance trend. */ + global: number; + sigmaAt(luma: number): number; +} + +export function createNoiseModel( + a: number, + b: number, + global: number, + bins: NoiseModel['bins'], + trend: NoiseTrend = 'flat', +): NoiseModel { + return { + a, + b, + global, + trend, + bins, + sigmaAt(luma: number): number { + const s = a + b * clamp(luma, 0, 255); + return s < SIGMA_FLOOR ? SIGMA_FLOOR : s; + }, + }; +} + +export function estimateNoise(luma: Float32Array, width: number, height: number): NoiseModel { + const residual = boxBlur(luma, width, height, 1); + for (let i = 0; i < residual.length; i++) residual[i] = luma[i] - residual[i]; + + const BLOCK = 16; + const BINS = 16; + const perBin: number[][] = Array.from({ length: BINS }, () => []); + const all: number[] = []; + const scratch = new Float32Array(BLOCK * BLOCK); + + for (let by = 0; by + BLOCK <= height; by += BLOCK) { + for (let bx = 0; bx + BLOCK <= width; bx += BLOCK) { + let sumLuma = 0; + let n = 0; + for (let y = 0; y < BLOCK; y++) { + const row = (by + y) * width + bx; + for (let x = 0; x < BLOCK; x++) { + sumLuma += luma[row + x]; + const v = residual[row + x]; + scratch[n++] = v < 0 ? -v : v; + } + } + const meanLuma = sumLuma / n; + // Clipped highlights and crushed blacks have no usable noise statistic. + if (meanLuma < 6 || meanLuma > 249) continue; + + const sigma = quantile(scratch.subarray(0, n), 0.5) * MAD_TO_SIGMA / HP_NOISE_GAIN; + // A perfectly flat block measures exactly zero and must be *kept*: it is + // the strongest evidence of a clean frame. Dropping it left a frame that + // was half flat and half texture reported as uniformly noisy. + if (!Number.isFinite(sigma)) continue; + + all.push(sigma); + const bin = clamp(Math.floor(meanLuma / (256 / BINS)), 0, BINS - 1); + perBin[bin].push(sigma); + } + } + + if (all.length === 0) { + return createNoiseModel(SIGMA_FLOOR, 0, SIGMA_FLOOR, []); + } + + // Two steps, because either statistic alone fails on a real frame: + // + // - the *median* is accurate on a homogeneous field but reads texture as + // noise when more than half the frame is detailed (a brick wall, a striping + // shirt, half a test chart), which can push sigma 30x high; + // - a low quantile ignores texture but sits in the low tail of the + // estimator's own sampling noise. + // + // So: a low quantile sets the scale, blocks near it are kept, and the median + // of those is the answer. At ~10k blocks the quantile's bias is a few percent + // and the median removes it. + const floor = Math.max(SIGMA_FLOOR, quantile(all, 0.25)); + const cutoff = floor * 1.5; + const flatBlocks = all.filter((value) => value <= cutoff); + const global = Math.max(SIGMA_FLOOR, quantile(flatBlocks.length > 0 ? flatBlocks : all, 0.5)); + const bins: NoiseModel['bins'] = []; + for (let i = 0; i < BINS; i++) { + const flat = perBin[i].filter((v) => v <= cutoff); + if (flat.length < 5) continue; + bins.push({ + luma: (i + 0.5) * (256 / BINS), + sigma: quantile(flat, 0.5), + blocks: flat.length, + }); + } + + // A bin that is mostly texture reports texture, not noise: on a frame with a + // detailed foreground the low-luma bins can read several times the true + // floor. Fit only the bins that sit near the floor, then reject the whole + // trend if the resulting line leaves a physically plausible range. A flat + // sigma is a worse model than a good trend and a far better one than a bad + // trend, and this keeps the bad trend out. + const usable = bins.filter((bin) => bin.blocks >= 8 && bin.sigma <= global * 1.6); + if (usable.length >= 3) { + let sw = 0; + let sx = 0; + let sy = 0; + let sxx = 0; + let sxy = 0; + for (const bin of usable) { + const w = bin.blocks; + sw += w; + sx += w * bin.luma; + sy += w * bin.sigma; + sxx += w * bin.luma * bin.luma; + sxy += w * bin.luma * bin.sigma; + } + const det = sw * sxx - sx * sx; + if (Math.abs(det) > 1e-6) { + const b = (sw * sxy - sx * sy) / det; + const a = (sy - b * sx) / sw; + const low = a; + const high = a + b * 255; + const lo = global * 0.5; + const hi = global * 2.5; + if ( + Number.isFinite(a) && + Number.isFinite(b) && + low >= lo && low <= hi && + high >= lo && high <= hi + ) { + return createNoiseModel(a, b, global, bins, 'fit'); + } + } + } + return createNoiseModel(global, 0, global, bins); +} diff --git a/server/denoise/planes.ts b/server/denoise/planes.ts new file mode 100644 index 0000000..701a4e9 --- /dev/null +++ b/server/denoise/planes.ts @@ -0,0 +1,179 @@ +/** + * Scalar float planes plus the resampling and box-filter primitives the + * detail-preserving denoise is built from. + * + * Everything here is plain `Float32Array` arithmetic with no allocation in the + * hot loops: the full-resolution stage runs at proxy size (up to 24 MP), and + * allocation churn is the difference between two seconds and six per photo. + */ + +export interface Plane { + data: Float32Array; + width: number; + height: number; +} + +export function createPlane(width: number, height: number): Plane { + return { data: new Float32Array(width * height), width, height }; +} + +export function clamp01(v: number): number { + return v < 0 ? 0 : v > 1 ? 1 : v; +} + +export function clamp(v: number, lo: number, hi: number): number { + return v < lo ? lo : v > hi ? hi : v; +} + +/** Hermite ramp: 0 below `lo`, 1 above `hi`. */ +export function smoothstep(lo: number, hi: number, x: number): number { + if (hi <= lo) return x >= hi ? 1 : 0; + const t = clamp01((x - lo) / (hi - lo)); + return t * t * (3 - 2 * t); +} + +function edge(i: number, n: number): number { + return i < 0 ? 0 : i >= n ? n - 1 : i; +} + +/** + * Scratch buffer for the separable passes, grown on demand. + * + * Safe because `boxBlur` is not reentrant: every caller finishes with the + * buffer before making another call, and the buffer is never handed out. + */ +let scratchBuffer: Float32Array | null = null; + +function scratch(length: number): Float32Array { + if (!scratchBuffer || scratchBuffer.length < length) scratchBuffer = new Float32Array(length); + return scratchBuffer.subarray(0, length); +} + +/** + * Separable box blur with clamped edges, O(1) per pixel. + * + * `out` may alias `src`: the horizontal pass goes through the shared scratch + * buffer, and only the vertical pass writes `out`, so an in-place call is + * safe. That aliasing is what keeps the guided filter allocation-light. + */ +export function boxBlur( + src: Float32Array, + width: number, + height: number, + radius: number, + out?: Float32Array, +): Float32Array { + const dst = out ?? new Float32Array(src.length); + if (src.length < width * height) { + throw new Error(`plane is ${src.length} values, expected ${width * height}`); + } + if (radius <= 0) { + if (dst !== src) dst.set(src); + return dst; + } + const tmp = scratch(width * height); + const norm = 1 / (2 * radius + 1); + + // Horizontal pass: src -> tmp. + for (let y = 0; y < height; y++) { + const row = y * width; + let sum = 0; + for (let x = -radius; x <= radius; x++) sum += src[row + edge(x, width)]; + for (let x = 0; x < width; x++) { + tmp[row + x] = sum * norm; + sum += src[row + edge(x + radius + 1, width)] - src[row + edge(x - radius, width)]; + } + } + + // Vertical pass: tmp -> dst. + for (let x = 0; x < width; x++) { + let sum = 0; + for (let y = -radius; y <= radius; y++) sum += tmp[edge(y, height) * width + x]; + for (let y = 0; y < height; y++) { + dst[y * width + x] = sum * norm; + sum += + tmp[edge(y + radius + 1, height) * width + x] - + tmp[edge(y - radius, height) * width + x]; + } + } + return dst; +} + +/** + * Bilinear resample. Used for the two-scale split: luma is reduced to the + * inference size, denoised, then brought back up so full-resolution detail can + * be re-injected on top. + */ +export function resample( + src: Float32Array, + sw: number, + sh: number, + dw: number, + dh: number, +): Float32Array { + if (sw === dw && sh === dh) return src.slice(); + const out = new Float32Array(dw * dh); + const xRatio = sw / dw; + const yRatio = sh / dh; + for (let y = 0; y < dh; y++) { + // Sample at pixel centres so a downscale is a centred box, not a shifted one. + const sy = clamp((y + 0.5) * yRatio - 0.5, 0, sh - 1); + const y0 = Math.floor(sy); + const y1 = Math.min(y0 + 1, sh - 1); + const wy = sy - y0; + for (let x = 0; x < dw; x++) { + const sx = clamp((x + 0.5) * xRatio - 0.5, 0, sw - 1); + const x0 = Math.floor(sx); + const x1 = Math.min(x0 + 1, sw - 1); + const wx = sx - x0; + const top = src[y0 * sw + x0] * (1 - wx) + src[y0 * sw + x1] * wx; + const bot = src[y1 * sw + x0] * (1 - wx) + src[y1 * sw + x1] * wx; + out[y * dw + x] = top * (1 - wy) + bot * wy; + } + } + return out; +} + +/** + * O(n) percentile for large non-negative arrays, by histogram. + * + * `quantile` sorts, which is correct and fine for a 256-value block but ruinous + * for an 18 MP plane: two sorts there cost 11.5 s against a 6.6 s denoise. Bins + * over [0, max] return a median accurate to ~0.2 on 8-bit data, far inside the + * noise being measured. + * + * `values` must be non-negative (magnitudes, gradients, residuals). + */ +export function fastPercentile(values: Float32Array, q: number, bins = 1024): number { + const n = values.length; + if (n === 0) return 0; + let max = 0; + for (let i = 0; i < n; i++) { + const v = values[i]; + if (v > max) max = v; + } + if (!(max > 0)) return 0; + + const hist = new Uint32Array(bins); + const scale = (bins - 1) / max; + for (let i = 0; i < n; i++) hist[(values[i] * scale) | 0]++; + + const target = clamp(q, 0, 1) * (n - 1); + let seen = 0; + for (let b = 0; b < bins; b++) { + seen += hist[b]; + if (seen > target) return b / scale; + } + return max; +} + +/** Linear-interpolated quantile of a copy of `values`. `q` is 0..1. */ +export function quantile(values: Float32Array | number[], q: number): number { + const n = values.length; + if (n === 0) return 0; + const sorted = Float32Array.from(values as ArrayLike).sort(); + const pos = clamp(q, 0, 1) * (n - 1); + const lo = Math.floor(pos); + const hi = Math.min(lo + 1, n - 1); + return sorted[lo] + (sorted[hi] - sorted[lo]) * (pos - lo); +} diff --git a/server/denoise/rgbPipeline.ts b/server/denoise/rgbPipeline.ts new file mode 100644 index 0000000..e67ebe8 --- /dev/null +++ b/server/denoise/rgbPipeline.ts @@ -0,0 +1,349 @@ +/** + * The RGB proxy denoise pipeline: two scales, one gate. + * + * proxy -> YCbCr + * -> base: downscale RGB, run `runBase`, upscale + * -> luma: low-pass at the detail scale, gate per pixel + * -> reconstruct: crossfade luma to the base where the gate is closed, + * and take chroma from the base outright + * + * `runBase` is the only thing that knows how to denoise. Today it is a guided + * filter or NLM; when the ONNX session lands it is a tiled model runner and + * nothing else in this file changes. That is the seam the build plan is built + * around, and it is RGB so a colour-trained model is fed what it expects. + * + * The reconstruction invariant: output luma is a per-pixel crossfade between + * the untouched input (gate 1) and the denoised base (gate 0). It is bounded by + * its two inputs, so it cannot ring or overshoot, and where the gate opens the + * pixels are identical to the original. + */ + +import { fromYcc, toYcc, type RgbImage } from './color.ts'; +import { + DEFAULT_GATE, + detailGate, + structureMap, + type GateOptions, +} from './detail.ts'; +import { estimateNoise, type NoiseModel } from './noise.ts'; +import { boxBlur, clamp01, clamp, resample, smoothstep } from './planes.ts'; +import type { BaseDenoiser, BaseImage } from './standin.ts'; + +export type DenoiserName = 'guided' | 'nlm' | 'onnx'; + +export interface DenoiseOptions { + /** 0..1 blend against the input, applied after reconstruction. */ + amount: number; + /** + * Long edge of the plane the base denoiser runs on. + * + * Raising this on extreme-ISO frames looks like a free win on a detail metric + * (+0.07 retention at 3200 on 18 MP ISO 6400) but was rejected: the corpus + * guard measured grain 0.52 -> 1.30 and chroma 0.50 -> 1.20 at 3200. A sharper + * base is not more detail, it is grain the crossfade then has to keep. + */ + baseEdge: number; + /** Scale below which content is treated as detail worth protecting. */ + detailRadius: number; + /** + * Radius of the second, coarser detail band. 0 disables it. + * + * The fine band (radius 2) is what the original gate judged, and it leaves + * near-isotropic 3-8 px texture unread: the texture that survives is the + * part that happens to be coherent at 2 px. The coarse band is the difference + * of two low-passes, so it sees that scale while rejecting both gradients and + * pixel-scale grain -- measured in docs/PLAN.md. + */ + coarseRadius: number; + /** Coarse-band thresholds, in fine-band noise units. */ + coarseLo: number; + coarseHi: number; + /** + * Below this measured global grain the frame is clean and the pipeline tapers + * itself to an identity. Without it a base-ISO file loses real micro-texture + * to a denoise it never needed: measured at 36% of high-frequency energy on a + * clean ISO 100 D700 frame. + */ + cleanSigma: number; + gate: GateOptions; +} + +export const DEFAULT_OPTIONS: DenoiseOptions = { + amount: 1, + baseEdge: 1600, + detailRadius: 2, + coarseRadius: 6, + coarseLo: 1.2, + coarseHi: 2.0, + cleanSigma: 2.5, + gate: DEFAULT_GATE, +}; + +export interface StageTimings { + noise: number; + base: number; + detail: number; + coarse: number; + structure: number; + reconstruct: number; + total: number; +} + +export interface DenoiseStats { + width: number; + height: number; + baseWidth: number; + baseHeight: number; + /** How much the base plane was reduced, e.g. 3.25 for a 6000px proxy. */ + backscale: number; + amount: number; + noise: { a: number; b: number; trend: 'fit' | 'flat'; global: number; atMid: number }; + /** Mean gate value: the share of the frame given back as structure. */ + gateCoverage: number; + /** How much of the requested amount survived the clean-image taper (0..1). */ + autoGate: number; + timings: StageTimings; +} + +export interface DenoiseOutput { + rgb: Uint8Array; + /** Luma of the denoised base, before detail re-injection, for inspection. */ + base: { data: Float32Array; width: number; height: number }; + stats: DenoiseStats; +} + +const now = () => performance.now(); + +/** + * Prefiltered decimation of interleaved RGB to the base plane. + * + * The prefilter is load-bearing, and the coarse gate is what exposed it. A bare + * bilinear tap reads four of every ~42 source pixels at `backscale` 3.25, so + * pixel-scale grain is aliased into the base and comes back wherever the gate + * is closed. Measured on the three mid-ISO frames at sigma 6, with the coarse + * band on: grain 0.32/0.20/0.35 with bilinear against 0.22/0.20/0.22 with the + * box prefilter, for 1.9% less high-frequency energy. The gate protects detail + * and cannot protect grain out of an aliased base, so this belongs in the + * decimator rather than in a threshold. + * + * One channel at a time through the tested `resample`, so the peak extra memory + * is a single full-resolution plane, not three. + */ +function resampleRgb( + image: RgbImage, + width: number, + height: number, + prefilterRadius: number, +): BaseImage { + const out = new Float32Array(width * height * 3); + const src = new Float32Array(image.width * image.height); + for (let k = 0; k < 3; k++) { + for (let i = 0, p = k; i < src.length; i++, p += 3) src[i] = image.rgb[p]; + if (prefilterRadius > 0) boxBlur(src, image.width, image.height, prefilterRadius, src); + const small = resample(src, image.width, image.height, width, height); + for (let i = 0, p = k; i < small.length; i++, p += 3) out[p] = small[i]; + } + return { rgb: out, width, height }; +} + +/** + * Bilinear upscale of the base to full resolution, quantised to 8 bits so the + * tested `toYcc` can be reused rather than duplicating the colour maths here. + */ +function upsampleBase(base: BaseImage, width: number, height: number): RgbImage { + const rgb = new Uint8Array(width * height * 3); + const xRatio = base.width / width; + const yRatio = base.height / height; + for (let y = 0; y < height; y++) { + const sy = clamp((y + 0.5) * yRatio - 0.5, 0, base.height - 1); + const y0 = Math.floor(sy); + const y1 = Math.min(y0 + 1, base.height - 1); + const wy = sy - y0; + for (let x = 0; x < width; x++) { + const sx = clamp((x + 0.5) * xRatio - 0.5, 0, base.width - 1); + const x0 = Math.floor(sx); + const x1 = Math.min(x0 + 1, base.width - 1); + const wx = sx - x0; + const a = (y0 * base.width + x0) * 3; + const b = (y0 * base.width + x1) * 3; + const c = (y1 * base.width + x0) * 3; + const d = (y1 * base.width + x1) * 3; + const o = (y * width + x) * 3; + for (let k = 0; k < 3; k++) { + const top = base.rgb[a + k] * (1 - wx) + base.rgb[b + k] * wx; + const bot = base.rgb[c + k] * (1 - wx) + base.rgb[d + k] * wx; + const v = top * (1 - wy) + bot * wy; + rgb[o + k] = v < 0 ? 0 : v > 255 ? 255 : v + 0.5; + } + } + } + return { rgb, width, height }; +} + +export async function denoiseRgb( + image: RgbImage, + options: Partial, + runBase: BaseDenoiser, +): Promise { + const opts: DenoiseOptions = { ...DEFAULT_OPTIONS, ...options, gate: { ...DEFAULT_GATE, ...options.gate } }; + const started = now(); + const { width, height } = image; + const pixels = width * height; + + const { y, cb, cr } = toYcc(image); + + let mark = now(); + const noise: NoiseModel = estimateNoise(y, width, height); + const timings: StageTimings = { + noise: now() - mark, + base: 0, + detail: 0, + coarse: 0, + structure: 0, + reconstruct: 0, + total: 0, + }; + + // --- base: the inference scale ------------------------------------------- + const longEdge = Math.max(width, height); + const scale = opts.baseEdge > 0 ? Math.min(1, opts.baseEdge / longEdge) : 1; + const baseWidth = Math.max(8, Math.round(width * scale)); + const baseHeight = Math.max(8, Math.round(height * scale)); + const backscale = width / baseWidth; + + mark = now(); + const prefilterRadius = backscale > 1.001 ? Math.max(0, Math.round((backscale - 1) / 2)) : 0; + const baseInput = resampleRgb(image, baseWidth, baseHeight, prefilterRadius); + // What the base denoiser is told about the noise it will see. + // + // The decimator is box(W) followed by the two bilinear taps. Along one axis + // the taps overlap in W-1 samples at weight 1/W each and contribute + // (1-t)^2 + t^2 at the two ends, which averages 2/3 over t, so the per-axis + // *variance* gain is (W - 1/3) / W^2. Both axes are equal, so the standard + // deviation falls by the same factor squared, i.e. by that number again: + // 0.296 at W=3 against 1/backscale = 0.373. + // + // The old `/ backscale` was a guess -- and with bare bilinear (W=1) the true + // figure is 2/3, which is why it read ~2x low. The classical stand-ins never + // noticed (`planeSigma` re-measures each plane), but a model consumes this as + // a prior, so it has to describe the filter that actually ran. + const prefilterWidth = 2 * prefilterRadius + 1; + const decimatedSigma = + backscale > 1.001 ? (prefilterWidth - 1 / 3) / (prefilterWidth * prefilterWidth) : 1; + const baseSigma = noise.sigmaAt(110) * decimatedSigma; + const baseOut = await runBase(baseInput, baseSigma); + const baseUp = toYcc(upsampleBase(baseOut, width, height)); + timings.base = now() - mark; + + // --- detail gate at full resolution -------------------------------------- + // + // The split filter is a plain low-pass, deliberately, and not an + // edge-preserving one. An edge-aware filter follows strong edges, which + // leaves them in the low band; the base cannot represent them after the + // downscale, and nothing would put them back -- measured as 41% of edge + // contrast lost. A low-pass pushes edges into `detail`, where the gate sees + // them as signal. + mark = now(); + const smooth = boxBlur(y, width, height, opts.detailRadius); + const detail = new Float32Array(pixels); + for (let i = 0; i < pixels; i++) detail[i] = y[i] - smooth[i]; + timings.detail = now() - mark; + + mark = now(); + // The tensor is measured on the *original* luma, not on `smooth`. + // + // `smooth` is the same 5x5 low-pass that defines the detail band, so 2-3 px + // texture has already been attenuated by the time the tensor sees it: the + // gate was judging fine texture with a measurement that could not see it, and + // coverage on a texture-rich frame came out *lower* than on a smooth one + // (3.8% vs 9.3%). `structureMap` resamples to half resolution first, which + // halves the noise while leaving 2 px structure intact, so this reads the + // scale it is being asked about. + const structure = structureMap(y, width, height, 2, 2, noise.global); + const coherence = resample(structure.data, structure.width, structure.height, width, height); + const sigmaMap = new Float32Array(pixels); + for (let i = 0; i < pixels; i++) sigmaMap[i] = noise.sigmaAt(smooth[i]); + timings.structure = now() - mark; + + mark = now(); + let gate = detailGate(detail, width, height, sigmaMap, coherence, opts.gate); + + // Second, coarser band: `smooth2 - smooth6` is a band-pass around 3-8 px. It + // rejects gradients (both low-passes follow them) and pixel-scale grain (both + // average it), so it can open on texture that the fine band reads as noise + // without opening on flat noisy sky. The isolated-point path is a fine-band + // instrument and is deliberately disabled here. + if (opts.coarseRadius > opts.detailRadius && opts.coarseHi > opts.coarseLo) { + const coarseSmooth = boxBlur(y, width, height, opts.coarseRadius); + const coarse = new Float32Array(pixels); + for (let i = 0; i < pixels; i++) coarse[i] = smooth[i] - coarseSmooth[i]; + const coarseGate = detailGate(coarse, width, height, sigmaMap, coherence, { + ...opts.gate, + lo: opts.coarseLo, + hi: opts.coarseHi, + pointHi: 0, + }); + for (let i = 0; i < pixels; i++) if (coarseGate[i] > gate[i]) gate[i] = coarseGate[i]; + timings.coarse = now() - mark; + } + + // Clean frames get their amount tapered to nothing: 0.8 sigma of measured + // grain is quantisation, 2.5 is a genuinely noisy file. + const autoGate = opts.cleanSigma > 0 ? smoothstep(0.8, opts.cleanSigma, noise.global) : 1; + const amount = clamp01(opts.amount) * autoGate; + + const outY = new Float32Array(pixels); + const outCb = new Float32Array(pixels); + const outCr = new Float32Array(pixels); + let gateSum = 0; + for (let i = 0; i < pixels; i++) { + gateSum += gate[i]; + // Crossfade, never additive re-injection: additive detail lands on top of a + // base that already contains a softened copy of the same edge and overshoots + // by ~40%. A crossfade is bounded by its two inputs, so it cannot ring, and + // where the gate opens the pixels are bit-identical to the original. + outY[i] = y[i] + amount * (1 - gate[i]) * (baseUp.y[i] - y[i]); + // Chroma follows the same gate, for a different reason than luma does. The + // base carries chroma upsampled from `backscale` times smaller, so replacing + // it outright smears colour across every sharp edge: on a small aircraft + // against bright sky that is a magenta fringe along the wing and red/white + // paint that loses its boundary. Keeping the original chroma where the gate + // says "structure" keeps the paint edge registered with the luma edge it + // belongs to. Flat areas still take the base chroma, which is where the + // chroma noise lives. + outCb[i] = cb[i] + amount * (1 - gate[i]) * (baseUp.cb[i] - cb[i]); + outCr[i] = cr[i] + amount * (1 - gate[i]) * (baseUp.cr[i] - cr[i]); + } + + const rgb = fromYcc({ y: outY, cb: outCb, cr: outCr }, width, height); + timings.reconstruct = now() - mark; + timings.total = now() - started; + + const baseLuma = new Float32Array(baseWidth * baseHeight); + for (let i = 0, p = 0; i < baseLuma.length; i++, p += 3) { + baseLuma[i] = 0.299 * baseOut.rgb[p] + 0.587 * baseOut.rgb[p + 1] + 0.114 * baseOut.rgb[p + 2]; + } + + return { + rgb, + base: { data: baseLuma, width: baseWidth, height: baseHeight }, + stats: { + width, + height, + baseWidth, + baseHeight, + backscale, + amount, + noise: { + a: noise.a, + b: noise.b, + trend: noise.trend, + global: noise.global, + atMid: noise.sigmaAt(110), + }, + gateCoverage: gateSum / pixels, + autoGate, + timings, + }, + }; +} diff --git a/server/denoise/standin.ts b/server/denoise/standin.ts new file mode 100644 index 0000000..1916936 --- /dev/null +++ b/server/denoise/standin.ts @@ -0,0 +1,166 @@ +/** + * Stand-in denoisers for the reduced-resolution base. + * + * These occupy exactly the slot the ONNX model occupies: take an interleaved + * RGB plane at inference scale plus the noise level there, return a denoised + * plane of the same shape. Having credible classical implementations in that + * slot is what lets the pipeline, the harness and the baselines be finished and + * measured before a model exists -- and they are the numbers the model has to + * beat. + * + * The seam is RGB, not luma, deliberately: a denoiser trained on colour images + * fed a replicated greyscale plane is out of distribution and underperforms a + * plain guided filter. Chroma also comes from this plane, so the model gets a + * say in colour noise, which is the part users actually complain about. + * + * `nlm` is the honest reference. `guided` is fast enough to iterate against. + */ + +import { guidedFilter } from './detail.ts'; +import { boxBlur } from './planes.ts'; + +export interface BaseImage { + /** Interleaved RGB, `width * height * 3`, 0..255. */ + rgb: Float32Array; + width: number; + height: number; +} + +/** + * Synchronous for the classical stand-ins, a promise for a model session. + * ONNX inference cannot be made synchronous, so the seam allows both and the + * pipeline awaits the result. + */ +export type BaseDenoiser = (image: BaseImage, sigma: number) => BaseImage | Promise; + +export function deinterleave(image: BaseImage): [Float32Array, Float32Array, Float32Array] { + const n = image.width * image.height; + const r = new Float32Array(n); + const g = new Float32Array(n); + const b = new Float32Array(n); + for (let i = 0, p = 0; i < n; i++, p += 3) { + r[i] = image.rgb[p]; + g[i] = image.rgb[p + 1]; + b[i] = image.rgb[p + 2]; + } + return [r, g, b]; +} + +export function interleave( + r: Float32Array, + g: Float32Array, + b: Float32Array, + width: number, + height: number, +): BaseImage { + const rgb = new Float32Array(width * height * 3); + for (let i = 0, p = 0; i < r.length; i++, p += 3) { + rgb[p] = r[i]; + rgb[p + 1] = g[i]; + rgb[p + 2] = b[i]; + } + return { rgb, width, height }; +} + +/** + * Robust sigma of one plane, from its own 3x3 high-pass. + * + * The caller's `sigma` is a luma figure, and per-channel noise differs a lot on + * a CFA sensor -- blue is the noisiest -- so filtering all three at the luma + * level over-smooths one channel and under-smooths another. Measuring each + * plane costs three cheap passes at base scale and removes the guesswork. + */ +function planeSigma(plane: Float32Array, width: number, height: number, fallback: number): number { + const smooth = boxBlur(plane, width, height, 1); + const residual = new Float32Array(plane.length); + for (let i = 0; i < plane.length; i++) residual[i] = Math.abs(plane[i] - smooth[i]); + const sorted = residual.sort(); + const median = sorted[sorted.length >> 1] ?? 0; + const sigma = (median * 1.4826) / 0.943; + return sigma > 0.5 ? sigma : Math.max(1, fallback); +} + +/** Guided filter per channel: cheap, edge-preserving, mildly waxy. */ +export function guidedDenoiser(radius = 3, strength = 2.6): BaseDenoiser { + return (image, sigma) => { + const [r, g, b] = deinterleave(image); + const filter = (plane: Float32Array) => { + const s = planeSigma(plane, image.width, image.height, sigma); + return guidedFilter(plane, image.width, image.height, radius, (strength * s) ** 2); + }; + return interleave(filter(r), filter(g), filter(b), image.width, image.height); + }; +} + +/** + * Non-local means, per channel. Slow, and deliberately so: it is the quality + * reference the neural model must beat, not a shipping path. + */ +export function nlmDenoiser(search = 2, patch = 1): BaseDenoiser { + const patchW = 2 * patch + 1; + const patchArea = patchW * patchW; + return (image) => { + const [r, g, b] = deinterleave(image); + const planes = [r, g, b].map( + (plane) => nlmPlane(plane, image.width, image.height, search, patch, patchW, patchArea), + ); + return interleave(planes[0], planes[1], planes[2], image.width, image.height); + }; +} + +function nlmPlane( + plane: Float32Array, + width: number, + height: number, + search: number, + patch: number, + patchW: number, + patchArea: number, +): Float32Array { + const out = new Float32Array(plane.length); + const s = Math.max(1, search | 0); + const clampX = (v: number) => (v < 0 ? 0 : v >= width ? width - 1 : v); + const clampY = (v: number) => (v < 0 ? 0 : v >= height ? height - 1 : v); + + let sumSq = 0; + let count = 0; + for (let i = 0; i < plane.length; i += 7) { + sumSq += plane[i] * plane[i]; + count++; + } + const h = Math.max(2, Math.sqrt(sumSq / Math.max(1, count)) * 0.18); + const cutoff = 4 * h * h; + + for (let y = 0; y < height; y++) { + for (let x = 0; x < width; x++) { + const centre = plane[y * width + x]; + let acc = 0; + let weight = 0; + for (let dy = -s; dy <= s; dy++) { + for (let dx = -s; dx <= s; dx++) { + if (dx === 0 && dy === 0) continue; + const ny = y + dy; + const nx = x + dx; + if (ny < 0 || ny >= height || nx < 0 || nx >= width) continue; + + let dist = 0; + for (let py = -patch; py <= patch; py++) { + const ay = clampY(y + py) * width; + const by = clampY(ny + py) * width; + for (let px = -patch; px <= patch; px++) { + const d = plane[ay + clampX(x + px)] - plane[by + clampX(nx + px)]; + dist += d * d; + } + } + dist /= patchArea; + if (dist > cutoff) continue; + const w = Math.exp(-dist / (h * h)); + acc += w * plane[ny * width + nx]; + weight += w; + } + } + out[y * width + x] = (acc + centre) / (weight + 1); + } + } + return out; +} diff --git a/server/imaging.mjs b/server/imaging.mjs new file mode 100644 index 0000000..eacb214 --- /dev/null +++ b/server/imaging.mjs @@ -0,0 +1,129 @@ +import zlib from 'node:zlib'; +import { RAW_PREVIEW_EDGE } from './config.mjs'; + +let sharpModule = null; +let sharpFailed = false; + +/** sharp gives us JPEG encoding and resizing; without it we fall back to PNG. */ +export async function loadSharp() { + if (sharpModule) return sharpModule; + if (sharpFailed) return null; + try { + const mod = await import('sharp'); + sharpModule = mod.default; + return sharpModule; + } catch { + sharpFailed = true; + return null; + } +} + +const CRC_TABLE = (() => { + const table = new Int32Array(256); + for (let n = 0; n < 256; n++) { + let c = n; + for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1; + table[n] = c; + } + return table; +})(); + +function crc32(buf) { + let c = 0xffffffff; + for (let i = 0; i < buf.length; i++) c = CRC_TABLE[(c ^ buf[i]) & 0xff] ^ (c >>> 8); + return (c ^ 0xffffffff) >>> 0; +} + +function chunk(type, data) { + const out = Buffer.alloc(8 + data.length + 4); + out.writeUInt32BE(data.length, 0); + out.write(type, 4, 'ascii'); + data.copy(out, 8); + out.writeUInt32BE(crc32(Buffer.concat([Buffer.from(type, 'ascii'), data])), 8 + data.length); + return out; +} + +/** Minimal dependency-free 8-bit RGB PNG encoder (used only when sharp is absent). */ +export function encodePng(rgb, width, height) { + const stride = width * 3; + const raw = Buffer.alloc((stride + 1) * height); + for (let y = 0; y < height; y++) { + raw[y * (stride + 1)] = 0; + Buffer.from(rgb.buffer, rgb.byteOffset + y * stride, stride).copy(raw, y * (stride + 1) + 1); + } + const idat = zlib.deflateSync(raw, { level: 6 }); + const ihdr = Buffer.alloc(13); + ihdr.writeUInt32BE(width, 0); + ihdr.writeUInt32BE(height, 4); + ihdr[8] = 8; + ihdr[9] = 2; + ihdr[10] = 0; + ihdr[11] = 0; + ihdr[12] = 0; + return Buffer.concat([ + Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]), + chunk('IHDR', ihdr), + chunk('IDAT', idat), + chunk('IEND', Buffer.alloc(0)), + ]); +} + +/** Encode an interleaved RGB byte buffer as JPEG (sharp) or PNG (fallback). */ +export async function encodeRgb(rgb, width, height, quality = 92, maxEdge = 0) { + const sharp = await loadSharp(); + if (!sharp) { + return { data: encodePng(rgb, width, height), ext: 'png', width, height }; + } + let img = sharp(Buffer.from(rgb.buffer, rgb.byteOffset, rgb.byteLength), { + raw: { width, height, channels: 3 }, + }); + if (maxEdge > 0 && Math.max(width, height) > maxEdge) img = img.resize({ width: width >= height ? maxEdge : null, height: height > width ? maxEdge : null, fit: 'inside' }); + const data = await img.jpeg({ quality, chromaSubsampling: '4:4:4' }).toBuffer(); + const meta = await sharp(data).metadata(); + return { data, ext: 'jpg', width: Number(meta.width ?? width), height: Number(meta.height ?? height) }; +} + +export async function jpegInfo(buffer) { + const sharp = await loadSharp(); + if (!sharp) return null; + try { + const meta = await sharp(buffer).metadata(); + return { width: Number(meta.width ?? 0), height: Number(meta.height ?? 0), format: meta.format }; + } catch { + return null; + } +} + +/** Re-encode any decodable image to a normalised JPEG proxy. */ +export async function toJpegProxy(buffer, maxEdge = RAW_PREVIEW_EDGE) { + const sharp = await loadSharp(); + if (!sharp) return null; + try { + let img = sharp(buffer, { failOn: 'none' }).rotate(); + const meta = await img.metadata(); + const w = Number(meta.width ?? 0); + const h = Number(meta.height ?? 0); + if (!w || !h) return null; + if (maxEdge > 0 && Math.max(w, h) > maxEdge) img = img.resize({ width: maxEdge, height: maxEdge, fit: 'inside' }); + const data = await img.jpeg({ quality: 92, chromaSubsampling: '4:4:4' }).toBuffer(); + const outMeta = await sharp(data).metadata(); + return { data, width: Number(outMeta.width ?? w), height: Number(outMeta.height ?? h), ext: 'jpg' }; + } catch { + return null; + } +} + +export async function makeThumb(buffer, edge = 512) { + const sharp = await loadSharp(); + if (!sharp) return null; + try { + const data = await sharp(buffer, { failOn: 'none' }) + .rotate() + .resize({ width: edge, height: edge, fit: 'inside', withoutEnlargement: true }) + .jpeg({ quality: 82 }) + .toBuffer(); + return data; + } catch { + return null; + } +} diff --git a/server/index.mjs b/server/index.mjs new file mode 100644 index 0000000..591db4c --- /dev/null +++ b/server/index.mjs @@ -0,0 +1,1453 @@ +import http from 'node:http'; +import fs from 'node:fs'; +import fsp from 'node:fs/promises'; +import path from 'node:path'; +import crypto from 'node:crypto'; +import { + DATA_DIR, + DIST_DIR, + HOST, + INVITE, + MAX_UPLOAD, + PORT, + RAW_PREVIEW_EDGE, +} from './config.mjs'; +import { + authenticate, + createSession, + hashPassword, + normalizeEmail, + publicUser, + validEmail, + verifyPassword, +} from './auth.mjs'; +import { + addGalleryComment, + commentsByOwner, + commentsForToken, + countPhotos, + eventByShareToken, + eventOwner, + galleryPick, + getPhoto, + invites, + kv, + listEvents, + listPhotos, + livePhotoBytes, + photoOwner, + picksByOwner, + picksForToken, + removeEvent, + reviewsByOwner, + reviewsForToken, + setGalleryReview, + removePhoto, + saveEvent, + savePhoto, + sessions, + setShareToken, + shareTokenFor, + users, +} from './db.mjs'; +import { + defaultRoot, + findOriginal, + findPreview, + findProof, + findProofThumb, + findThumb, + isCustomRoot, + removeAsset, + setStorageRoot, + storageBytes, + storageRoot, + writeOriginal, + writePreview, + writeProof, + writeProofThumb, + writeThumb, +} from './storage.mjs'; +import { decodeRaw, isRawName, rawSupport } from './raw.mjs'; +import { + bridgeConfigured, + bridgeForEvent, + exchangeBridgeToken, + fetchBridgeImage, + forwardBridgeRender, + importBridgeEvent, + purgeExpiredBridges, + verifyBridgeToken, +} from './bridge.mjs'; +import { jpegInfo, makeThumb, toJpegProxy } from './imaging.mjs'; +import { createZip } from './zip.mjs'; +import { + cancelPrune, + quotaState, + quotasForAdmin, + schedulePrune, + setUserQuota, + startQuotaWorker, + warnUser, +} from './quota.mjs'; +import { mailStatus, saveMailSettings, sendTestMail } from './mail.mjs'; + +const VERSION = '1.0.0'; +const COOKIE = 'lumen_session'; + +/* ------------------------------------------------------------------ helpers */ + +function json(res, status, payload, extraHeaders = {}) { + const body = Buffer.from(JSON.stringify(payload)); + res.writeHead(status, { + 'Content-Type': 'application/json; charset=utf-8', + 'Content-Length': body.length, + 'Cache-Control': 'no-store', + ...extraHeaders, + }); + res.end(body); +} + +function error(res, status, message) { + json(res, status, { error: message }); +} + +function parseCookies(req) { + const out = {}; + for (const part of String(req.headers.cookie ?? '').split(';')) { + const idx = part.indexOf('='); + if (idx < 0) continue; + out[part.slice(0, idx).trim()] = decodeURIComponent(part.slice(idx + 1).trim()); + } + return out; +} + +function sessionCookie(req, token, maxAge) { + const secure = req.headers['x-forwarded-proto'] === 'https' ? '; Secure' : ''; + return `${COOKIE}=${token}; Path=/; HttpOnly; SameSite=Lax; Max-Age=${maxAge}${secure}`; +} + +function currentUser(req) { + const cookieToken = parseCookies(req)[COOKIE]; + if (cookieToken) { + const row = sessions.find(cookieToken); + if (row && Number(row.expires_at) > Date.now()) { + const user = users.byId(row.user_id); + if (user && !user.disabled) return publicUser(user); + } + } + return authenticate(req); +} + +function requireAdmin(req, res) { + const user = currentUser(req); + if (!user) { + error(res, 401, 'Not signed in'); + return null; + } + if (user.role !== 'admin') { + error(res, 403, 'Administrator access is required'); + return null; + } + return user; +} + +/** An ownerless row predates workspaces; anyone signed in may finish it. */ +function ownedBy(owner, user) { + return !owner || owner === user.id; +} + +function adminUser(row) { + return { + id: row.id, + email: row.email, + name: row.name ?? '', + role: row.role ?? 'member', + disabled: Boolean(row.disabled), + createdAt: row.created_at ?? null, + }; +} + +function inviteStatus(row, now = Date.now()) { + if (!row) return 'missing'; + if (row.revoked_at) return 'revoked'; + if (row.accepted_at) return 'accepted'; + if (Number(row.expires_at) <= now) return 'expired'; + return 'pending'; +} + +function adminInvite(row) { + return { + token: row.token, + email: row.email ?? '', + role: row.role ?? 'member', + status: inviteStatus(row), + createdAt: row.created_at ?? null, + expiresAt: row.expires_at ?? null, + acceptedAt: row.accepted_at ?? null, + acceptedBy: row.accepted_by ?? null, + revokedAt: row.revoked_at ?? null, + }; +} + +/** Accepts either a bare token or a copied /join/ link. */ +function inviteTokenFrom(value) { + if (typeof value !== 'string') return ''; + const raw = value.trim(); + if (!raw) return ''; + const match = /\/join\/([A-Za-z0-9_-]+)\/?/.exec(raw); + if (match) return match[1]; + return /^[A-Za-z0-9_-]{16,64}$/.test(raw) ? raw : ''; +} + +function readBody(req, limit = MAX_UPLOAD) { + return new Promise((resolve, reject) => { + const chunks = []; + let size = 0; + req.on('data', (chunk) => { + size += chunk.length; + if (size > limit) { + reject(new Error(`Upload exceeds the ${Math.round(limit / (1024 * 1024))} MB limit`)); + req.destroy(); + return; + } + chunks.push(chunk); + }); + req.on('end', () => resolve(Buffer.concat(chunks))); + req.on('error', reject); + }); +} + +async function readJson(req, limit = 8 * 1024 * 1024) { + const raw = await readBody(req, limit); + if (!raw.length) return {}; + try { + return JSON.parse(raw.toString('utf8')); + } catch { + throw new Error('Request body is not valid JSON'); + } +} + +function match(pathname, pattern) { + const p = pattern.split('/'); + const a = pathname.split('/'); + if (p.length !== a.length) return null; + const params = {}; + for (let i = 0; i < p.length; i++) { + if (p[i].startsWith(':')) { + params[p[i].slice(1)] = decodeURIComponent(a[i]); + } else if (p[i] !== a[i]) { + return null; + } + } + return params; +} + +function sendBuffer(res, data, type, cache = 'private, max-age=3600') { + res.writeHead(200, { + 'Content-Type': type, + 'Content-Length': data.length, + 'Cache-Control': cache, + ...(type.startsWith('image/') ? { 'X-Content-Type-Options': 'nosniff' } : {}), + }); + res.end(data); +} + +/** The bridge row and source id for a photo imported from the dashboard. */ +function bridgeLinkForPhoto(photoId) { + const photo = getPhoto(photoId); + if (!photo?.eventId) return null; + const bridge = bridgeForEvent(photo.eventId); + if (!bridge) return null; + const sourceId = photo.bridgeSource?.sourceId ?? photoId.replace(/^br-/, ''); + return { photo, bridge, sourceId }; +} + +async function sendFile(req, res, filePath, type, cache = 'private, max-age=86400', extraHeaders = {}) { + if (!filePath) return error(res, 404, 'Not found'); + try { + const stat = await fsp.stat(filePath); + res.writeHead(200, { + 'Content-Type': type, + 'Content-Length': stat.size, + 'Cache-Control': cache, + ...(type.startsWith('image/') ? { 'X-Content-Type-Options': 'nosniff' } : {}), + ...extraHeaders, + }); + if (req.method === 'HEAD') return res.end(); + fs.createReadStream(filePath).pipe(res); + } catch { + error(res, 404, 'Not found'); + } +} + +function decodeDataUrl(value) { + if (typeof value !== 'string') return null; + const m = /^data:image\/(jpeg|png|webp);base64,([A-Za-z0-9+/=\s]+)$/.exec(value); + if (!m) return null; + return { mime: `image/${m[1]}`, data: Buffer.from(m[2], 'base64') }; +} + +/* --------------------------------------------------------------------- api */ + +import { clearDenoised, findDenoisedFor, getDenoiseJob, startDenoise } from './denoise.mjs'; + +const routes = []; +function route(method, pattern, handler) { + routes.push({ method, pattern, handler }); +} + +route('GET', '/api/health', async ({ res }) => { + const raw = await rawSupport(); + json(res, 200, { + ok: true, + app: 'luminary', + version: VERSION, + needsSetup: users.count() === 0, + registrationOpen: users.count() === 0 || Boolean(INVITE) || invites.pendingCount() > 0, + photos: countPhotos(), + bytes: storageBytes(), + storage: { root: storageRoot(), custom: isCustomRoot() }, + raw, + }); +}); + +route('POST', '/api/auth/register', async ({ req, res }) => { + const body = await readJson(req, 64 * 1024); + const email = normalizeEmail(body.email); + const password = typeof body.password === 'string' ? body.password : ''; + const name = typeof body.name === 'string' ? body.name.trim().slice(0, 80) : ''; + if (!validEmail(email)) return error(res, 400, 'Enter a valid email address'); + if (password.length < 8) return error(res, 400, 'Use at least 8 characters for the password'); + if (users.byEmail(email)) return error(res, 409, 'That email is already registered'); + + const first = users.count() === 0; + const sharedCode = typeof body.invite === 'string' ? body.invite.trim() : ''; + const token = inviteTokenFrom(body.inviteToken) || inviteTokenFrom(sharedCode); + let inviteRow = token ? invites.byToken(token) : null; + + if (!first) { + if (inviteRow) { + const status = inviteStatus(inviteRow); + if (status === 'accepted') return error(res, 409, 'This invite has already been used'); + if (status === 'revoked') return error(res, 403, 'This invite link was turned off by an admin'); + if (status === 'expired') return error(res, 403, 'This invite link has expired. Ask an admin for a new one'); + if (inviteRow.email && normalizeEmail(inviteRow.email) !== email) { + return error(res, 403, 'This invite was created for a different email address'); + } + } else if (sharedCode && INVITE && sharedCode === INVITE) { + /* the long-lived shared code still works alongside personal links */ + } else if (token) { + return error(res, 403, 'This invite link is not valid'); + } else if (!INVITE) { + return error(res, 403, 'Registration is closed. Use the invite link an admin sent you.'); + } else if (sharedCode !== INVITE) { + return error(res, 403, 'Invite code is not correct'); + } + } + + const id = crypto.randomUUID(); + users.create({ + id, + email, + name: name || email.split('@')[0], + passHash: hashPassword(password), + role: first ? 'admin' : inviteRow?.role === 'admin' ? 'admin' : 'member', + }); + if (inviteRow && !invites.accept(token, id)) { + users.remove(id); + return error(res, 409, 'This invite has already been used'); + } + const session = createSession(id); + json( + res, + 201, + { token: session, user: publicUser(users.byId(id)) }, + { 'Set-Cookie': sessionCookie(req, session, 30 * 24 * 3600) }, + ); +}); + +route('POST', '/api/auth/login', async ({ req, res }) => { + const body = await readJson(req, 64 * 1024); + const email = normalizeEmail(body.email); + const password = typeof body.password === 'string' ? body.password : ''; + const row = users.byEmail(email); + if (!row || !verifyPassword(password, row.pass_hash)) return error(res, 401, 'Email or password is not correct'); + if (row.disabled) return error(res, 403, 'This account has been disabled by an administrator'); + const token = createSession(row.id); + json( + res, + 200, + { token, user: publicUser(users.byId(row.id)) }, + { 'Set-Cookie': sessionCookie(req, token, 30 * 24 * 3600) }, + ); +}); + +route('POST', '/api/auth/logout', async ({ req, res }) => { + const token = parseCookies(req)[COOKIE]; + if (token) sessions.destroy(token); + json(res, 200, { ok: true }, { 'Set-Cookie': `${COOKIE}=; Path=/; HttpOnly; Max-Age=0` }); +}); + +route('GET', '/api/auth/me', async ({ req, res }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + json(res, 200, { user }); +}); + +/* Public invite lookup for /join/; reveals only what the page needs. */ +route('GET', '/api/invites/:token', async ({ res, params }) => { + const row = invites.byToken(params.token); + if (!row) return error(res, 404, 'This invite link is not valid'); + json(res, 200, { + status: inviteStatus(row), + email: row.email ?? '', + role: row.role ?? 'member', + expiresAt: row.expires_at ?? null, + }); +}); + +/* ------------------------------------------------------------------- admin */ + +route('GET', '/api/admin/overview', async ({ req, res }) => { + if (!requireAdmin(req, res)) return; + const totalsByEvent = new Map(users.eventTotals().map((row) => [row.event_id, row])); + const owners = new Map(users.list().map((row) => [row.id, row.email])); + json(res, 200, { + users: users.list().map(adminUser), + events: listEvents() + .map((event) => { + const totals = totalsByEvent.get(event.id); + const ownerId = eventOwner(event.id) ?? ''; + return { + id: event.id, + name: event.name ?? 'Untitled event', + createdAt: event.createdAt ?? null, + photos: Number(totals?.n ?? 0), + bytes: Number(totals?.bytes ?? 0), + ownerId, + ownerEmail: owners.get(ownerId) ?? '', + }; + }) + .sort((a, b) => (b.createdAt ?? 0) - (a.createdAt ?? 0)), + invites: invites.all().map(adminInvite), + totals: { + users: users.count(), + photos: countPhotos(), + bytes: livePhotoBytes(), + pendingInvites: invites.pendingCount(), + }, + storage: { + root: storageRoot(), + defaultRoot: defaultRoot(), + custom: isCustomRoot(), + diskBytes: storageBytes(), + }, + quotas: quotasForAdmin(), + mail: mailStatus(), + }); +}); + +route('POST', '/api/admin/users', async ({ req, res }) => { + if (!requireAdmin(req, res)) return; + const body = await readJson(req, 64 * 1024); + const email = normalizeEmail(body.email); + const password = typeof body.password === 'string' ? body.password : ''; + const name = typeof body.name === 'string' ? body.name.trim().slice(0, 80) : ''; + const role = body.role === 'admin' ? 'admin' : 'member'; + if (!validEmail(email)) return error(res, 400, 'Enter a valid email address'); + if (password.length < 8) return error(res, 400, 'Use at least 8 characters for the password'); + if (users.byEmail(email)) return error(res, 409, 'That email is already registered'); + + const id = crypto.randomUUID(); + users.create({ + id, + email, + name: name || email.split('@')[0], + passHash: hashPassword(password), + role, + }); + json(res, 201, { user: adminUser(users.byId(id)) }); +}); + +route('PATCH', '/api/admin/users/:id', async ({ req, res, params }) => { + const admin = requireAdmin(req, res); + if (!admin) return; + const target = users.byId(params.id); + if (!target) return error(res, 404, 'No such account'); + + const body = await readJson(req, 64 * 1024); + const patch = {}; + if (typeof body.name === 'string') patch.name = body.name.trim().slice(0, 80); + + if (typeof body.password === 'string' && body.password) { + if (body.password.length < 8) return error(res, 400, 'Use at least 8 characters for the password'); + patch.passHash = hashPassword(body.password); + } + + if (typeof body.role === 'string') { + if (body.role !== 'admin' && body.role !== 'member') { + return error(res, 400, 'Role must be admin or member'); + } + if (params.id === admin.id && body.role !== 'admin') { + return error(res, 400, 'You cannot remove your own administrator access'); + } + if (target.role === 'admin' && body.role !== 'admin' && users.activeAdmins() <= 1) { + return error(res, 400, 'Keep at least one active administrator'); + } + patch.role = body.role; + } + + if (typeof body.disabled === 'boolean') { + if (params.id === admin.id && body.disabled) { + return error(res, 400, 'You cannot disable your own account'); + } + if (target.role === 'admin' && body.disabled && users.activeAdmins() <= 1) { + return error(res, 400, 'Keep at least one active administrator'); + } + patch.disabled = body.disabled; + } + + const updated = users.update(params.id, patch); + if (patch.disabled || patch.passHash) sessions.destroyForUser(params.id); + json(res, 200, { user: adminUser(updated) }); +}); + +route('POST', '/api/admin/invites', async ({ req, res }) => { + const admin = requireAdmin(req, res); + if (!admin) return; + const body = await readJson(req, 64 * 1024); + const email = normalizeEmail(body.email); + if (email && !validEmail(email)) return error(res, 400, 'Enter a valid email address'); + const role = body.role === 'admin' ? 'admin' : 'member'; + const days = Math.min(30, Math.max(1, Number(body.days) || 7)); + const token = crypto.randomBytes(24).toString('base64url'); + invites.create({ + token, + email, + role, + createdBy: admin.id, + expiresAt: Date.now() + days * 24 * 60 * 60 * 1000, + }); + json(res, 201, { invite: adminInvite(invites.byToken(token)) }); +}); + +route('DELETE', '/api/admin/invites/:token', async ({ req, res, params }) => { + if (!requireAdmin(req, res)) return; + const row = invites.byToken(params.token); + if (!row) return error(res, 404, 'No such invite'); + if (row.accepted_at) return error(res, 400, 'That invite has already been used'); + invites.revoke(params.token); + json(res, 200, { ok: true }); +}); + +route('DELETE', '/api/admin/users/:id', async ({ req, res, params }) => { + const admin = requireAdmin(req, res); + if (!admin) return; + if (params.id === admin.id) return error(res, 400, 'You cannot delete your own account'); + const target = users.byId(params.id); + if (!target) return error(res, 404, 'No such account'); + if (target.role === 'admin' && users.activeAdmins() <= 1) { + return error(res, 400, 'Keep at least one active administrator'); + } + sessions.destroyForUser(params.id); + users.remove(params.id); + json(res, 200, { ok: true }); +}); + +route('PUT', '/api/admin/events/:id', async ({ req, res, params }) => { + if (!requireAdmin(req, res)) return; + const existing = listEvents().find((event) => event.id === params.id); + if (!existing) return error(res, 404, 'No such event'); + const body = await readJson(req, 64 * 1024); + const name = typeof body.name === 'string' ? body.name.trim().slice(0, 120) : ''; + if (!name) return error(res, 400, 'Enter an event name'); + const record = { ...existing, name }; + saveEvent(record, typeof existing.order === 'number' ? existing.order : (existing.createdAt ?? Date.now())); + json(res, 200, { event: record }); +}); + +route('DELETE', '/api/admin/events/:id', async ({ req, res, params }) => { + if (!requireAdmin(req, res)) return; + if (!listEvents().some((event) => event.id === params.id)) return error(res, 404, 'No such event'); + const ids = users.photoIdsByEvent(params.id); + ids.forEach(removePhoto); + // The denoise renders are not part of the catalog, so `removePhoto` cannot + // know about them; without this they would outlive the event on the volume. + ids.forEach(clearDenoised); + await Promise.all(ids.map((id) => removeAsset(id))); + removeEvent(params.id); + json(res, 200, { ok: true, photos: ids.length }); +}); + +route('GET', '/api/admin/catalog', async ({ req, res }) => { + if (!requireAdmin(req, res)) return; + const backup = { + // Stable file-format identifier so backups from before the rebrand still restore. + kind: 'lumenroom-catalog', + version: 1, + generatedAt: Date.now(), + events: listEvents(), + photos: listPhotos(), + kv: { + customPresets: kv.get('customPresets') ?? [], + metadataPresets: kv.get('metadataPresets') ?? [], + smartCollections: kv.get('smartCollections') ?? [], + exportRecipes: kv.get('exportRecipes') ?? [], + }, + }; + json(res, 200, backup, { + 'Content-Disposition': `attachment; filename="luminary-catalog-${new Date().toISOString().slice(0, 10)}.json"`, + }); +}); + +route('POST', '/api/admin/catalog', async ({ req, res }) => { + const admin = requireAdmin(req, res); + if (!admin) return; + const body = await readJson(req, 128 * 1024 * 1024); + if (body?.kind !== 'lumenroom-catalog' || !Array.isArray(body.events) || !Array.isArray(body.photos)) { + return error(res, 400, 'This is not a Luminary catalog backup'); + } + const events = body.events.filter((event) => event && typeof event.id === 'string' && event.id); + const photos = body.photos.filter((photo) => photo && typeof photo.id === 'string' && photo.id); + for (const [index, event] of events.entries()) { + saveEvent(event, typeof event.order === 'number' ? event.order : index, admin.id); + } + for (const photo of photos) { + savePhoto(photo, Date.now(), admin.id); + } + const allowedKv = ['customPresets', 'metadataPresets', 'smartCollections', 'exportRecipes']; + for (const key of allowedKv) { + if (body.kv && typeof body.kv === 'object' && key in body.kv) kv.set(key, body.kv[key]); + } + json(res, 200, { ok: true, events: events.length, photos: photos.length }); +}); + +route('GET', '/api/admin/storage', async ({ req, res }) => { + if (!requireAdmin(req, res)) return; + json(res, 200, { + root: storageRoot(), + defaultRoot: defaultRoot(), + custom: isCustomRoot(), + photos: countPhotos(), + bytes: storageBytes(), + }); +}); + +route('PUT', '/api/admin/storage', async ({ req, res }) => { + if (!requireAdmin(req, res)) return; + const body = await readJson(req, 64 * 1024); + try { + const result = await setStorageRoot(body.root); + json(res, 200, { ...result, photos: countPhotos(), bytes: storageBytes() }); + } catch (err) { + return error(res, 400, err instanceof Error ? err.message : 'Could not use that folder'); + } +}); + +route('GET', '/api/quota', async ({ req, res }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + json(res, 200, quotaState(user.id)); +}); + +route('PATCH', '/api/admin/quotas/:id', async ({ req, res, params }) => { + if (!requireAdmin(req, res)) return; + const body = await readJson(req, 64 * 1024); + try { + const bytes = body.bytes ?? Number(body.gigabytes) * 1024 ** 3; + json(res, 200, { quota: setUserQuota(params.id, bytes) }); + } catch (err) { + return error(res, 400, err instanceof Error ? err.message : 'Could not change the quota'); + } +}); + +route('POST', '/api/admin/quotas/:id/prune', async ({ req, res, params }) => { + if (!requireAdmin(req, res)) return; + try { + const result = await schedulePrune(params.id); + json(res, 200, result); + } catch (err) { + return error(res, 400, err instanceof Error ? err.message : 'Could not schedule the prune'); + } +}); + +route('DELETE', '/api/admin/quotas/:id/prune', async ({ req, res, params }) => { + if (!requireAdmin(req, res)) return; + try { + json(res, 200, { quota: cancelPrune(params.id) }); + } catch (err) { + return error(res, 400, err instanceof Error ? err.message : 'Could not cancel the prune'); + } +}); + +route('POST', '/api/admin/quotas/:id/warn', async ({ req, res, params }) => { + if (!requireAdmin(req, res)) return; + try { + json(res, 200, { quota: await warnUser(params.id) }); + } catch (err) { + return error(res, 400, err instanceof Error ? err.message : 'Could not send the warning'); + } +}); + +route('GET', '/api/admin/mail', async ({ req, res }) => { + if (!requireAdmin(req, res)) return; + json(res, 200, { mail: mailStatus() }); +}); + +route('PUT', '/api/admin/mail', async ({ req, res }) => { + if (!requireAdmin(req, res)) return; + const body = await readJson(req, 64 * 1024); + try { + json(res, 200, { mail: saveMailSettings(body) }); + } catch (err) { + return error(res, 400, err instanceof Error ? err.message : 'Could not save email settings'); + } +}); + +route('POST', '/api/admin/mail/test', async ({ req, res }) => { + const admin = requireAdmin(req, res); + if (!admin) return; + const body = await readJson(req, 64 * 1024); + const to = typeof body.to === 'string' && body.to.trim() ? body.to.trim() : admin.email; + try { + await sendTestMail(to); + json(res, 200, { ok: true, to }); + } catch (err) { + return error(res, 400, err instanceof Error ? err.message : 'Could not send the test email'); + } +}); + +route('GET', '/api/bridge/login', async ({ req, res, url }) => { + if (!bridgeConfigured()) { + return error(res, 503, 'The advanced editor bridge is not configured'); + } + const token = url.searchParams.get('token') || ''; + const payload = verifyBridgeToken(token); + if (!payload || payload.kind !== 'login') { + return error(res, 401, 'This advanced-editor link is invalid or has expired'); + } + + try { + const service = await exchangeBridgeToken(token, payload.sid); + const email = normalizeEmail(payload.email); + if (!validEmail(email)) { + return error(res, 400, 'The dashboard account has no usable email address'); + } + + let row = users.byEmail(email); + if (!row) { + const id = crypto.randomUUID(); + users.create({ + id, + email, + name: payload.name || email.split('@')[0], + passHash: hashPassword(crypto.randomBytes(24).toString('hex')), + role: 'member', + }); + row = users.byId(id); + } + + purgeExpiredBridges(); + const imported = await importBridgeEvent({ + serviceToken: service.token, + sessionId: payload.sid, + ownerId: row.id, + }); + const sessionToken = createSession(row.id); + res.writeHead(302, { + Location: `/?bridge=${encodeURIComponent(imported.eventId)}`, + 'Set-Cookie': sessionCookie(req, sessionToken, 30 * 24 * 3600), + 'Cache-Control': 'no-store', + }); + res.end(); + } catch (err) { + return error( + res, + 502, + err instanceof Error ? err.message : 'Could not open the advanced editor', + ); + } +}); + +/** Client proofing picks, rolled up per photo for the owner's library. */ +function ownerProofs(ownerId) { + const proofs = new Map(); + const ensure = (photoId, eventId) => { + const entry = proofs.get(photoId) ?? { + photoId, + eventId, + count: 0, + clients: [], + comments: 0, + approved: 0, + changes: 0, + }; + proofs.set(photoId, entry); + return entry; + }; + for (const pick of picksByOwner(ownerId)) { + if (!pick.picked) continue; + const entry = ensure(pick.photoId, pick.eventId); + entry.count += 1; + entry.clients.push(pick.clientName || 'Client'); + } + for (const comment of commentsByOwner(ownerId)) { + ensure(comment.photoId, comment.eventId).comments += 1; + } + for (const review of reviewsByOwner(ownerId)) { + const entry = ensure(review.photoId, review.eventId); + if (review.status === 'approved') entry.approved += 1; + else if (review.status === 'changes') entry.changes += 1; + if (review.clientName) entry.clients.push(review.clientName); + } + return [...proofs.values()].map((entry) => ({ + ...entry, + clients: [...new Set(entry.clients)], + })); +} + +route('GET', '/api/proofs', async ({ req, res }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + json(res, 200, { proofs: ownerProofs(user.id) }); +}); + +route('GET', '/api/sync', async ({ req, res }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + json(res, 200, { + user, + events: listEvents(user.id), + photos: listPhotos(user.id), + presets: kv.get('presets') ?? [], + proofs: ownerProofs(user.id), + }); +}); + +/* -------------------------------------------------------------- proofing */ + +/** Token-protected lookup: the photo must belong to the shared event. */ +function galleryPhoto(token, photoId) { + const shared = eventByShareToken(token); + if (!shared) return null; + const photo = getPhoto(photoId); + if (!photo || photo.eventId !== shared.id || photo.deletedAt) return null; + return { shared, photo }; +} + +route('GET', '/api/events/:id/share', async ({ req, res, params }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + if (!ownedBy(eventOwner(params.id), user)) return error(res, 404, 'No such event'); + const token = shareTokenFor(params.id); + const feedback = token + ? [ + ...commentsForToken(token).map((comment) => ({ + kind: 'comment', + photoId: comment.photoId, + clientName: comment.clientName, + body: comment.body, + createdAt: comment.createdAt, + })), + ...reviewsForToken(token) + .filter((review) => review.status === 'approved' || review.status === 'changes') + .map((review) => ({ + kind: review.status === 'approved' ? 'approved' : 'changes', + photoId: review.photoId, + clientName: review.clientName, + createdAt: review.updatedAt, + })), + ].sort((a, b) => b.createdAt - a.createdAt) + : []; + json(res, 200, { + token, + picks: token + ? picksForToken(token) + .filter((p) => p.picked) + .map((p) => ({ photoId: p.photoId, clientName: p.clientName })) + : [], + feedback, + }); +}); + +route('POST', '/api/events/:id/share', async ({ req, res, params }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + if (!ownedBy(eventOwner(params.id), user)) return error(res, 404, 'No such event'); + let token = shareTokenFor(params.id); + if (!token) { + token = crypto.randomBytes(18).toString('base64url'); + setShareToken(params.id, token); + } + json(res, 200, { token }); +}); + +route('DELETE', '/api/events/:id/share', async ({ req, res, params }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + if (!ownedBy(eventOwner(params.id), user)) return error(res, 404, 'No such event'); + setShareToken(params.id, null); + json(res, 200, { ok: true }); +}); + +/** Public gallery payload: no session, only the shared event and its photos. */ +route('GET', '/api/galleries/:token', async ({ res, params, url }) => { + const shared = eventByShareToken(params.token); + if (!shared) return error(res, 404, 'This proofing gallery is no longer available'); + const clientId = String(url.searchParams.get('client') ?? '').slice(0, 64); + const picks = picksForToken(params.token).filter((p) => p.picked); + const counts = new Map(); + const mine = new Set(); + for (const pick of picks) { + counts.set(pick.photoId, (counts.get(pick.photoId) ?? 0) + 1); + if (clientId && pick.clientId === clientId) mine.add(pick.photoId); + } + const comments = new Map(); + for (const comment of commentsForToken(params.token)) { + const list = comments.get(comment.photoId) ?? []; + list.push({ + id: comment.id, + clientName: comment.clientName || 'Client', + body: comment.body, + createdAt: comment.createdAt, + }); + comments.set(comment.photoId, list); + } + const reviews = new Map(); + for (const review of reviewsForToken(params.token)) { + if (clientId && review.clientId !== clientId) continue; + reviews.set(review.photoId, review.status); + } + const photos = listPhotos(shared.ownerId) + .filter((photo) => photo.eventId === shared.id && !photo.deletedAt) + .sort( + (a, b) => + (a.order ?? Number.MAX_SAFE_INTEGER) - (b.order ?? Number.MAX_SAFE_INTEGER) || + (a.takenAt ?? a.addedAt) - (b.takenAt ?? b.addedAt), + ) + .map((photo) => ({ + id: photo.id, + name: photo.name, + width: photo.width, + height: photo.height, + takenAt: photo.takenAt ?? null, + thumbUrl: `/api/galleries/${params.token}/photos/${photo.id}/thumb${photo.proofAt ? `?proof=${photo.proofAt}` : ''}`, + previewUrl: `/api/galleries/${params.token}/photos/${photo.id}/preview${photo.proofAt ? `?proof=${photo.proofAt}` : ''}`, + pickCount: counts.get(photo.id) ?? 0, + mine: mine.has(photo.id), + comments: comments.get(photo.id) ?? [], + reviewStatus: reviews.get(photo.id) ?? null, + })); + json(res, 200, { + event: { + name: shared.event.name ?? 'Proofing gallery', + date: shared.event.date ?? shared.event.createdAt ?? null, + notes: shared.event.notes ?? '', + }, + photographer: 'Luminary', + photos, + picks: { total: picks.length, clients: new Set(picks.map((p) => p.clientId)).size }, + }); +}); + +route('GET', '/api/galleries/:token/photos/:id/thumb', async ({ req, res, params }) => { + if (!galleryPhoto(params.token, params.id)) return error(res, 404, 'Not found'); + const file = findProofThumb(params.id) ?? (await findThumb(params.id)); + return sendFile(req, res, file, 'image/jpeg', 'private, max-age=3600'); +}); + +route('GET', '/api/galleries/:token/photos/:id/preview', async ({ req, res, params }) => { + const hit = galleryPhoto(params.token, params.id); + if (!hit) return error(res, 404, 'Not found'); + const proof = findProof(params.id); + const file = proof ?? findPreview(params.id) ?? findOriginal(params.id); + return sendFile(req, res, file, proof ? 'image/jpeg' : hit.photo.mime || 'image/jpeg', 'private, max-age=3600'); +}); + +/** Client download of the edited proof, named like the delivered file. */ +route('GET', '/api/galleries/:token/photos/:id/download', async ({ req, res, params }) => { + const hit = galleryPhoto(params.token, params.id); + if (!hit) return error(res, 404, 'Not found'); + const proof = findProof(params.id); + const file = proof ?? findPreview(params.id) ?? findOriginal(params.id); + const originalName = String(hit.photo.name || 'photo.jpg'); + const safe = (proof ? originalName.replace(/\.[^.]+$/, '.jpg') : originalName).replace(/["\\/:*?<>|]+/g, '-'); + return sendFile(req, res, file, proof ? 'image/jpeg' : hit.photo.mime || 'image/jpeg', 'private, max-age=3600', { + 'Content-Disposition': `attachment; filename="${safe}"`, + }); +}); + +/** Download the client's favourites as one ZIP. */ +route('GET', '/api/galleries/:token/download-all', async ({ req, res, params, url }) => { + const shared = eventByShareToken(params.token); + if (!shared) return error(res, 404, 'This proofing gallery is no longer available'); + const clientId = String(url.searchParams.get('client') ?? '').slice(0, 64); + const picks = picksForToken(params.token).filter( + (pick) => pick.picked && (!clientId || pick.clientId === clientId), + ); + if (!picks.length) return error(res, 404, 'There are no favourites to download yet'); + + const entries = []; + const seen = new Set(); + for (const pick of picks) { + if (seen.has(pick.photoId)) continue; + seen.add(pick.photoId); + const photo = getPhoto(pick.photoId); + if (!photo || photo.eventId !== shared.id || photo.deletedAt) continue; + const proof = findProof(photo.id); + const file = proof ?? findPreview(photo.id) ?? findOriginal(photo.id); + if (!file) continue; + try { + const data = await fsp.readFile(file); + const originalName = String(photo.name || 'photo.jpg'); + const name = proof + ? originalName.replace(/\.[^.]+$/, '.jpg') + : originalName; + entries.push({ name, data }); + } catch { + /* skip an unreadable file rather than losing the whole archive */ + } + } + if (!entries.length) return error(res, 404, 'There are no downloadable favourites yet'); + + const archive = createZip(entries); + const eventName = String(shared.event.name || 'proofing') + .replace(/[^a-z0-9._ -]+/gi, '-') + .trim() || 'proofing'; + res.writeHead(200, { + 'Content-Type': 'application/zip', + 'Content-Length': archive.length, + 'Cache-Control': 'no-store', + 'Content-Disposition': `attachment; filename="${eventName}-favourites.zip"`, + }); + res.end(archive); +}); + +route('POST', '/api/galleries/:token/comments', async ({ req, res, params }) => { + if (!eventByShareToken(params.token)) { + return error(res, 404, 'This proofing gallery is no longer available'); + } + const body = await readJson(req, 32 * 1024); + const hit = galleryPhoto(params.token, String(body.photoId ?? '')); + if (!hit) return error(res, 404, 'No such photo'); + const clientId = String(body.clientId ?? '').trim().slice(0, 64); + const text = String(body.body ?? '').trim().slice(0, 1200); + if (!clientId || !text) return error(res, 400, 'A comment needs a client and text'); + const clientName = String(body.clientName ?? '').trim().slice(0, 60); + const comment = { + id: crypto.randomUUID(), + token: params.token, + photoId: hit.photo.id, + clientId, + clientName, + body: text, + }; + addGalleryComment(comment); + json(res, 200, { comment: { ...comment, createdAt: Date.now() } }); +}); + +route('POST', '/api/galleries/:token/reviews', async ({ req, res, params }) => { + if (!eventByShareToken(params.token)) { + return error(res, 404, 'This proofing gallery is no longer available'); + } + const body = await readJson(req, 16 * 1024); + const hit = galleryPhoto(params.token, String(body.photoId ?? '')); + if (!hit) return error(res, 404, 'No such photo'); + const clientId = String(body.clientId ?? '').trim().slice(0, 64); + const status = body.status === 'approved' || body.status === 'changes' ? body.status : 'none'; + if (!clientId) return error(res, 400, 'Missing client id'); + setGalleryReview({ + token: params.token, + photoId: hit.photo.id, + clientId, + clientName: String(body.clientName ?? '').trim().slice(0, 60), + status, + }); + json(res, 200, { ok: true, status }); +}); + +route('POST', '/api/galleries/:token/picks', async ({ req, res, params }) => { + if (!eventByShareToken(params.token)) { + return error(res, 404, 'This proofing gallery is no longer available'); + } + const body = await readJson(req, 32 * 1024); + const hit = galleryPhoto(params.token, String(body.photoId ?? '')); + if (!hit) return error(res, 404, 'No such photo'); + const clientId = String(body.clientId ?? '').trim().slice(0, 64); + if (!clientId) return error(res, 400, 'Missing client id'); + const clientName = String(body.clientName ?? '').trim().slice(0, 60); + galleryPick(params.token, hit.photo.id, clientId, clientName, body.picked !== false); + json(res, 200, { ok: true }); +}); + +route('PUT', '/api/events/:id', async ({ req, res, params }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + if (!ownedBy(eventOwner(params.id), user)) return error(res, 404, 'No such event'); + const body = await readJson(req, 256 * 1024); + const record = { ...body, id: params.id }; + saveEvent( + record, + typeof body.order === 'number' ? body.order : Number(body.createdAt ?? Date.now()), + user.id, + ); + json(res, 200, { event: record }); +}); + +route('DELETE', '/api/events/:id', async ({ req, res, params }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + if (!ownedBy(eventOwner(params.id), user)) return error(res, 404, 'No such event'); + removeEvent(params.id); + json(res, 200, { ok: true }); +}); + +route('PUT', '/api/presets', async ({ req, res }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + const body = await readJson(req, 512 * 1024); + kv.set('presets', Array.isArray(body.presets) ? body.presets : []); + json(res, 200, { ok: true }); +}); + +/** + * Store the original file. Raw files are demosaiced here so every browser can + * edit them; ordinary images are kept byte-for-byte and previewed client-side. + */ +route('POST', '/api/photos/:id/original', async ({ req, res, params }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + if (!ownedBy(photoOwner(params.id), user)) return error(res, 404, 'No such photo'); + const url = new URL(req.url ?? '/', 'http://localhost'); + const name = url.searchParams.get('name') || 'upload'; + const mime = url.searchParams.get('mime') || 'application/octet-stream'; + const drop = url.searchParams.get('drop') === '1'; + const data = await readBody(req); + if (!data.length) return error(res, 400, 'Empty upload'); + + const ext = (name.split('.').pop() || 'bin').toLowerCase(); + await writeOriginal(params.id, ext, data); + + if (isRawName(name) || drop) { + try { + const decoded = await decodeRaw(data); + await writePreview(params.id, decoded.jpeg, decoded.ext); + const info = await jpegInfo(decoded.jpeg); + return json(res, 201, { + raw: true, + engine: decoded.engine, + width: info?.width || decoded.width, + height: info?.height || decoded.height, + mime: 'image/jpeg', + previewUrl: `/api/photos/${params.id}/preview`, + thumbUrl: `/api/photos/${params.id}/thumb`, + note: decoded.note ?? null, + maxEdge: RAW_PREVIEW_EDGE, + }); + } catch (err) { + return error(res, 422, err instanceof Error ? err.message : 'Could not decode this raw file'); + } + } + + return json(res, 201, { raw: false, mime, size: data.length }); +}); + +route('GET', '/api/photos/:id/thumb', async ({ req, res, params }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + if (!ownedBy(photoOwner(params.id), user)) return error(res, 404, 'Not found'); + const thumb = findProofThumb(params.id) ?? findThumb(params.id); + if (thumb) return sendFile(req, res, thumb, 'image/jpeg'); + + const linked = bridgeLinkForPhoto(params.id); + if (!linked) return error(res, 404, 'Not found'); + const upstream = await fetchBridgeImage(linked.bridge, linked.sourceId, 'thumb'); + if (!upstream.ok) return error(res, 404, 'Thumbnail unavailable'); + const data = Buffer.from(await upstream.arrayBuffer()); + await writeThumb(params.id, data); + return sendBuffer(res, data, 'image/jpeg'); +}); + +/** + * Store a rendered proof for an edited photo. The editable proxy and original + * stay untouched; galleries read this copy so clients see the developed image. + */ +route('POST', '/api/photos/:id/proof', async ({ req, res, params }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + if (!ownedBy(photoOwner(params.id), user)) return error(res, 404, 'No such photo'); + const body = await readJson(req, 16 * 1024 * 1024); + if (typeof body.jpeg !== 'string' || !body.jpeg) return error(res, 400, 'A JPEG proof is required'); + const jpeg = Buffer.from(body.jpeg, 'base64'); + if (jpeg.length < 4 || jpeg[0] !== 0xff || jpeg[1] !== 0xd8) { + return error(res, 400, 'The proof is not a JPEG image'); + } + await writeProof(params.id, jpeg); + const thumb = await makeThumb(jpeg, 560); + if (thumb) await writeProofThumb(params.id, thumb); + const existing = getPhoto(params.id); + const proofAt = Date.now(); + if (existing) { + savePhoto( + { + ...existing, + proofAt, + thumbUrl: `/api/photos/${params.id}/thumb?proof=${proofAt}`, + }, + proofAt, + user.id, + ); + } + const info = await jpegInfo(jpeg); + json(res, 200, { + ok: true, + proofAt, + width: info?.width ?? null, + height: info?.height ?? null, + thumbUrl: `/api/photos/${params.id}/thumb?proof=${proofAt}`, + }); +}); + +route('GET', '/api/photos/:id/preview', async ({ req, res, params }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + if (!ownedBy(photoOwner(params.id), user)) return error(res, 404, 'Not found'); + const preview = findPreview(params.id); + if (preview) return sendFile(req, res, preview, preview.endsWith('.png') ? 'image/png' : 'image/jpeg'); + + const linked = bridgeLinkForPhoto(params.id); + if (linked) { + const upstream = await fetchBridgeImage(linked.bridge, linked.sourceId, 'proxy'); + if (!upstream.ok) return error(res, 404, 'Preview unavailable'); + const data = Buffer.from(await upstream.arrayBuffer()); + await writePreview(params.id, data); + const info = await jpegInfo(data); + if (info?.width && info?.height) { + savePhoto({ ...linked.photo, width: info.width, height: info.height, mime: 'image/jpeg', size: data.length }); + } + return sendBuffer(res, data, 'image/jpeg'); + } + + return sendFile(req, res, findOriginal(params.id), 'application/octet-stream'); +}); + +route('POST', '/api/photos/:id/denoise', async ({ req, res, params }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + if (!ownedBy(photoOwner(params.id), user)) return error(res, 404, 'Not found'); + // Denoise the proxy the editor actually shows, not the raw: the result has to + // line up pixel for pixel with the canvas and with the client's export path. + // The Amount slider is the client's: the render is always full strength. + const source = findPreview(params.id) ?? findOriginal(params.id); + if (!source) return error(res, 404, 'Nothing to denoise'); + const job = startDenoise({ photoId: params.id, sourcePath: source }); + return json(res, 202, { jobId: job.id, state: job.state }); +}); + +route('GET', '/api/denoise/jobs/:id', async ({ req, res, params }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + const job = getDenoiseJob(params.id); + if (!job) return error(res, 404, 'Job not found'); + if (!ownedBy(photoOwner(job.photoId), user)) return error(res, 404, 'Not found'); + return json(res, 200, { + id: job.id, + key: job.key, + state: job.state, + ms: job.ms ?? null, + error: job.error ?? null, + url: job.url ?? null, + stats: job.stats ?? null, + }); +}); + +route('GET', '/api/photos/:id/denoised', async ({ req, res, params, url }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + if (!ownedBy(photoOwner(params.id), user)) return error(res, 404, 'Not found'); + const file = findDenoisedFor(params.id, url.searchParams.get('v') ?? undefined); + if (!file) return error(res, 404, 'No denoised version'); + return sendFile(req, res, file, 'image/jpeg', 'private, max-age=31536000, immutable'); +}); + +/** Drop the rendered denoise files for a photo, e.g. when the edit is cleared. */ +route('DELETE', '/api/photos/:id/denoised', async ({ req, res, params }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + if (!ownedBy(photoOwner(params.id), user)) return error(res, 404, 'Not found'); + clearDenoised(params.id); + json(res, 200, { ok: true }); +}); + +route('GET', '/api/photos/:id/original', async ({ req, res, params }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + if (!ownedBy(photoOwner(params.id), user)) return error(res, 404, 'Not found'); + const original = findOriginal(params.id); + if (original) return sendFile(req, res, original, 'application/octet-stream', 'private, max-age=3600'); + + const linked = bridgeLinkForPhoto(params.id); + if (!linked) return error(res, 404, 'Not found'); + const upstream = await fetchBridgeImage(linked.bridge, linked.sourceId, 'original'); + if (!upstream.ok) return error(res, 404, 'Original unavailable'); + const data = Buffer.from(await upstream.arrayBuffer()); + return sendBuffer(res, data, linked.photo.mime || 'application/octet-stream'); +}); + +route('POST', '/api/bridge/export', async ({ req, res }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + + const body = await readJson(req, 64 * 1024 * 1024); + if (typeof body.photoId !== 'string' || typeof body.jpeg !== 'string') { + return error(res, 400, 'A photo id and a rendered JPEG are required'); + } + + const linked = bridgeLinkForPhoto(body.photoId); + if (!linked) return error(res, 404, 'This photo is not part of an advanced edit'); + if (!ownedBy(photoOwner(body.photoId), user)) return error(res, 404, 'This photo is not part of an advanced edit'); + + const result = await forwardBridgeRender(linked.bridge, linked.sourceId, { + jpeg: body.jpeg, + edits: body.edits ?? {}, + }); + if (result.status >= 400) { + return error(res, result.status, result.body?.error || 'The edit could not be saved to the event'); + } + return json(res, 200, result.body ?? { ok: true }); +}); + +route('PUT', '/api/photos/:id', async ({ req, res, params }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + if (!ownedBy(photoOwner(params.id), user)) return error(res, 404, 'No such photo'); + const body = await readJson(req); + if (body.id && body.id !== params.id) return error(res, 400, 'Photo id does not match the URL'); + const record = { ...body, id: params.id }; + + const thumb = decodeDataUrl(record.thumb); + if (thumb) { + await writeThumb(params.id, thumb.data); + delete record.thumb; + } + if (record.raw) { + record.previewUrl = `/api/photos/${params.id}/preview`; + const preview = findPreview(params.id); + if (!preview) { + const original = findOriginal(params.id); + if (original) { + const proxy = await toJpegProxy(await fsp.readFile(original)); + if (proxy) await writePreview(params.id, proxy.data, proxy.ext); + } + } + } + record.thumbUrl = record.proofAt + ? `/api/photos/${params.id}/thumb?proof=${record.proofAt}` + : `/api/photos/${params.id}/thumb`; + savePhoto(record, Date.now(), user.id); + json(res, 200, { photo: record }); +}); + +route('DELETE', '/api/photos/:id', async ({ req, res, params }) => { + const user = currentUser(req); + if (!user) return error(res, 401, 'Not signed in'); + if (!ownedBy(photoOwner(params.id), user)) return error(res, 404, 'No such photo'); + removePhoto(params.id); + clearDenoised(params.id); + await removeAsset(params.id); + json(res, 200, { ok: true }); +}); + +/* ---------------------------------------------------------------- static ui */ + +const MIME = { + '.html': 'text/html; charset=utf-8', + '.js': 'text/javascript; charset=utf-8', + '.css': 'text/css; charset=utf-8', + '.json': 'application/json; charset=utf-8', + '.svg': 'image/svg+xml', + '.png': 'image/png', + '.pdf': 'application/pdf', + '.jpg': 'image/jpeg', + '.jpeg': 'image/jpeg', + '.webp': 'image/webp', + '.ico': 'image/x-icon', + '.woff2': 'font/woff2', + '.map': 'application/json; charset=utf-8', +}; + +async function serveStatic(req, res, url) { + const pathname = decodeURIComponent(url.pathname); + const candidate = path.join(DIST_DIR, pathname === '/' ? 'index.html' : pathname); + if (candidate.startsWith(DIST_DIR)) { + try { + const stat = await fsp.stat(candidate); + if (stat.isFile()) { + const ext = path.extname(candidate).toLowerCase(); + const immutable = pathname.startsWith('/assets/'); + return sendFile( + req, + res, + candidate, + MIME[ext] ?? 'application/octet-stream', + immutable ? 'public, max-age=31536000, immutable' : 'no-cache', + ); + } + } catch { + /* fall through to the SPA entry */ + } + } + const index = path.join(DIST_DIR, 'index.html'); + if (!fs.existsSync(index)) { + return error( + res, + 503, + 'The web build is missing. Run "npm run build" (or use "npm run dev" with the Vite dev server).', + ); + } + return sendFile(req, res, index, MIME['.html'], 'no-cache'); +} + +/* ------------------------------------------------------------------ server */ + +const server = http.createServer(async (req, res) => { + const url = new URL(req.url ?? '/', `http://${req.headers.host ?? 'localhost'}`); + res.setHeader('X-Frame-Options', 'SAMEORIGIN'); + res.setHeader('Referrer-Policy', 'same-origin'); + try { + if (url.pathname.startsWith('/api/')) { + for (const r of routes) { + if (r.method !== req.method) continue; + const params = match(url.pathname, r.pattern); + if (!params) continue; + return await r.handler({ req, res, params, url }); + } + return error(res, 404, `No route for ${req.method} ${url.pathname}`); + } + return await serveStatic(req, res, url); + } catch (err) { + const message = err instanceof Error ? err.message : 'Unexpected error'; + console.error(`[luminary] ${req.method} ${url.pathname} → ${message}`); + if (!res.headersSent) return error(res, 500, message); + res.end(); + } +}); + +server.listen(PORT, HOST, async () => { + startQuotaWorker(); + const raw = await rawSupport(); + console.log(`Luminary server listening on http://localhost:${PORT}`); + console.log(` data: ${DATA_DIR}`); + console.log( + ` raw: libraw ${raw.libraw ? `ready (${raw.workers} parallel worker${raw.workers === 1 ? '' : 's'})` : 'missing'} · jpeg ${raw.sharp ? 'sharp' : 'png fallback'}`, + ); + console.log(` users: ${users.count()} account(s)${users.count() === 0 ? ' — first signup becomes admin' : ''}`); + if (!raw.libraw) console.log(' note: install libraw-wasm for full raw demosaic (embedded previews still work)'); +}); + +for (const signal of ['SIGINT', 'SIGTERM']) { + process.on(signal, () => { + server.close(() => process.exit(0)); + }); +} diff --git a/server/libraw-pool.mjs b/server/libraw-pool.mjs new file mode 100644 index 0000000..1938a2e --- /dev/null +++ b/server/libraw-pool.mjs @@ -0,0 +1,120 @@ +import { RAW_IDLE_MS, RAW_WORKERS } from './config.mjs'; +import { installLibrawRuntime } from './libraw-runtime.mjs'; + +let ctorPromise = null; + +/** Load the decoder class once; installs the Node worker shim on first use. */ +export function loadLibRaw() { + if (!ctorPromise) { + ctorPromise = (async () => { + await installLibrawRuntime(); + const mod = await import('libraw-wasm'); + const ctor = mod.default?.default ?? mod.default; + if (typeof ctor !== 'function') throw new Error('libraw-wasm did not export a constructor'); + return ctor; + })(); + } + return ctorPromise; +} + +/** + * Bounded pool of decoder instances. Each instance owns one worker thread, so + * this caps how much demosaicing runs at the same time; extra jobs queue. + * Idle instances are disposed after RAW_IDLE_MS to give the memory back. + */ +class LibRawPool { + constructor(size = RAW_WORKERS) { + this.size = Math.max(1, Math.floor(size)); + this.free = []; + this.total = 0; + this.waiters = []; + this.closed = false; + } + + async acquire() { + const entry = this.free.pop(); + if (entry) { + if (entry.timer) clearTimeout(entry.timer); + return entry.lib; + } + if (this.total < this.size) { + this.total++; + try { + const Ctor = await loadLibRaw(); + return new Ctor(); + } catch (err) { + this.total--; + throw err; + } + } + return new Promise((resolve, reject) => this.waiters.push({ resolve, reject })); + } + + release(lib, healthy = true) { + if (this.closed || !healthy) { + this.discard(lib); + return; + } + const waiter = this.waiters.shift(); + if (waiter) { + waiter.resolve(lib); + return; + } + const entry = { lib, timer: null }; + entry.timer = setTimeout(() => { + const idx = this.free.indexOf(entry); + if (idx >= 0) { + this.free.splice(idx, 1); + this.discard(lib); + } + }, RAW_IDLE_MS); + entry.timer.unref?.(); + this.free.push(entry); + } + + discard(lib) { + try { + lib.dispose(); + } catch { + /* worker already gone */ + } + this.total = Math.max(0, this.total - 1); + const waiter = this.waiters.shift(); + if (waiter) { + this.total++; + loadLibRaw() + .then((Ctor) => new Ctor()) + .then(waiter.resolve, waiter.reject); + } + } + + /** Run `fn` with a decoder instance; the instance returns to the pool after. */ + async use(fn) { + const lib = await this.acquire(); + let healthy = true; + try { + return await fn(lib); + } catch (err) { + // 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; + throw err; + } finally { + this.release(lib, healthy); + } + } + + get stats() { + return { + size: this.size, + busy: this.total - this.free.length, + idle: this.free.length, + queued: this.waiters.length, + }; + } +} + +export const rawPool = new LibRawPool(); + +export function poolSupport() { + return { size: rawPool.size, workers: RAW_WORKERS }; +} diff --git a/server/libraw-runtime.mjs b/server/libraw-runtime.mjs new file mode 100644 index 0000000..6b6e90f --- /dev/null +++ b/server/libraw-runtime.mjs @@ -0,0 +1,34 @@ +/** + * libraw-wasm is browser-first: the wrapper spawns a Web Worker and the + * Emscripten build loads libraw.wasm with fetch(). Node has neither a global + * Worker nor file:// support in fetch, so the decoder runs in a worker_thread + * with a tiny browser-globals shim (see libraw-worker.mjs). + * + * This is a no-op in the browser, where the real Worker already exists. + */ +let installed = false; + +export async function installLibrawRuntime() { + if (installed) return; + installed = true; + if (typeof globalThis.Worker === 'function') return; + + const { Worker: NodeWorker } = await import('node:worker_threads'); + const entry = new URL('./libraw-worker.mjs', import.meta.url); + + class BrowserWorker { + constructor() { + this._worker = new NodeWorker(entry); + this._worker.on('message', (data) => this.onmessage?.({ data })); + this._worker.on('error', (err) => this.onerror?.(err)); + } + postMessage(message, transfer) { + this._worker.postMessage(message, transfer); + } + terminate() { + return this._worker.terminate(); + } + } + + globalThis.Worker = BrowserWorker; +} diff --git a/server/libraw-worker.mjs b/server/libraw-worker.mjs new file mode 100644 index 0000000..8b4d338 --- /dev/null +++ b/server/libraw-worker.mjs @@ -0,0 +1,31 @@ +import { parentPort } from 'node:worker_threads'; +import fs from 'node:fs/promises'; +import { fileURLToPath } from 'node:url'; + +// libraw-wasm targets browsers: emulate the worker globals its build expects. +globalThis.self = globalThis; +globalThis.WorkerGlobalScope = globalThis; +globalThis.postMessage = (msg, transfer) => parentPort.postMessage(msg, transfer); +globalThis.addEventListener = () => {}; + +// Emscripten loads libraw.wasm through fetch(); Node's fetch rejects file:// URLs. +const realFetch = globalThis.fetch; +globalThis.fetch = async (url, init) => { + const href = typeof url === 'string' ? url : url instanceof URL ? url.href : String(url); + if (href.startsWith('file:')) { + const buf = await fs.readFile(fileURLToPath(href)); + return new Response(buf, { status: 200, headers: { 'content-type': 'application/wasm' } }); + } + return realFetch(url, init); +}; + +// Buffer anything that arrives before the module registers `onmessage`. +const queue = []; +parentPort.on('message', (data) => { + if (typeof globalThis.onmessage === 'function') globalThis.onmessage({ data }); + else queue.push(data); +}); + +await import('libraw-wasm/dist/worker.js'); + +for (const data of queue.splice(0)) globalThis.onmessage({ data }); diff --git a/server/mail.mjs b/server/mail.mjs new file mode 100644 index 0000000..a7f66bc --- /dev/null +++ b/server/mail.mjs @@ -0,0 +1,129 @@ +import nodemailer from 'nodemailer'; +import { kv } from './db.mjs'; +import { + SMTP_APP_PASSWORD, + SMTP_FROM, + SMTP_HOST, + SMTP_PORT, + SMTP_SECURE, + SMTP_USER, +} from './config.mjs'; + +const SETTINGS_KEY = 'mailSettings'; + +function savedSettings() { + const value = kv.get(SETTINGS_KEY); + return value && typeof value === 'object' ? value : {}; +} + +/** Never returns the app password; `hasPassword` is enough for the admin UI. */ +export function mailStatus() { + const saved = savedSettings(); + const user = String(saved.user || SMTP_USER || '').trim(); + const appPassword = String(saved.appPassword || SMTP_APP_PASSWORD || ''); + const from = String(saved.from || SMTP_FROM || user).trim(); + const host = String(saved.host || SMTP_HOST || 'smtp.gmail.com').trim(); + const port = Number(saved.port || SMTP_PORT || 465); + const secure = typeof saved.secure === 'boolean' ? saved.secure : SMTP_SECURE; + return { + configured: Boolean(user && appPassword), + source: saved.user || saved.appPassword ? 'admin' : user || appPassword ? 'environment' : 'none', + host, + port, + secure, + user, + from, + hasPassword: Boolean(appPassword), + gmail: host === 'smtp.gmail.com', + }; +} + +function validateSettings(input) { + const current = savedSettings(); + const user = String(input.user ?? current.user ?? SMTP_USER ?? '').trim(); + const appPassword = String( + (input.appPassword && String(input.appPassword).trim()) || + current.appPassword || + SMTP_APP_PASSWORD || + '', + ).trim(); + const from = String(input.from ?? current.from ?? SMTP_FROM ?? user).trim(); + const host = String(input.host ?? current.host ?? SMTP_HOST ?? 'smtp.gmail.com').trim(); + const port = Number(input.port ?? current.port ?? SMTP_PORT ?? 465); + const secure = typeof input.secure === 'boolean' ? input.secure : port === 465; + + if (!/^[^@\s]+@[^@\s]+\.[^@\s]{2,}$/.test(user)) { + throw new Error('Enter the Gmail address that will send notifications'); + } + if (!appPassword) throw new Error('Enter the Google app password for that Gmail account'); + if (appPassword.length < 8) throw new Error('That app password looks too short'); + if (from && !/^[^@\s]+@[^@\s]+\.[^@\s]{2,}$/.test(from)) { + throw new Error('The From address is not a valid email address'); + } + if (!host) throw new Error('Enter an SMTP host'); + if (!Number.isInteger(port) || port < 1 || port > 65535) { + throw new Error('Enter a valid SMTP port'); + } + + return { user, appPassword, from: from || user, host, port, secure }; +} + +export function saveMailSettings(input) { + const next = validateSettings(input ?? {}); + kv.set(SETTINGS_KEY, next); + return mailStatus(); +} + +export async function sendAppMail({ to, subject, text, html }) { + const settings = mailStatus(); + if (!settings.configured) { + throw new Error( + 'Email is not configured. Add the Gmail address and Google app password in Administration → Quotas.', + ); + } + if (!to) throw new Error('A recipient email address is required'); + + const saved = savedSettings(); + const appPassword = saved.appPassword || SMTP_APP_PASSWORD; + const transporter = nodemailer.createTransport({ + host: settings.host, + port: settings.port, + secure: settings.secure, + auth: { user: settings.user, pass: appPassword }, + connectionTimeout: 12_000, + greetingTimeout: 12_000, + socketTimeout: 20_000, + }); + + try { + return await transporter.sendMail({ + from: settings.from || settings.user, + replyTo: settings.from || settings.user, + to, + subject, + text, + html, + }); + } finally { + transporter.close(); + } +} + +export async function sendTestMail(to) { + return sendAppMail({ + to, + subject: 'Luminary email notifications are working', + text: + 'This is a test message from Luminary. Your Gmail app password is configured correctly, ' + + 'so quota warnings and scheduled storage-prune notices can reach your team.\n\n' + + '— Luminary', + html: ` +
+

Luminary email is working

+

Your Gmail app password is configured correctly. Quota warnings and scheduled + storage-prune notices can now reach your team.

+

— Luminary

+
+ `, + }); +} diff --git a/server/quota.mjs b/server/quota.mjs new file mode 100644 index 0000000..c9b7715 --- /dev/null +++ b/server/quota.mjs @@ -0,0 +1,454 @@ +import { + QUOTA_BYTES, + QUOTA_TARGET_RATIO, + QUOTA_WARN_RATIO, + PUBLIC_URL, +} from './config.mjs'; +import { + allQuotaRows, + deletedPhotoBytes, + getPhoto, + listEvents, + listPhotos, + livePhotoBytesByOwner, + quotaRow, + removeEvent, + removePhoto, + saveQuota, + users, +} from './db.mjs'; +import { removeAsset } from './storage.mjs'; +import { clearDenoised } from './denoise.mjs'; +import { mailStatus, sendAppMail } from './mail.mjs'; + +const GIB = 1024 ** 3; +const PRUNE_GRACE_MS = 24 * 60 * 60 * 1000; +const WARNING_COOLDOWN_MS = 24 * 60 * 60 * 1000; + +const fmtBytes = (bytes) => { + if (bytes >= GIB) return `${(bytes / GIB).toFixed(1)} GB`; + if (bytes >= 1024 ** 2) return `${Math.round(bytes / 1024 ** 2)} MB`; + return `${Math.max(0, Math.round(bytes / 1024))} KB`; +}; + +const fmtDate = (ms) => + new Date(ms).toLocaleString(undefined, { + weekday: 'short', + month: 'short', + day: 'numeric', + hour: 'numeric', + minute: '2-digit', + }); + +const appUrl = () => PUBLIC_URL || 'http://localhost:8787'; + +function safePlan(value) { + if (!value) return null; + if (typeof value === 'object') return value; + try { + return JSON.parse(value); + } catch { + return null; + } +} + +function limitFor(userId) { + const row = quotaRow(userId); + return Math.max(1, Number(row?.bytes_limit) || QUOTA_BYTES); +} + +/** Total bytes represented by an account's photo records, including Trash. */ +export function quotaUsage(userId) { + return livePhotoBytesByOwner(userId) + deletedPhotoBytes(userId); +} + +export function quotaState(userId) { + const row = quotaRow(userId); + const limit = limitFor(userId); + const used = quotaUsage(userId); + const ratio = limit > 0 ? used / limit : 0; + return { + userId, + limit, + used, + remaining: Math.max(0, limit - used), + ratio, + percent: Math.min(999, Math.round(ratio * 100)), + warn: used >= limit * QUOTA_WARN_RATIO, + over: used > limit, + warnAt: Math.round(limit * QUOTA_WARN_RATIO), + pruneAt: row?.prune_at ?? null, + prunePlan: safePlan(row?.prune_plan), + pruneNotifiedAt: row?.prune_notified_at ?? null, + lastWarningAt: row?.last_quota_email_at ?? null, + }; +} + +/** + * Oldest events are removed first. If the oldest events are not enough, loose + * photos are added oldest-first. The stored plan is what the warning email + * describes, so a later upload cannot silently get caught up in the prune. + */ +export function prunePlan(userId, limit = limitFor(userId)) { + const photos = listPhotos(userId); + const groups = new Map(); + for (const photo of photos) { + const key = photo.eventId || ''; + if (!groups.has(key)) groups.set(key, []); + groups.get(key).push(photo); + } + + const events = listEvents(userId) + .map((event) => { + const members = groups.get(event.id) ?? []; + return { + id: event.id, + name: event.name || 'Untitled event', + createdAt: event.createdAt ?? 0, + photos: members.map((photo) => photo.id), + bytes: members.reduce((sum, photo) => sum + (Number(photo.size) || 0), 0), + }; + }) + .filter((event) => event.photos.length) + .sort((a, b) => a.createdAt - b.createdAt); + + const target = Math.max(0, Math.floor(limit * QUOTA_TARGET_RATIO)); + const used = photos.reduce((sum, photo) => sum + (Number(photo.size) || 0), 0); + let projected = used; + const chosenEvents = []; + const chosenPhotoIds = new Set(); + + for (const event of events) { + if (projected <= target) break; + chosenEvents.push(event); + event.photos.forEach((id) => chosenPhotoIds.add(id)); + projected -= event.bytes; + } + + const loosePhotos = []; + if (projected > target) { + const remaining = photos + .filter((photo) => !chosenPhotoIds.has(photo.id)) + .filter((photo) => !events.some((event) => event.id === photo.eventId)) + .sort((a, b) => (a.createdAt ?? 0) - (b.createdAt ?? 0)); + for (const photo of remaining) { + if (projected <= target) break; + const bytes = Number(photo.size) || 0; + loosePhotos.push({ id: photo.id, name: photo.name || photo.id, bytes }); + projected -= bytes; + } + } + + return { + targetBytes: target, + usedBytes: used, + projectedBytes: Math.max(0, projected), + freedBytes: Math.max(0, used - Math.max(0, projected)), + events: chosenEvents, + photos: loosePhotos, + }; +} + +function planText(plan) { + const lines = []; + for (const event of plan.events) { + lines.push(`• ${event.name} — ${event.photos.length} photo${event.photos.length === 1 ? '' : 's'}, ${fmtBytes(event.bytes)}`); + } + if (plan.photos.length) { + lines.push( + `• ${plan.photos.length} loose photo${plan.photos.length === 1 ? '' : 's'} — ${fmtBytes(plan.photos.reduce((sum, photo) => sum + photo.bytes, 0))}`, + ); + } + return lines.join('\n'); +} + +function planHtml(plan) { + const rows = plan.events + .map( + (event) => + `
  • ${escapeHtml(event.name)} — ${event.photos.length} photo${event.photos.length === 1 ? '' : 's'}, ${fmtBytes(event.bytes)}
  • `, + ) + .join(''); + const loose = plan.photos.length + ? `
  • ${plan.photos.length} unassigned photo${plan.photos.length === 1 ? '' : 's'} — ${fmtBytes(plan.photos.reduce((sum, photo) => sum + photo.bytes, 0))}
  • ` + : ''; + return `
      ${rows}${loose}
    `; +} + +function escapeHtml(value) { + return String(value) + .replaceAll('&', '&') + .replaceAll('<', '<') + .replaceAll('>', '>') + .replaceAll('"', '"'); +} + +async function pruneWarningEmail(user, state, plan, pruneAt) { + const when = fmtDate(pruneAt); + const subject = `Luminary: ${fmtBytes(plan.freedBytes)} will be pruned in 24 hours`; + const text = [ + `Hi ${user.name || user.email},`, + '', + `Your Luminary storage is ${state.percent}% full (${fmtBytes(state.used)} of ${fmtBytes(state.limit)}).`, + `An administrator scheduled a storage cleanup for ${when} — about 24 hours from now.`, + '', + 'Unless you free space before then, Luminary will permanently remove the oldest content listed below:', + planText(plan) || '• No individual items were identified.', + '', + `This should free about ${fmtBytes(plan.freedBytes)} and leave your library around ${fmtBytes(plan.projectedBytes)}.`, + '', + `Review your library now: ${appUrl()}`, + '', + 'Deleting photos or emptying Trash before the scheduled time will cancel or reduce the cleanup.', + '— Luminary', + ].join('\n'); + + const html = ` +
    +

    Storage cleanup scheduled

    +

    Hi ${escapeHtml(user.name || user.email)},

    +

    Your Luminary storage is ${state.percent}% full + (${fmtBytes(state.used)} of ${fmtBytes(state.limit)}).

    +

    + An administrator scheduled a storage cleanup for + ${escapeHtml(when)} — about 24 hours from now. +

    +

    Unless you free space before then, Luminary will permanently remove the oldest content + listed below:

    + ${planHtml(plan) || '

    No individual items were identified.

    '} +

    This should free about ${fmtBytes(plan.freedBytes)} and leave your + library around ${fmtBytes(plan.projectedBytes)}.

    +

    Review your library

    +

    Deleting photos or emptying Trash before the scheduled + time will cancel or reduce the cleanup.
    — Luminary

    +
    + `; + await sendAppMail({ to: user.email, subject, text, html }); +} + +async function quotaWarningEmail(user, state) { + const subject = `Luminary: your storage is ${state.percent}% full`; + const text = [ + `Hi ${user.name || user.email},`, + '', + `You are nearing your Luminary storage quota: ${fmtBytes(state.used)} used of ${fmtBytes(state.limit)} (${state.percent}%).`, + '', + 'Free some space by deleting photos you no longer need or emptying Trash. If the quota is exceeded, an administrator can schedule a 24-hour storage cleanup.', + '', + `Open Luminary: ${appUrl()}`, + '', + '— Luminary', + ].join('\n'); + const html = ` +
    +

    You are nearing your storage quota

    +

    Hi ${escapeHtml(user.name || user.email)},

    +

    You have used ${fmtBytes(state.used)} of your + ${fmtBytes(state.limit)} Luminary quota (${state.percent}%).

    +

    Delete photos you no longer need or empty Trash to free space. If the quota is exceeded, + an administrator can schedule a 24-hour storage cleanup.

    +

    Open Luminary

    +

    — Luminary

    +
    + `; + await sendAppMail({ to: user.email, subject, text, html }); +} + +export async function schedulePrune(userId) { + const user = users.byId(userId); + if (!user) throw new Error('No such account'); + if (!mailStatus().configured) { + throw new Error( + 'Email notifications must be configured before a prune can be scheduled, so the 24-hour warning can reach the user.', + ); + } + const state = quotaState(userId); + const plan = prunePlan(userId, state.limit); + if (plan.freedBytes <= 0) { + throw new Error('There is nothing old enough to prune. The account is already below the cleanup target.'); + } + if (plan.projectedBytes > state.limit) { + throw new Error( + 'The oldest content cannot bring this account under its quota. Raise the limit or remove large events manually.', + ); + } + + const pruneAt = Date.now() + PRUNE_GRACE_MS; + await pruneWarningEmail(user, state, plan, pruneAt); + saveQuota(userId, { + pruneAt, + prunePlan: plan, + pruneNotifiedAt: Date.now(), + }); + return { pruneAt, plan, state: quotaState(userId), warningSent: true }; +} + +export function cancelPrune(userId) { + saveQuota(userId, { pruneAt: null, prunePlan: null, pruneNotifiedAt: null }); + return quotaState(userId); +} + +export async function warnUser(userId) { + const user = users.byId(userId); + if (!user) throw new Error('No such account'); + const state = quotaState(userId); + if (!state.warn && !state.over) throw new Error('This account is below its warning threshold'); + await quotaWarningEmail(user, state); + saveQuota(userId, { lastQuotaEmailAt: Date.now() }); + return state; +} + +export function setUserQuota(userId, bytes) { + if (!users.byId(userId)) throw new Error('No such account'); + const limit = Number(bytes); + const min = GIB; + const max = 10_000 * GIB; + if (!Number.isFinite(limit) || limit < min || limit > max) { + throw new Error('Choose a quota between 1 GB and 10 TB'); + } + saveQuota(userId, { bytesLimit: Math.round(limit) }); + return quotaState(userId); +} + +export function quotasForAdmin() { + return users.list().map((user) => { + const state = quotaState(user.id); + return { + ...state, + user, + plan: state.prunePlan ?? prunePlan(user.id, state.limit), + }; + }); +} + +export async function sendTestNotification(to) { + if (!mailStatus().configured) { + throw new Error('Add the Gmail address and app password first'); + } + await sendAppMail({ + to, + subject: 'Luminary email notifications are working', + text: 'This is a test message from Luminary. Quota warnings and prune notices are configured correctly.', + html: '

    This is a test message from Luminary. Quota warnings and prune notices are configured correctly.

    ', + }); +} + +async function executePlan(userId, plan) { + let removedPhotos = 0; + let freedBytes = 0; + const eventIds = new Set(); + + for (const event of plan.events ?? []) eventIds.add(event.id); + + for (const event of plan.events ?? []) { + for (const photoId of event.photos ?? []) { + const photo = getPhoto(photoId); + if (!photo) continue; + freedBytes += Number(photo.size) || 0; + removePhoto(photoId); + clearDenoised(photoId); + await removeAsset(photoId); + removedPhotos += 1; + } + } + for (const entry of plan.photos ?? []) { + const photo = getPhoto(entry.id); + if (!photo) continue; + freedBytes += Number(photo.size) || 0; + removePhoto(entry.id); + clearDenoised(entry.id); + await removeAsset(entry.id); + removedPhotos += 1; + } + for (const eventId of eventIds) { + if (!listPhotos(userId).some((photo) => photo.eventId === eventId)) removeEvent(eventId); + } + return { removedPhotos, freedBytes }; +} + +async function pruneDueAccounts() { + const now = Date.now(); + for (const row of allQuotaRows()) { + if (!row.prune_at || Number(row.prune_at) > now) continue; + const user = users.byId(row.user_id); + const plan = safePlan(row.prune_plan); + if (!user || !plan) { + saveQuota(row.user_id, { pruneAt: null, prunePlan: null, pruneNotifiedAt: null }); + continue; + } + try { + const before = quotaUsage(row.user_id); + const result = await executePlan(row.user_id, plan); + const after = quotaUsage(row.user_id); + saveQuota(row.user_id, { + pruneAt: null, + prunePlan: null, + pruneNotifiedAt: null, + }); + const state = quotaState(row.user_id); + await sendAppMail({ + to: user.email, + subject: 'Luminary: your scheduled storage cleanup is complete', + text: [ + `Hi ${user.name || user.email},`, + '', + `The scheduled Luminary cleanup removed ${result.removedPhotos} photo${result.removedPhotos === 1 ? '' : 's'} and freed ${fmtBytes(before - after)}.`, + `Your library is now ${fmtBytes(after)} of ${fmtBytes(state.limit)} (${state.percent}%).`, + '', + `Open Luminary: ${appUrl()}`, + '', + '— Luminary', + ].join('\n'), + html: ` +
    +

    Scheduled cleanup complete

    +

    Hi ${escapeHtml(user.name || user.email)},

    +

    The scheduled Luminary cleanup removed + ${result.removedPhotos} photo${result.removedPhotos === 1 ? '' : 's'} + and freed ${fmtBytes(before - after)}.

    +

    Your library is now ${fmtBytes(after)} of ${fmtBytes(state.limit)} (${state.percent}%).

    +

    — Luminary

    +
    + `, + }).catch((err) => console.error(`[luminary] prune email to ${user.email} failed: ${err.message}`)); + } catch (err) { + console.error(`[luminary] prune for ${user.email} failed: ${err.message}`); + saveQuota(row.user_id, { pruneAt: null, prunePlan: null, pruneNotifiedAt: null }); + } + } +} + +async function sendQuotaWarnings() { + if (!mailStatus().configured) return; + const now = Date.now(); + for (const user of users.list()) { + if (user.disabled) continue; + const row = quotaRow(user.id); + if (row?.prune_at) continue; + const state = quotaState(user.id); + if (!state.warn) continue; + if (row?.last_quota_email_at && now - Number(row.last_quota_email_at) < WARNING_COOLDOWN_MS) { + continue; + } + try { + await quotaWarningEmail(user, state); + saveQuota(user.id, { lastQuotaEmailAt: now }); + } catch (err) { + console.error(`[luminary] quota warning to ${user.email} failed: ${err.message}`); + } + } +} + +export function startQuotaWorker() { + const tick = () => { + void pruneDueAccounts().catch((err) => + console.error(`[luminary] quota worker: ${err.message}`), + ); + void sendQuotaWarnings().catch((err) => + console.error(`[luminary] quota warning worker: ${err.message}`), + ); + }; + const timer = setInterval(tick, 5 * 60 * 1000); + timer.unref?.(); + setTimeout(tick, 7000).unref?.(); +} diff --git a/server/raw.mjs b/server/raw.mjs new file mode 100644 index 0000000..8d05427 --- /dev/null +++ b/server/raw.mjs @@ -0,0 +1,214 @@ +import { RAW_PREVIEW_EDGE } from './config.mjs'; +import { encodeRgb, jpegInfo, loadSharp, toJpegProxy } from './imaging.mjs'; +import { loadLibRaw, rawPool } from './libraw-pool.mjs'; + +/** Every raw container the pipeline will attempt, grouped by vendor family. */ +export const RAW_EXTENSIONS = new Set([ + // Canon + 'cr2', 'cr3', 'crw', + // Nikon + 'nef', 'nrw', + // Sony + 'arw', 'srf', 'sr2', + // Olympus / OM System + 'orf', + // Panasonic / Leica + 'rw2', 'raw', 'rwl', + // Fujifilm + 'raf', + // Pentax / Ricoh + 'pef', 'dng', + // Samsung, Hasselblad, Leaf, Phase One, Sigma, Epson, Kodak, Minolta + 'srw', '3fr', 'fff', 'iiq', 'x3f', 'erf', 'k25', 'kdc', 'dcr', 'mos', 'mrw', 'mef', 'sraw', +]); + +export function isRawName(name = '') { + const ext = name.split('.').pop()?.toLowerCase() ?? ''; + return RAW_EXTENSIONS.has(ext); +} + +/** True when the buffer starts with a container signature LibRaw can open. */ +export function looksLikeRaw(buffer) { + if (!buffer || buffer.length < 64) return false; + const hex4 = buffer.subarray(0, 4).toString('hex'); + const ascii = buffer.subarray(0, 16).toString('latin1'); + if (hex4 === '49492a00' || hex4 === '4d4d002a') return true; // TIFF family + if (hex4 === '4949524f' || hex4 === '4d4d4f52') return true; // ORF + if (hex4 === '49495500') return true; // RW2 + if (hex4 === '49494949') return true; // Phase One IIQ + if (ascii.startsWith('FUJIFILMCCD-RAW')) return true; // RAF + if (ascii.startsWith('FOVb')) return true; // X3F + if (buffer.subarray(4, 8).toString('latin1') === 'ftyp') return true; // CR3 + return false; +} + +let engineState = 'unloaded'; + +export async function rawEngine() { + if (engineState === 'unloaded') { + try { + await loadLibRaw(); + engineState = 'ready'; + } catch { + engineState = 'missing'; + } + } + return engineState; +} + +const DECODE_SETTINGS = { + outputBps: 8, + useCameraWb: true, + outputColor: 1, // sRGB + userQual: 3, + highlight: 0, + noAutoBright: false, + // Use the orientation stored in the raw container: phone and DSLR files often + // record the shot rotated (EXIF 6/8), and demosaicing without it produces a + // sideways proxy that no later step can fix without losing the original axes. + userFlip: -1, + useFujiRotate: -1, +}; + +/** Turns one LibRaw `imageData()` result into an interleaved RGB buffer. */ +function toRgb(img) { + if (!img || !img.width || !img.height || !img.data) throw new Error('LibRaw returned no pixels'); + const width = Number(img.width); + const height = Number(img.height); + const colors = Number(img.colors ?? 3); + const bits = Number(img.bits ?? 8); + const src = img.data; + const pixelCount = width * height; + const needed = pixelCount * colors * (bits > 8 ? 2 : 1); + if (src.length < needed) { + throw new Error(`LibRaw buffer too small (${src.length} bytes for ${width}×${height}×${colors})`); + } + + const rgb = Buffer.alloc(pixelCount * 3); + if (bits > 8) { + const view = new Uint16Array(src.buffer, src.byteOffset, Math.floor(src.byteLength / 2)); + for (let i = 0; i < pixelCount; i++) { + const s = i * colors; + rgb[i * 3] = view[s] >> 8; + rgb[i * 3 + 1] = view[s + 1] >> 8; + rgb[i * 3 + 2] = view[s + 2] >> 8; + } + } else { + for (let i = 0; i < pixelCount; i++) { + const s = i * colors; + rgb[i * 3] = src[s]; + rgb[i * 3 + 1] = src[s + 1]; + rgb[i * 3 + 2] = src[s + 2]; + } + } + return { rgb, width, height }; +} + +/** + * Full demosaic through a pooled LibRaw worker. `open()` only unpacks the file; + * the pixels come from `imageData()`, which rejects when the camera is unsupported. + */ +async function demosaic(buffer) { + if ((await rawEngine()) !== 'ready') throw new Error('LibRaw is not installed'); + return rawPool.use(async (lib) => { + // 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. + await lib.open(Buffer.from(buffer), DECODE_SETTINGS); + return toRgb(await lib.imageData()); + }); +} + +const SOI = Buffer.from([0xff, 0xd8, 0xff]); +const EOI = Buffer.from([0xff, 0xd9]); + +/** Pull the largest embedded JPEG straight out of a raw container. */ +export function extractEmbeddedJpeg(buffer) { + let best = null; + let from = 0; + while (from < buffer.length - 3) { + const start = buffer.indexOf(SOI, from); + if (start < 0) break; + const end = buffer.indexOf(EOI, start + 3); + if (end < 0) break; + const length = end + 2 - start; + if (length > 4096 && (!best || length > best.length)) best = buffer.subarray(start, end + 2); + from = end + 2; + } + return best; +} + +/** Camera preview, preferably the one LibRaw knows the offset and length of. */ +async function embeddedPreview(buffer) { + if ((await rawEngine()) === 'ready') { + try { + const thumb = await rawPool.use(async (lib) => { + await lib.open(Buffer.from(buffer), { useCameraWb: true }); + return lib.thumbnailData(); + }); + if (thumb?.data && thumb.format === 'jpeg' && thumb.data.length > 4096) { + return Buffer.from(thumb.data); + } + } catch { + /* fall through to the byte scan */ + } + } + return extractEmbeddedJpeg(buffer); +} + +/** + * 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. + */ +export async function decodeRaw(buffer) { + let librawError = null; + if (looksLikeRaw(buffer)) { + try { + const { rgb, width, height } = await demosaic(buffer); + const encoded = await encodeRgb(rgb, width, height, 92, RAW_PREVIEW_EDGE); + return { + jpeg: encoded.data, + width: encoded.width, + height: encoded.height, + engine: 'libraw', + ext: encoded.ext, + }; + } catch (err) { + librawError = err instanceof Error ? err.message : String(err); + } + } else { + librawError = 'not a recognised raw container'; + } + + const embedded = await embeddedPreview(buffer); + if (embedded) { + const proxy = await toJpegProxy(embedded, RAW_PREVIEW_EDGE); + if (proxy) { + const size = await jpegInfo(proxy.data); + return { + jpeg: proxy.data, + width: size?.width || proxy.width, + height: size?.height || proxy.height, + engine: 'embedded', + ext: proxy.ext, + 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( + `Could not decode this raw file. ${librawError ? `LibRaw said: ${librawError}.` : 'LibRaw is not installed.'}`, + ); +} + +export async function rawSupport() { + const engine = await rawEngine(); + const sharp = await loadSharp(); + return { + libraw: engine === 'ready', + sharp: Boolean(sharp), + workers: rawPool.size, + busy: rawPool.stats.busy, + formats: [...RAW_EXTENSIONS].sort(), + }; +} diff --git a/server/storage.mjs b/server/storage.mjs new file mode 100644 index 0000000..a1341d6 --- /dev/null +++ b/server/storage.mjs @@ -0,0 +1,325 @@ +import fs from 'node:fs'; +import fsp from 'node:fs/promises'; +import path from 'node:path'; +import { DATA_DIR } from './config.mjs'; +import { kv } from './db.mjs'; + +/** + * Where image files live. The database always stays in DATA_DIR; only the + * originals/previews/thumbs folders move when an admin picks another location. + */ +const SETTINGS_KEY = 'storageRoot'; +const SUBDIRS = ['originals', 'previews', 'thumbs', 'proofs', 'proofThumbs', 'denoised']; +const SAFE = /^[A-Za-z0-9_-]{1,80}$/; + +let cachedRoot = null; + +export function defaultRoot() { + return DATA_DIR; +} + +export function storageRoot() { + if (cachedRoot) return cachedRoot; + const saved = kv.get(SETTINGS_KEY); + cachedRoot = typeof saved === 'string' && saved.trim() ? path.resolve(saved) : DATA_DIR; + return cachedRoot; +} + +export function isCustomRoot() { + return path.resolve(storageRoot()) !== path.resolve(DATA_DIR); +} + +export function dirs(root = storageRoot()) { + return { + originals: path.join(root, 'originals'), + previews: path.join(root, 'previews'), + thumbs: path.join(root, 'thumbs'), + denoised: path.join(root, 'denoised'), + proofs: path.join(root, 'proofs'), + proofThumbs: path.join(root, 'proofThumbs'), + }; +} + +export function ensureDirs(root = storageRoot()) { + for (const dir of Object.values(dirs(root))) fs.mkdirSync(dir, { recursive: true }); +} + +ensureDirs(); + +function safeId(id) { + if (!SAFE.test(id)) throw new Error('Invalid asset id'); + return id; +} + +/** + * Reads are lookups: a malformed id simply has no file, so it must not throw a + * 500 out of the request handler. Writers keep the strict check. + */ +function lookupId(id) { + return typeof id === 'string' && SAFE.test(id) ? id : null; +} + +function listFiles(dir) { + try { + return fs.readdirSync(dir); + } catch { + return []; + } +} + +/** Original files keep their real extension so a raw can be recovered later. */ +function originalPath(id, ext = 'bin') { + ensureDirs(); + return path.join( + storageRoot(), + 'originals', + `${safeId(id)}.${ext.replace(/[^a-z0-9]/gi, '') || 'bin'}`, + ); +} + +export async function writeOriginal(id, ext, data) { + const target = originalPath(id, ext); + await fsp.writeFile(target, data); + return target; +} + +export function findOriginal(id) { + const safe = lookupId(id); + if (!safe) return null; + const { originals } = dirs(); + const prefix = `${safe}.`; + for (const name of listFiles(originals)) { + if (name.startsWith(prefix)) return path.join(originals, name); + } + return null; +} + +export async function writePreview(id, data, ext = 'jpg') { + ensureDirs(); + const target = path.join(storageRoot(), 'previews', `${safeId(id)}.${ext}`); + await fsp.writeFile(target, data); + return target; +} + +export function findPreview(id) { + const safe = lookupId(id); + if (!safe) return null; + const { previews } = dirs(); + for (const ext of ['jpg', 'png']) { + const p = path.join(previews, `${safe}.${ext}`); + if (fs.existsSync(p)) return p; + } + return null; +} + +/** + * Denoised proxies, keyed by the hash of the parameters that produced them, so + * switching Amount back to a previous value reuses the file instead of spending + * another few seconds of CPU on an identical result. + */ +export function denoisedPath(id, key) { + ensureDirs(); + const safeKey = String(key).replace(/[^a-z0-9]/gi, ''); + return path.join(storageRoot(), 'denoised', `${safeId(id)}.${safeKey}.jpg`); +} + +/** With no key, the most recently written result wins. */ +export function findDenoised(id, key) { + const safe = lookupId(id); + if (!safe) return null; + const dir = path.join(storageRoot(), 'denoised'); + if (key) { + const exact = denoisedPath(safe, key); + return fs.existsSync(exact) ? exact : null; + } + const names = listFiles(dir).filter((name) => name.startsWith(`${safe}.`)); + if (names.length === 0) return null; + names.sort( + (a, b) => + fs.statSync(path.join(dir, b)).mtimeMs - fs.statSync(path.join(dir, a)).mtimeMs, + ); + return path.join(dir, names[0]); +} + +/** Remove every denoised render for a photo, sparing `keepKey` if given. */ +export function removeDenoised(id, keepKey) { + const safe = lookupId(id); + if (!safe) return 0; + const dir = path.join(storageRoot(), 'denoised'); + const key = keepKey ? String(keepKey).replace(/[^a-z0-9]/gi, '') : null; + const keep = key ? `${safe}.${key}.jpg` : null; + let removed = 0; + for (const name of listFiles(dir)) { + if (!name.startsWith(`${safe}.`) || name === keep) continue; + fs.rmSync(path.join(dir, name), { force: true }); + removed += 1; + } + return removed; +} + +export async function writeThumb(id, data) { + ensureDirs(); + const target = path.join(storageRoot(), 'thumbs', `${safeId(id)}.jpg`); + await fsp.writeFile(target, data); + return target; +} + +export function findThumb(id) { + const safe = lookupId(id); + if (!safe) return null; + const p = path.join(storageRoot(), 'thumbs', `${safe}.jpg`); + return fs.existsSync(p) ? p : null; +} + +/** Rendered proof used by client galleries; separate from the editable proxy. */ +export async function writeProof(id, data) { + ensureDirs(); + const target = path.join(storageRoot(), 'proofs', `${safeId(id)}.jpg`); + await fsp.writeFile(target, data); + return target; +} + +export function findProof(id) { + const safe = lookupId(id); + if (!safe) return null; + const p = path.join(storageRoot(), 'proofs', `${safe}.jpg`); + return fs.existsSync(p) ? p : null; +} + +export async function writeProofThumb(id, data) { + ensureDirs(); + const target = path.join(storageRoot(), 'proofThumbs', `${safeId(id)}.jpg`); + await fsp.writeFile(target, data); + return target; +} + +export function findProofThumb(id) { + const safe = lookupId(id); + if (!safe) return null; + const p = path.join(storageRoot(), 'proofThumbs', `${safe}.jpg`); + return fs.existsSync(p) ? p : null; +} + +export async function removeAsset(id) { + const files = [ + findOriginal(id), + findPreview(id), + findThumb(id), + findProof(id), + findProofThumb(id), + ]; + await Promise.all(files.map((f) => (f ? fsp.rm(f, { force: true }) : Promise.resolve()))); +} + +export function storageBytes(root = storageRoot()) { + let total = 0; + for (const dir of Object.values(dirs(root))) { + for (const name of listFiles(dir)) { + try { + total += fs.statSync(path.join(dir, name)).size; + } catch { + /* file vanished mid-scan */ + } + } + } + return total; +} + +/** + * Validates a destination and proves it is writable before anything moves. + * Returns the resolved absolute path. + */ +export async function checkRoot(input) { + if (typeof input !== 'string' || !input.trim()) throw new Error('Enter a folder path'); + const raw = input.trim(); + if (raw.includes('\0')) throw new Error('That path is not valid'); + if (!path.isAbsolute(raw)) throw new Error('Use an absolute path, for example /srv/luminary-photos'); + const root = path.resolve(raw); + if (root === path.parse(root).root) throw new Error('Pick a folder below the filesystem root'); + + const existing = await fsp.stat(root).catch(() => null); + if (existing && !existing.isDirectory()) throw new Error('That path is a file, not a folder'); + await fsp.mkdir(root, { recursive: true }); + + const probe = path.join(root, `.luminary-write-test-${process.pid}-${Date.now()}`); + try { + await fsp.writeFile(probe, 'ok'); + await fsp.rm(probe, { force: true }); + } catch { + throw new Error('That folder is not writable by the Luminary server'); + } + return root; +} + +async function moveTree(from, to, moved) { + let files = 0; + let bytes = 0; + await fsp.mkdir(to, { recursive: true }); + for (const name of listFiles(from)) { + const src = path.join(from, name); + const dst = path.join(to, name); + const stat = await fsp.stat(src).catch(() => null); + if (!stat || !stat.isFile()) continue; + try { + await fsp.rename(src, dst); + } catch { + // Different filesystem (EXDEV) or an existing target: copy over, then drop. + await fsp.copyFile(src, dst); + await fsp.rm(src, { force: true }); + } + moved.push([src, dst]); + files += 1; + bytes += stat.size; + } + return { files, bytes }; +} + +/** Puts files back where they came from if a relocation fails partway. */ +async function rollback(moved) { + for (const [src, dst] of [...moved].reverse()) { + try { + await fsp.rename(dst, src); + } catch { + try { + await fsp.copyFile(dst, src); + await fsp.rm(dst, { force: true }); + } catch { + /* leave the copy in place rather than lose the file */ + } + } + } +} + +/** + * Points storage at a new folder, moving every existing image across so the + * library keeps working. Returns what moved and what was skipped. + */ +export async function setStorageRoot(input) { + const next = await checkRoot(input); + const current = storageRoot(); + + if (path.resolve(next) === path.resolve(current)) { + return { root: current, previous: current, files: 0, bytes: 0, moved: false }; + } + + const from = dirs(current); + const to = dirs(next); + const moved = []; + let files = 0; + let bytes = 0; + try { + for (const kind of SUBDIRS) { + const result = await moveTree(from[kind], to[kind], moved); + files += result.files; + bytes += result.bytes; + } + } catch { + await rollback(moved); + throw new Error('Could not move the existing images; the storage folder was left unchanged'); + } + + kv.set(SETTINGS_KEY, next); + cachedRoot = next; + ensureDirs(); + return { root: next, previous: current, files, bytes, moved: true }; +} diff --git a/server/zip.mjs b/server/zip.mjs new file mode 100644 index 0000000..cc6c556 --- /dev/null +++ b/server/zip.mjs @@ -0,0 +1,123 @@ +/** + * Minimal stored-ZIP writer for server-side gallery downloads. JPEGs are + * already compressed, so entries are stored rather than deflated. + */ + +const MAX_ENTRIES = 0xffff; +const MAX_SIZE = 0xffffffff; + +const CRC_TABLE = (() => { + const table = new Uint32Array(256); + for (let i = 0; i < 256; i++) { + let c = i; + for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1; + table[i] = c >>> 0; + } + return table; +})(); + +function crc32(bytes) { + let c = 0xffffffff; + for (let i = 0; i < bytes.length; i++) c = CRC_TABLE[(c ^ bytes[i]) & 0xff] ^ (c >>> 8); + return (c ^ 0xffffffff) >>> 0; +} + +function dosStamp(date) { + const year = Math.min(2107, Math.max(1980, date.getFullYear())); + const time = (date.getHours() << 11) | (date.getMinutes() << 5) | (date.getSeconds() >> 1); + const day = ((year - 1980) << 9) | ((date.getMonth() + 1) << 5) | date.getDate(); + return { time, day }; +} + +function uniqueName(name, used) { + const clean = String(name || 'photo.jpg') + .replace(/[\\/]+/g, '-') + .replace(/[\u0000-\u001f]/g, '') + .trim() || 'photo.jpg'; + if (!used.has(clean.toLowerCase())) { + used.add(clean.toLowerCase()); + return clean; + } + const dot = clean.lastIndexOf('.'); + const stem = dot > 0 ? clean.slice(0, dot) : clean; + const ext = dot > 0 ? clean.slice(dot) : ''; + let n = 2; + while (used.has(`${stem} (${n})${ext}`.toLowerCase())) n += 1; + const result = `${stem} (${n})${ext}`; + used.add(result.toLowerCase()); + return result; +} + +export function createZip(entries, date = new Date()) { + if (!entries.length) throw new Error('Nothing to archive'); + if (entries.length > MAX_ENTRIES) throw new Error('Too many files for one ZIP archive'); + + const { time, day } = dosStamp(date); + const locals = []; + const central = []; + const used = new Set(); + let offset = 0; + + for (const entry of entries) { + if (!Buffer.isBuffer(entry.data)) throw new Error('ZIP entries must contain buffers'); + const name = Buffer.from(uniqueName(entry.name, used), 'utf8'); + const data = entry.data; + if (data.length > MAX_SIZE) throw new Error(`${entry.name} is too large for a ZIP archive`); + const crc = crc32(data); + + const local = Buffer.alloc(30); + local.writeUInt32LE(0x04034b50, 0); + local.writeUInt16LE(20, 4); + local.writeUInt16LE(0x0800, 6); + local.writeUInt16LE(0, 8); + local.writeUInt16LE(time, 10); + local.writeUInt16LE(day, 12); + local.writeUInt32LE(crc, 14); + local.writeUInt32LE(data.length, 18); + local.writeUInt32LE(data.length, 22); + local.writeUInt16LE(name.length, 26); + local.writeUInt16LE(0, 28); + + locals.push(local, name, data); + central.push({ name, crc, size: data.length, offset }); + offset += local.length + name.length + data.length; + } + + const centralStart = offset; + let centralSize = 0; + for (const file of central) { + const record = Buffer.alloc(46); + record.writeUInt32LE(0x02014b50, 0); + record.writeUInt16LE(20, 4); + record.writeUInt16LE(20, 6); + record.writeUInt16LE(0x0800, 8); + record.writeUInt16LE(0, 10); + record.writeUInt16LE(time, 12); + record.writeUInt16LE(day, 14); + record.writeUInt32LE(file.crc, 16); + record.writeUInt32LE(file.size, 20); + record.writeUInt32LE(file.size, 24); + record.writeUInt16LE(file.name.length, 28); + record.writeUInt16LE(0, 30); + record.writeUInt16LE(0, 32); + record.writeUInt16LE(0, 34); + record.writeUInt16LE(0, 36); + record.writeUInt32LE(0, 38); + record.writeUInt32LE(file.offset, 42); + locals.push(record, file.name); + centralSize += record.length + file.name.length; + } + + const end = Buffer.alloc(22); + end.writeUInt32LE(0x06054b50, 0); + end.writeUInt16LE(0, 4); + end.writeUInt16LE(0, 6); + end.writeUInt16LE(central.length, 8); + end.writeUInt16LE(central.length, 10); + end.writeUInt32LE(centralSize, 12); + end.writeUInt32LE(centralStart, 16); + end.writeUInt16LE(0, 20); + locals.push(end); + + return Buffer.concat(locals); +} diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..31954d3 --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,2187 @@ +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import AdminPanel from './components/AdminPanel'; +import CloudPanel from './components/CloudPanel'; +import CommandPalette from './components/CommandPalette'; +import ContextMenu, { type MenuEntry } from './components/ContextMenu'; +import Develop from './components/Develop'; +import EventSidebar from './components/EventSidebar'; +import ExportModal from './components/ExportModal'; +import CompareView from './components/CompareView'; +import FilterBar from './components/FilterBar'; +import ImportModal from './components/ImportModal'; +import LibraryGrid from './components/LibraryGrid'; +import MergeModal from './components/MergeModal'; +import PasteSettingsModal from './components/PasteSettingsModal'; +import PrintModal from './components/PrintModal'; +import ShareModal from './components/ShareModal'; +import Shortcuts from './components/Shortcuts'; +import Stars, { ColorSwatches, FlagButtons } from './components/Stars'; +import TopBar from './components/TopBar'; +import { usePersistentState } from './lib/usePersistentState'; +import { + currentUser, + deleteEventRemote, + deletePhotoRemote, + getHealth, + getQuota, + login as apiLogin, + logout as apiLogout, + pullAll, + pullProofs, + pushEvent, + pushPhoto, + register as apiRegister, + uploadOriginal, +} from './lib/api'; +import type { Health, ProofSummary, QuotaState, SessionUser } from './lib/api'; +import { + deleteEventRecord, + deletePhotoRecord, + getAllEvents, + getAllPhotos, + getAsset, + getKV, + putAsset, + putEvent, + putPhoto, + setKV, +} from './lib/db'; +import type { ExportOptions, ExportRecipe } from './lib/export'; +import { DEFAULT_EXPORT, renderPhotoBlob } from './lib/export'; +import { COLOR_LABELS, defaultEdits, isEdited, normalizePhoto } from './lib/edits'; +import { applyEditSections, type EditSectionId } from './lib/editSections'; +import type { MergeResult } from './lib/merge'; +import { evictBitmap } from './lib/images'; +import { uid } from './lib/import'; +import { PRESETS } from './lib/presets'; +import type { + Edits, + EventRecord, + Filters, + LocalLayer, + MetadataPreset, + PhotoRecord, + Preset, + SmartCollection, + Snapshot, + SortKey, + ViewMode, +} from './types'; + +const EMPTY_FILTERS: Filters = { + minRating: 0, + flag: 'any', + colors: [], + text: '', + editedOnly: false, + unrated: false, + proofed: false, + clientStatus: 'any', +}; + +async function blobToBase64(blob: Blob): Promise { + const bytes = new Uint8Array(await blob.arrayBuffer()); + let binary = ''; + const chunk = 0x8000; + for (let i = 0; i < bytes.length; i += chunk) { + binary += String.fromCharCode(...bytes.subarray(i, i + chunk)); + } + return btoa(binary); +} + +const byOrder = (a: EventRecord, b: EventRecord) => + (a.order ?? Number.MAX_SAFE_INTEGER) - (b.order ?? Number.MAX_SAFE_INTEGER) || a.createdAt - b.createdAt; + +export default function App() { + const [events, setEvents] = useState([]); + const [photos, setPhotos] = useState([]); + const [loaded, setLoaded] = useState(false); + const [loadError, setLoadError] = useState(null); + const [eventId, setEventId] = useState('all'); + const [view, setView] = useState('grid'); + const [sidebarOpen, setSidebarOpen] = usePersistentState('library.sidebar.open', true); + const [catalogOpen, setCatalogOpen] = useState(false); + const [trashOpen, setTrashOpen] = useState(false); + const [activeId, setActiveId] = useState(null); + const [selected, setSelected] = useState([]); + const [anchorId, setAnchorId] = useState(null); + const [expandedStacks, setExpandedStacks] = useState>(() => new Set()); + const [compareOpen, setCompareOpen] = useState(false); + const [filters, setFilters] = useState(EMPTY_FILTERS); + const [sort, setSort] = useState('taken'); + const [asc, setAsc] = useState(false); + const [importOpen, setImportOpen] = useState(false); + const [pendingFiles, setPendingFiles] = useState([]); + const [clipboard, setClipboard] = useState(null); + const [clipboardSource, setClipboardSource] = useState<{ id: string; name: string } | null>(null); + const [pasteRequest, setPasteRequest] = useState<{ targets: string[]; source: Edits; sourceName: string; mode: 'paste' | 'sync' } | null>(null); + const [localClipboard, setLocalClipboard] = useState(null); + const [metadataPresets, setMetadataPresets] = useState([]); + const [smartCollections, setSmartCollections] = useState([]); + const [activeCollection, setActiveCollection] = useState(null); + const [customPresets, setCustomPresets] = useState([]); + const [toast, setToast] = useState(null); + const [undoAction, setUndoAction] = useState<{ message: string; run: () => void } | null>(null); + const [menu, setMenu] = useState<{ x: number; y: number; ids: string[] } | null>(null); + const [helpOpen, setHelpOpen] = useState(false); + const [searchOpen, setSearchOpen] = useState(false); + const [shareEventId, setShareEventId] = useState(null); + /** Client proofing picks, keyed to the photos they chose. */ + const [proofs, setProofs] = useState([]); + const [quota, setQuota] = useState(null); + const [dropActive, setDropActive] = useState(false); + const [bridgeBusy, setBridgeBusy] = useState(false); + + const [cloudHealth, setCloudHealth] = useState(null); + const [cloudUser, setCloudUser] = useState(null); + const [cloudOpen, setCloudOpen] = useState(false); + const [adminOpen, setAdminOpen] = useState(false); + const [cloudBusy, setCloudBusy] = useState(false); + const [cloudError, setCloudError] = useState(null); + const [cloudNote, setCloudNote] = useState(null); + + const [exportOpen, setExportOpen] = useState(false); + const [exportOptions, setExportOptions] = useState(DEFAULT_EXPORT); + const [exportRecipes, setExportRecipes] = useState([]); + const [mergeOpen, setMergeOpen] = useState(false); + const [printOpen, setPrintOpen] = useState(false); + + const saveTimers = useRef(new Map>()); + const photosRef = useRef([]); + const eventsRef = useRef([]); + const userRef = useRef(null); + photosRef.current = photos; + eventsRef.current = events; + userRef.current = cloudUser; + + const refreshQuota = useCallback(async () => { + if (!userRef.current) { + setQuota(null); + return; + } + try { + setQuota(await getQuota()); + } catch { + setQuota(null); + } + }, []); + + useEffect(() => { + if (!cloudUser) { + setQuota(null); + return; + } + void refreshQuota(); + const timer = window.setInterval(() => void refreshQuota(), 5 * 60 * 1000); + return () => window.clearInterval(timer); + }, [cloudUser, refreshQuota]); + + useEffect(() => { + let alive = true; + (async () => { + try { + const [loadedEvents, loadedPhotos, presets, metaPresets, collections, recipes] = await Promise.all([ + getAllEvents(), + getAllPhotos(), + getKV('customPresets'), + getKV('metadataPresets'), + getKV('smartCollections'), + getKV('exportRecipes'), + ]); + if (!alive) return; + setEvents([...loadedEvents].sort(byOrder)); + setPhotos(loadedPhotos.map((p) => normalizePhoto(p))); + if (Array.isArray(presets)) setCustomPresets(presets); + if (Array.isArray(metaPresets)) setMetadataPresets(metaPresets); + if (Array.isArray(collections)) setSmartCollections(collections); + if (Array.isArray(recipes)) setExportRecipes(recipes); + } catch (err) { + setLoadError(err instanceof Error ? err.message : 'Could not read local storage'); + } finally { + if (alive) setLoaded(true); + } + })(); + return () => { + alive = false; + }; + }, []); + + // Detect the team server; a missing one simply means a browser-only library. + useEffect(() => { + let alive = true; + (async () => { + const health = await getHealth(); + if (!alive) return; + setCloudHealth(health); + if (health) { + const user = await currentUser(); + if (alive) { + setCloudUser(user); + if (user) { + void pullProofs() + .then((next) => alive && setProofs(next)) + .catch(() => undefined); + } + if (!user) { + // Account workspaces need a session (their images are private); + // photos created on this device stay visible. + setPhotos((prev) => prev.filter((p) => !p.workspace)); + setEvents((prev) => prev.filter((e) => !e.workspace)); + } + } + } + })(); + return () => { + alive = false; + }; + }, []); + + useEffect(() => { + if (!toast) return; + const t = setTimeout( + () => { + setToast(null); + setUndoAction(null); + }, + undoAction && toast === undoAction.message ? 7000 : 2800, + ); + return () => clearTimeout(t); + }, [toast, undoAction]); + + const handleProofPublished = useCallback((photoId: string, thumbUrl: string, proofAt: number) => { + setPhotos((prev) => + prev.map((photo) => { + if (photo.id !== photoId) return photo; + const next = { ...photo, thumbUrl, proofAt }; + putPhoto(next).catch((err) => console.warn('Could not cache the edited proof', err)); + return next; + }), + ); + }, []); + + const queueSave = useCallback((photo: PhotoRecord) => { + const existing = saveTimers.current.get(photo.id); + if (existing) clearTimeout(existing); + saveTimers.current.set( + photo.id, + setTimeout(() => { + saveTimers.current.delete(photo.id); + putPhoto(photo).catch((err) => console.error('Failed to save photo', err)); + + if (!userRef.current) return; + const payload: PhotoRecord = photo.thumbUrl ? { ...photo, thumb: '' } : photo; + pushPhoto(payload) + .then((saved) => { + setPhotos((prev) => + prev.map((p) => + p.id === saved.id && (p.thumbUrl !== saved.thumbUrl || p.previewUrl !== saved.previewUrl) + ? { ...p, thumbUrl: saved.thumbUrl, previewUrl: saved.previewUrl ?? p.previewUrl } + : p, + ), + ); + }) + .catch((err) => console.warn('Could not sync photo', photo.name, err)); + }, 320), + ); + }, []); + + const updatePhoto = useCallback( + ( + id: string, + patch: Partial | ((p: PhotoRecord) => Partial), + historyLabel?: string, + ) => { + setPhotos((prev) => + prev.map((p) => { + if (p.id !== id) return p; + const partial = typeof patch === 'function' ? patch(p) : patch; + let next: PhotoRecord = { ...p, ...partial }; + if (partial.edits && historyLabel) { + const now = Date.now(); + const hist = next.history ?? []; + // Editing after Undo discards the old redo branch before the new + // history point is appended. Without this, redo could jump to an + // adjustment that is no longer part of the current timeline. + const currentIndex = hist.findIndex((entry) => entry.edits === p.edits); + const base = currentIndex >= 0 ? hist.slice(0, currentIndex + 1) : hist; + const last = base[base.length - 1]; + const entry = { label: historyLabel, ts: now, edits: next.edits }; + next = { + ...next, + history: + last && last.label === historyLabel && now - last.ts < 1400 + ? [...base.slice(0, -1), entry] + : [...base, entry].slice(-90), + }; + } + queueSave(next); + return next; + }), + ); + }, + [queueSave], + ); + + const bulkUpdate = useCallback( + (ids: string[], patch: Partial) => { + if (!ids.length) return; + setPhotos((prev) => + prev.map((p) => { + if (!ids.includes(p.id)) return p; + const next = { ...p, ...patch }; + queueSave(next); + return next; + }), + ); + }, + [queueSave], + ); + + const livePhotos = useMemo(() => photos.filter((p) => !p.deletedAt), [photos]); + const trashCount = photos.length - livePhotos.length; + const proofCounts = useMemo(() => { + const map = new Map(); + for (const proof of proofs) map.set(proof.photoId, proof.count); + return map; + }, [proofs]); + + const proofStatus = useMemo(() => { + const map = new Map(); + for (const proof of proofs) { + map.set(proof.photoId, { + approved: proof.approved ?? 0, + changes: proof.changes ?? 0, + comments: proof.comments ?? 0, + }); + } + return map; + }, [proofs]); + + /** Current event/trash scope before the filter bar is applied. */ + const scopePhotos = useMemo( + () => + photos.filter((photo) => { + if (trashOpen ? !photo.deletedAt : !!photo.deletedAt) return false; + if (trashOpen) return true; + if (eventId === 'unsorted') return !photo.eventId; + if (eventId !== 'all') return photo.eventId === eventId; + return true; + }), + [eventId, photos, trashOpen], + ); + + const scopeReviewCounts = useMemo(() => { + let approved = 0; + let changes = 0; + for (const photo of scopePhotos) { + if (proofStatus.get(photo.id)?.approved) approved += 1; + if (proofStatus.get(photo.id)?.changes) changes += 1; + } + return { approved, changes }; + }, [proofStatus, scopePhotos]); + + const trashPhotos = useCallback( + (ids: string[]) => { + if (!ids.length) return; + const stamp = Date.now(); + const affected = photosRef.current + .filter((photo) => ids.includes(photo.id) && !photo.deletedAt) + .map((photo) => photo.id); + if (!affected.length) return; + const previousActive = activeId; + const previousView = view; + setPhotos((prev) => + prev.map((p) => { + if (!affected.includes(p.id)) return p; + const next = { ...p, deletedAt: stamp }; + queueSave(next); + return next; + }), + ); + setSelected([]); + if (activeId && affected.includes(activeId)) { + setActiveId(null); + setView('grid'); + } + const message = `Moved ${affected.length === 1 ? '1 photo' : `${affected.length} photos`} to Trash`; + setToast(message); + setUndoAction({ + message, + run: () => { + const restore = new Set(affected); + setPhotos((prev) => + prev.map((photo) => { + if (!restore.has(photo.id) || !photo.deletedAt) return photo; + const next = { ...photo }; + delete next.deletedAt; + queueSave(next); + return next; + }), + ); + setSelected(affected); + setAnchorId(affected[0] ?? null); + if (previousActive && restore.has(previousActive)) { + setActiveId(previousActive); + setView(previousView); + } + setUndoAction(null); + setToast('Trash undone'); + }, + }); + }, + [activeId, queueSave, view], + ); + + const restorePhotos = useCallback( + (ids: string[]) => { + if (!ids.length) return; + setPhotos((prev) => + prev.map((p) => { + if (!ids.includes(p.id) || !p.deletedAt) return p; + const next = { ...p }; + delete next.deletedAt; + queueSave(next); + return next; + }), + ); + setSelected([]); + setToast(`Restored ${ids.length === 1 ? '1 photo' : `${ids.length} photos`}`); + }, + [queueSave], + ); + + const removePhotos = useCallback( + async (ids: string[]) => { + if (!ids.length) return; + const label = ids.length === 1 ? 'this photo' : `${ids.length} photos`; + if (!window.confirm(`Delete ${label} permanently? This cannot be undone.`)) return; + for (const id of ids) { + try { + await deletePhotoRecord(id); + evictBitmap(id); + if (userRef.current) await deletePhotoRemote(id).catch(() => undefined); + } catch (err) { + console.error('Delete failed', err); + } + } + setPhotos((prev) => prev.filter((p) => !ids.includes(p.id))); + setSelected((prev) => prev.filter((id) => !ids.includes(id))); + if (activeId && ids.includes(activeId)) { + setActiveId(null); + setView('grid'); + } + setToast(`Deleted ${label}`); + }, + [activeId], + ); + + const createEvent = useCallback(async (name: string) => { + const event: EventRecord = { + id: uid(), + name: name.trim() || `Event ${new Date().toLocaleDateString()}`, + createdAt: Date.now(), + date: Date.now(), + order: eventsRef.current.length, + workspace: userRef.current?.id, + }; + await putEvent(event); + if (userRef.current) pushEvent(event).catch(() => undefined); + setEvents((prev) => [...prev, event].sort(byOrder)); + return event; + }, []); + + const renameEvent = useCallback(async (id: string, name: string) => { + const trimmed = name.trim(); + if (!trimmed) return; + setEvents((prev) => { + const next = prev.map((e) => (e.id === id ? { ...e, name: trimmed } : e)); + const target = next.find((e) => e.id === id); + if (target) { + putEvent(target).catch((err) => console.error(err)); + if (userRef.current) pushEvent(target).catch(() => undefined); + } + return next; + }); + }, []); + + const removeEvent = useCallback( + async (id: string) => { + const event = events.find((e) => e.id === id); + if (!event) return; + if (!window.confirm(`Remove the event "${event.name}"? Its photos stay in All Photos.`)) return; + await deleteEventRecord(id); + if (userRef.current) await deleteEventRemote(id).catch(() => undefined); + setEvents((prev) => prev.filter((e) => e.id !== id)); + setPhotos((prev) => { + const next = prev.map((p) => (p.eventId === id ? { ...p, eventId: '' } : p)); + for (const p of next) if (p.eventId === '') queueSave(p); + return next; + }); + if (eventId === id) setEventId('all'); + }, + [events, eventId, queueSave], + ); + + const baseSorted = useMemo(() => { + const text = filters.text.trim().toLowerCase(); + const eventNames = new Map(events.map((e) => [e.id, e.name.toLowerCase()])); + const list = photos.filter((p) => { + // Trash is a separate bucket: deleted photos never mix with the library, + // and the trash view shows nothing else. + if (trashOpen ? !p.deletedAt : !!p.deletedAt) return false; + if (trashOpen) return true; + if (eventId === 'unsorted' && p.eventId) return false; + if (eventId !== 'all' && eventId !== 'unsorted' && p.eventId !== eventId) return false; + if (filters.minRating > 0 && p.rating < filters.minRating) return false; + if (filters.unrated && p.rating !== 0) return false; + if (filters.flag !== 'any' && p.flag !== filters.flag) return false; + if (filters.colors.length && !filters.colors.includes(p.color)) return false; + if (filters.editedOnly && !isEdited(p.edits)) return false; + if (filters.proofed && !proofCounts.has(p.id)) return false; + if (filters.clientStatus === 'approved' && !(proofStatus.get(p.id)?.approved ?? 0)) return false; + if (filters.clientStatus === 'changes' && !(proofStatus.get(p.id)?.changes ?? 0)) return false; + if (text) { + const hay = [ + p.name, + p.title ?? '', + p.caption ?? '', + p.creator ?? '', + p.copyright ?? '', + p.meta.camera ?? '', + p.meta.lens ?? '', + p.eventId ? eventNames.get(p.eventId) ?? '' : '', + ...p.keywords, + ] + .join(' ') + .toLowerCase(); + if (!hay.includes(text)) return false; + } + return true; + }); + + if (sort === 'custom') { + return [...list].sort( + (a, b) => (a.order ?? Number.MAX_SAFE_INTEGER) - (b.order ?? Number.MAX_SAFE_INTEGER) || a.addedAt - b.addedAt, + ); + } + + const dir = asc ? 1 : -1; + const keyOf = (p: PhotoRecord): number | string => { + if (sort === 'taken') return p.takenAt ?? p.addedAt; + if (sort === 'added') return p.addedAt; + if (sort === 'rating') return p.rating; + return p.name.toLowerCase(); + }; + return [...list].sort((a, b) => { + const ka = keyOf(a); + const kb = keyOf(b); + if (typeof ka === 'string' && typeof kb === 'string') return ka.localeCompare(kb) * dir; + return ((ka as number) - (kb as number)) * dir; + }); + }, [photos, events, eventId, filters, sort, asc, trashOpen, proofCounts, proofStatus]); + + // Stacks collapse to their lowest-index member until expanded. Grouping after + // filtering means a hidden stack never masks a visible sibling. + const sorted = useMemo(() => { + if (trashOpen) return baseSorted; + const groups = new Map(); + for (const photo of baseSorted) { + if (!photo.stackId) continue; + const list = groups.get(photo.stackId) ?? []; + list.push(photo); + groups.set(photo.stackId, list); + } + const seen = new Set(); + const out: PhotoRecord[] = []; + for (const photo of baseSorted) { + if (!photo.stackId) { + out.push(photo); + continue; + } + if (seen.has(photo.stackId)) continue; + seen.add(photo.stackId); + const members = [...(groups.get(photo.stackId) ?? [])].sort( + (a, b) => (a.stackIndex ?? 0) - (b.stackIndex ?? 0), + ); + if (expandedStacks.has(photo.stackId)) out.push(...members); + else if (members[0]) out.push(members[0]); + } + return out; + }, [baseSorted, expandedStacks, trashOpen]); + + const stackMeta = useMemo(() => { + const groups = new Map(); + for (const photo of baseSorted) { + if (!photo.stackId) continue; + const list = groups.get(photo.stackId) ?? []; + list.push(photo); + groups.set(photo.stackId, list); + } + const meta = new Map(); + for (const [id, members] of groups) { + if (members.length < 2) continue; + const expanded = expandedStacks.has(id); + const rep = members.reduce((a, b) => ((b.stackIndex ?? 0) < (a.stackIndex ?? 0) ? b : a)); + if (expanded) { + for (const member of members) meta.set(member.id, { count: members.length, expanded: true }); + } else { + meta.set(rep.id, { count: members.length, expanded: false }); + } + } + return meta; + }, [baseSorted, expandedStacks]); + + const activePhoto = useMemo(() => photos.find((p) => p.id === activeId) ?? null, [photos, activeId]); + + const scopedProofCount = useMemo(() => { + if (trashOpen) return 0; + return livePhotos.filter((p) => + proofCounts.has(p.id) && + (eventId === 'all' || (eventId === 'unsorted' ? !p.eventId : p.eventId === eventId)), + ).length; + }, [eventId, livePhotos, proofCounts, trashOpen]); + + /** The dashboard event id this tab was opened for, when bridged. */ + const bridgeParam = useMemo( + () => new URLSearchParams(window.location.search).get('bridge'), + [], + ); + const bridgeEvent = useMemo( + () => + events.find((event) => event.bridge && (event.id === bridgeParam || event.id === eventId)) ?? + null, + [events, bridgeParam, eventId], + ); + const bridgeSynced = useRef(false); + + const selectPhoto = useCallback( + (id: string, e: React.MouseEvent) => { + if (e.shiftKey && anchorId) { + const a = sorted.findIndex((p) => p.id === anchorId); + const b = sorted.findIndex((p) => p.id === id); + if (a >= 0 && b >= 0) { + const [lo, hi] = a < b ? [a, b] : [b, a]; + setSelected(sorted.slice(lo, hi + 1).map((p) => p.id)); + return; + } + } + if (e.metaKey || e.ctrlKey) { + setSelected((prev) => (prev.includes(id) ? prev.filter((x) => x !== id) : [...prev, id])); + setAnchorId(id); + return; + } + setSelected([id]); + setAnchorId(id); + }, + [anchorId, sorted], + ); + + const openPhoto = useCallback((id: string) => { + setCatalogOpen(false); + setActiveId(id); + setSelected([id]); + setView('develop'); + }, []); + + const copySettings = useCallback(() => { + if (!activePhoto) return; + setClipboard(activePhoto.edits); + setClipboardSource({ id: activePhoto.id, name: activePhoto.name }); + setToast('Develop settings copied'); + }, [activePhoto]); + + const openPaste = useCallback( + (ids: string[], mode: 'paste' | 'sync' = 'paste', sourcePhoto?: PhotoRecord) => { + if (!ids.length) return; + const source = sourcePhoto?.edits ?? clipboard; + if (!source) return; + setPasteRequest({ + targets: ids, + source, + sourceName: sourcePhoto?.name ?? clipboardSource?.name ?? 'copied settings', + mode, + }); + }, + [clipboard, clipboardSource], + ); + + const applyPaste = useCallback( + (sections: EditSectionId[]) => { + if (!pasteRequest || !sections.length) return; + const targets = new Set(pasteRequest.targets); + setPhotos((prev) => + prev.map((p) => { + if (!targets.has(p.id)) return p; + const edits = applyEditSections(pasteRequest.source, p.edits, sections); + const next: PhotoRecord = { + ...p, + edits, + history: [ + ...p.history, + { label: pasteRequest.mode === 'sync' ? 'Sync settings' : 'Paste settings', ts: Date.now(), edits }, + ].slice(-90), + }; + queueSave(next); + return next; + }), + ); + setToast( + `${pasteRequest.mode === 'sync' ? 'Synced' : 'Pasted'} ${sections.length} section${sections.length === 1 ? '' : 's'} to ${pasteRequest.targets.length} photo${pasteRequest.targets.length === 1 ? '' : 's'}`, + ); + setPasteRequest(null); + }, + [pasteRequest, queueSave], + ); + + /* ------------------------------------------------------- context actions */ + + const openPhotoMenu = useCallback( + (e: React.MouseEvent, id: string) => { + e.preventDefault(); + e.stopPropagation(); + const ids = selected.includes(id) ? selected : [id]; + if (!selected.includes(id)) { + setSelected([id]); + setAnchorId(id); + } + setMenu({ x: e.clientX, y: e.clientY, ids }); + }, + [selected], + ); + + const copySettingsOf = useCallback((id: string) => { + const source = photosRef.current.find((p) => p.id === id); + if (!source) return; + setClipboard(source.edits); + setClipboardSource({ id: source.id, name: source.name }); + setToast(`Develop settings copied from ${source.name}`); + }, []); + + const resetEdits = useCallback( + (ids: string[]) => { + if (!ids.length) return; + setPhotos((prev) => + prev.map((p) => { + if (!ids.includes(p.id)) return p; + const edits: Edits = { ...defaultEdits(), crop: p.edits.crop }; + const next: PhotoRecord = { + ...p, + edits, + history: [...p.history, { label: 'Reset', ts: Date.now(), edits }].slice(-90), + }; + queueSave(next); + return next; + }), + ); + setToast(`Reset adjustments on ${ids.length} photo${ids.length === 1 ? '' : 's'}`); + }, + [queueSave], + ); + + const savePreset = useCallback( + (name: string, edits: Edits) => { + const { crop: _crop, ...withoutCrop } = edits; + const preset: Preset = { + id: uid(), + name, + group: 'User presets', + custom: true, + edits: withoutCrop, + }; + const next = [...customPresets, preset]; + setCustomPresets(next); + setKV('customPresets', next).catch((err) => console.error(err)); + if (userRef.current) { + import('./lib/api').then(({ pushPresets }) => pushPresets(next).catch(() => undefined)); + } + setToast(`Preset "${name}" saved`); + }, + [customPresets], + ); + + /* ------------------------------------------------------------- reordering */ + + const reorderPhotos = useCallback( + (ids: string[], targetId: string | null) => { + if (!ids.length) return; + const visible = sorted.map((p) => p.id); + const moving = ids.filter((id) => visible.includes(id)); + if (!moving.length) return; + const rest = visible.filter((id) => !ids.includes(id)); + const at = targetId ? Math.max(0, rest.indexOf(targetId)) : rest.length; + rest.splice(at < 0 ? rest.length : at, 0, ...moving); + const positions = new Map(rest.map((id, i) => [id, i])); + + setPhotos((prev) => + prev.map((p) => { + const order = positions.get(p.id); + if (order === undefined || p.order === order) return p; + const next = { ...p, order }; + queueSave(next); + return next; + }), + ); + setSort('custom'); + setToast(`Moved ${moving.length} photo${moving.length === 1 ? '' : 's'}`); + }, + [sorted, queueSave], + ); + + const stackSelection = useCallback( + (ids: string[]) => { + const members = sorted.filter((photo) => ids.includes(photo.id)); + if (members.length < 2) { + setToast('Select at least two photos to stack'); + return; + } + const stackId = uid(); + setPhotos((prev) => + prev.map((photo) => { + const index = members.findIndex((member) => member.id === photo.id); + if (index < 0) return photo; + const next: PhotoRecord = { ...photo, stackId, stackIndex: index }; + queueSave(next); + return next; + }), + ); + setExpandedStacks((prev) => new Set(prev).add(stackId)); + setToast(`Stacked ${members.length} photos`); + }, + [sorted, queueSave], + ); + + const unstackSelection = useCallback( + (ids: string[]) => { + if (!ids.length) return; + // Unstacking one member releases the whole stack, otherwise a collapsed + // stack would leave its hidden siblings attached to a one-photo group. + const stackIds = new Set( + photos.filter((photo) => ids.includes(photo.id) && photo.stackId).map((photo) => photo.stackId!), + ); + const targets = photos.filter( + (photo) => ids.includes(photo.id) || (photo.stackId && stackIds.has(photo.stackId)), + ); + if (!targets.length) return; + const targetIds = new Set(targets.map((photo) => photo.id)); + setPhotos((prev) => + prev.map((photo) => { + if (!targetIds.has(photo.id) || !photo.stackId) return photo; + const next: PhotoRecord = { ...photo }; + delete next.stackId; + delete next.stackIndex; + queueSave(next); + return next; + }), + ); + setToast(`Unstacked ${targets.length === 1 ? '1 photo' : `${targets.length} photos`}`); + }, + [photos, queueSave], + ); + + const createVirtualCopy = useCallback( + async (id: string, open = false) => { + const source = photosRef.current.find((p) => p.id === id); + if (!source) return; + const copyId = uid(); + const master = source.copyOf ?? source.id; + const copyNumber = photosRef.current.filter((photo) => photo.copyOf === master).length + 1; + const base = source.name.replace(/ (copy \d+|virtual copy.*)$/i, '').replace(/\.[^.]+$/, ''); + const copy = normalizePhoto({ + ...source, + id: copyId, + name: `${base} copy ${copyNumber}`, + addedAt: Date.now(), + copyOf: master, + copyName: `Virtual copy ${copyNumber}`, + snapshots: [], + stackId: undefined, + stackIndex: undefined, + }); + const blob = await getAsset(source.id).catch(() => undefined); + if (blob) await putAsset(copyId, blob).catch(() => undefined); + await putPhoto(copy); + setPhotos((prev) => [copy, ...prev]); + setSelected([copyId]); + setAnchorId(copyId); + if (open) { + setActiveId(copyId); + setView('develop'); + } + setToast(`Created ${copy.copyName}`); + if (userRef.current) { + if (blob) await uploadOriginal(copyId, blob, copy.name).catch(() => undefined); + pushPhoto(copy).catch(() => undefined); + } + }, + [], + ); + + const saveSnapshot = useCallback( + (id: string, name: string) => { + const label = name.trim() || `Snapshot ${new Date().toLocaleTimeString()}`; + updatePhoto(id, (photo) => ({ + snapshots: [ + ...(photo.snapshots ?? []), + { id: uid(), name: label.slice(0, 40), ts: Date.now(), edits: photo.edits }, + ].slice(-30), + })); + setToast(`Snapshot “${label}” saved`); + }, + [updatePhoto], + ); + + const restoreSnapshot = useCallback( + (id: string, snapshot: Snapshot) => { + updatePhoto(id, { edits: snapshot.edits }, `Snapshot: ${snapshot.name}`); + setToast(`Restored “${snapshot.name}”`); + }, + [updatePhoto], + ); + + const deleteSnapshot = useCallback( + (id: string, snapshotId: string) => { + updatePhoto(id, (photo) => ({ + snapshots: (photo.snapshots ?? []).filter((snapshot) => snapshot.id !== snapshotId), + })); + }, + [updatePhoto], + ); + + const saveMetadataPreset = useCallback((preset: Omit) => { + const next = [...metadataPresets, { ...preset, id: uid() }]; + setMetadataPresets(next); + setKV('metadataPresets', next).catch((err) => console.error(err)); + }, [metadataPresets]); + + const deleteMetadataPreset = useCallback((id: string) => { + const next = metadataPresets.filter((preset) => preset.id !== id); + setMetadataPresets(next); + setKV('metadataPresets', next).catch((err) => console.error(err)); + }, [metadataPresets]); + + const saveSmartCollection = useCallback( + (name: string) => { + const clean = name.trim(); + if (!clean) return; + const next = [ + ...smartCollections, + { + id: uid(), + name: clean, + filters: { ...filters }, + eventId: eventId === 'all' || eventId === 'unsorted' ? undefined : eventId, + sort, + asc, + }, + ]; + setSmartCollections(next); + setKV('smartCollections', next).catch((err) => console.error(err)); + setToast(`Saved collection “${clean}”`); + }, + [smartCollections, filters, eventId, sort, asc], + ); + + const applySmartCollection = useCallback( + (id: string) => { + const collection = smartCollections.find((item) => item.id === id); + if (!collection) return; + setFilters({ ...EMPTY_FILTERS, ...collection.filters }); + setSort(collection.sort); + setAsc(collection.asc); + setTrashOpen(false); + if (collection.eventId) setEventId(collection.eventId); + setActiveCollection(id); + }, + [smartCollections], + ); + + const deleteSmartCollection = useCallback((id: string) => { + const next = smartCollections.filter((collection) => collection.id !== id); + setSmartCollections(next); + setKV('smartCollections', next).catch((err) => console.error(err)); + setActiveCollection((current) => (current === id ? null : current)); + }, [smartCollections]); + + const toggleStack = useCallback((photoId: string) => { + const photo = photosRef.current.find((item) => item.id === photoId); + if (!photo?.stackId) return; + setExpandedStacks((prev) => { + const next = new Set(prev); + if (next.has(photo.stackId!)) next.delete(photo.stackId!); + else next.add(photo.stackId!); + return next; + }); + }, []); + + const movePhotosToEvent = useCallback( + (ids: string[], targetEventId: string) => { + if (!ids.length) return; + const inTarget = photos.filter((p) => p.eventId === targetEventId).length; + const previous = photosRef.current + .filter((photo) => ids.includes(photo.id)) + .map((photo) => ({ id: photo.id, eventId: photo.eventId, order: photo.order })); + if (!previous.length) return; + setPhotos((prev) => + prev.map((p, i) => { + if (!ids.includes(p.id)) return p; + const next = { ...p, eventId: targetEventId, order: inTarget + i }; + queueSave(next); + return next; + }), + ); + const name = targetEventId ? events.find((e) => e.id === targetEventId)?.name ?? 'event' : 'Unsorted'; + const message = `Moved ${ids.length} photo${ids.length === 1 ? '' : 's'} to ${name}`; + setToast(message); + setUndoAction({ + message, + run: () => { + const before = new Map(previous.map((photo) => [photo.id, photo])); + setPhotos((prev) => + prev.map((photo) => { + const old = before.get(photo.id); + if (!old) return photo; + const next: PhotoRecord = { ...photo, eventId: old.eventId }; + if (old.order === undefined) delete next.order; + else next.order = old.order; + queueSave(next); + return next; + }), + ); + setUndoAction(null); + setToast('Move undone'); + }, + }); + }, + [events, photos, queueSave], + ); + + const reorderEvents = useCallback((dragId: string, targetId: string) => { + setEvents((prev) => { + const list = [...prev]; + const from = list.findIndex((e) => e.id === dragId); + const to = list.findIndex((e) => e.id === targetId); + if (from < 0 || to < 0 || from === to) return prev; + const [moved] = list.splice(from, 1); + list.splice(to, 0, moved); + const next = list.map((e, i) => (e.order === i ? e : { ...e, order: i })); + for (const e of next) { + putEvent(e).catch(() => undefined); + if (userRef.current) pushEvent(e).catch(() => undefined); + } + return next; + }); + }, []); + + /* ------------------------------------------------------------------ cloud */ + + const applyRemote = useCallback( + ( + remote: { + user: SessionUser; + events: EventRecord[]; + photos: PhotoRecord[]; + presets: Preset[]; + proofs?: ProofSummary[]; + }, + local: PhotoRecord[], + ) => { + const owner = remote.user?.id ?? ''; + const localById = new Map(local.map((p) => [p.id, p])); + const merged = remote.photos.map((r) => { + const l = localById.get(r.id); + return normalizePhoto({ ...r, workspace: owner, thumb: l?.thumb || r.thumb || '' }); + }); + const seen = new Set(merged.map((p) => p.id)); + // Cached photos from another account stay on the device but out of this workspace. + for (const l of local) { + if (seen.has(l.id)) continue; + if (!owner || l.workspace !== owner) continue; + merged.push(l); + } + setPhotos(merged); + for (const p of merged) putPhoto(p).catch(() => undefined); + setEvents([...remote.events].map((e) => ({ ...e, workspace: owner })).sort(byOrder)); + if (remote.presets.length) setCustomPresets(remote.presets); + setProofs(remote.proofs ?? []); + }, + [], + ); + + const syncLibrary = useCallback(async () => { + const user = userRef.current ?? (await currentUser()); + if (!user) throw new Error('Sign in to the team server first'); + const owner = user.id; + + // Pull first. A brand-new workspace may adopt the library built on this + // device while signed out; an existing workspace never absorbs another + // account's cached records. + const before = await pullAll(); + const emptyWorkspace = before.photos.length === 0 && before.events.length === 0; + const claimable = (record: { workspace?: string }) => + record.workspace === owner || (emptyWorkspace && !record.workspace); + + const localPhotos = photosRef.current.filter(claimable); + const localEvents = eventsRef.current.filter(claimable); + + // Only records the server accepted become this account's cache. A rejected + // record (for example a stale copy owned by someone else) stays out of view. + const claimedEvents = new Set(); + const claimedPhotos = new Set(); + + for (const event of localEvents) { + try { + await pushEvent({ ...event, workspace: owner }); + claimedEvents.add(event.id); + } catch (err) { + console.warn('Could not sync event', event.name, err); + } + } + + for (const photo of localPhotos) { + try { + if (!photo.raw && !photo.thumbUrl) { + const blob = await getAsset(photo.id); + if (blob) await uploadOriginal(photo.id, blob, photo.name).catch(() => undefined); + } + const payload: PhotoRecord = { + ...photo, + workspace: owner, + ...(photo.thumbUrl ? { thumb: '' } : {}), + }; + const saved = await pushPhoto(payload); + claimedPhotos.add(photo.id); + if (saved.thumbUrl || saved.previewUrl) { + setPhotos((prev) => + prev.map((p) => + p.id === saved.id ? { ...p, thumbUrl: saved.thumbUrl ?? p.thumbUrl, previewUrl: saved.previewUrl ?? p.previewUrl } : p, + ), + ); + } + } catch (err) { + console.warn('Could not sync photo', photo.name, err); + } + } + + const claimed = new Set([...claimedEvents, ...claimedPhotos]); + const localSnapshot = photosRef.current.map((p) => + claimed.has(p.id) || p.workspace === owner ? { ...p, workspace: owner } : p, + ); + + // Remember which account claimed the cache so switching accounts can't + // re-upload these records into someone else's workspace. + for (const p of localPhotos) { + if (claimedPhotos.has(p.id)) putPhoto({ ...p, workspace: owner }).catch(() => undefined); + } + for (const e of localEvents) { + if (claimedEvents.has(e.id)) putEvent({ ...e, workspace: owner }).catch(() => undefined); + } + setPhotos((prev) => + prev.map((p) => (claimed.has(p.id) ? { ...p, workspace: owner } : p)), + ); + setEvents((prev) => + prev.map((e) => (claimed.has(e.id) ? { ...e, workspace: owner } : e)), + ); + + const remote = await pullAll(); + applyRemote(remote, localSnapshot); + return remote.photos.length; + }, [applyRemote]); + + // Arriving from the dashboard: the bridge login already created a session and + // imported the event, so pull it once and open that event. + useEffect(() => { + if (!loaded || !bridgeParam || !cloudUser || bridgeSynced.current) return; + bridgeSynced.current = true; + syncLibrary() + .then(() => { + setEventId(bridgeParam); + setView('grid'); + }) + .catch((err) => + setLoadError( + err instanceof Error ? err.message : 'Could not load the advanced edit', + ), + ); + }, [loaded, bridgeParam, cloudUser, syncLibrary]); + + /** Render the open photo at full size and store it on the event. */ + const saveActiveToEvent = useCallback(async () => { + if (!activePhoto || !bridgeEvent) return; + setBridgeBusy(true); + try { + const blob = await renderPhotoBlob(activePhoto, { + ...DEFAULT_EXPORT, + format: 'jpeg', + quality: 92, + resize: 'none', + }); + const res = await fetch('/api/bridge/export', { + method: 'POST', + headers: { 'content-type': 'application/json' }, + body: JSON.stringify({ + photoId: activePhoto.id, + jpeg: await blobToBase64(blob), + edits: activePhoto.edits, + width: activePhoto.width, + height: activePhoto.height, + }), + }); + const data = (await res.json().catch(() => ({}))) as { error?: string }; + if (!res.ok) throw new Error(data.error || 'The photo could not be saved'); + setToast(`Saved ${activePhoto.name} to the event`); + } catch (err) { + setToast(err instanceof Error ? err.message : 'The photo could not be saved'); + } finally { + setBridgeBusy(false); + } + }, [activePhoto, bridgeEvent]); + + const handleCloudLogin = useCallback( + async (email: string, password: string) => { + setCloudBusy(true); + setCloudError(null); + try { + const user = await apiLogin(email, password); + userRef.current = user; + setCloudUser(user); + const count = await syncLibrary(); + await refreshQuota(); + setCloudHealth(await getHealth()); + setCloudNote(`Signed in · ${count} photo${count === 1 ? '' : 's'} on the server`); + setToast('Connected to the team server'); + } catch (err) { + setCloudError(err instanceof Error ? err.message : 'Could not sign in'); + } finally { + setCloudBusy(false); + } + }, + [syncLibrary, refreshQuota], + ); + + const handleCloudRegister = useCallback( + async (input: { email: string; password: string; name: string; invite: string }) => { + setCloudBusy(true); + setCloudError(null); + try { + const user = await apiRegister(input); + userRef.current = user; + setCloudUser(user); + const count = await syncLibrary(); + await refreshQuota(); + setCloudHealth(await getHealth()); + setCloudNote(`Account created · ${count} photo${count === 1 ? '' : 's'} on the server`); + setToast('Team account created'); + } catch (err) { + setCloudError(err instanceof Error ? err.message : 'Could not create the account'); + } finally { + setCloudBusy(false); + } + }, + [syncLibrary, refreshQuota], + ); + + const handleCloudLogout = useCallback(async () => { + setCloudBusy(true); + try { + await apiLogout(); + } catch { + /* signing out locally is enough */ + } + setCloudUser(null); + setCloudNote(null); + setCloudError(null); + setCloudBusy(false); + setPhotos((prev) => prev.filter((p) => !p.workspace)); + setEvents((prev) => prev.filter((e) => !e.workspace)); + setToast('Signed out — your workspace stays on the server'); + }, []); + + const refreshCatalogFromServer = useCallback(async () => { + try { + const remote = await pullAll(); + applyRemote(remote, photosRef.current); + setProofs(remote.proofs ?? []); + setCloudHealth(await getHealth()); + setToast('Catalog restored from the server'); + } catch (err) { + setToast(err instanceof Error ? err.message : 'Could not reload the restored catalog'); + } + }, [applyRemote]); + + const handleSync = useCallback(async () => { + setCloudBusy(true); + setCloudError(null); + try { + const count = await syncLibrary(); + await refreshQuota(); + setProofs(await pullProofs().catch(() => [])); + setCloudHealth(await getHealth()); + setCloudNote(`Synced · ${count} photo${count === 1 ? '' : 's'} on the server`); + setToast('Library synced'); + } catch (err) { + setCloudError(err instanceof Error ? err.message : 'Sync failed'); + } finally { + setCloudBusy(false); + } + }, [syncLibrary, refreshQuota]); + + /* ----------------------------------------------------------------- export */ + + const exportTargets = useMemo(() => { + if (view === 'develop' && activePhoto) return [activePhoto]; + return photos.filter((p) => selected.includes(p.id)); + }, [view, activePhoto, photos, selected]); + + const openExport = useCallback(() => { + if (!exportTargets.length) { + setToast('Select photos to export'); + return; + } + setExportOpen(true); + }, [exportTargets]); + + const closeExport = useCallback((message: string) => { + setToast(message); + }, []); + + const addMergedPhoto = useCallback( + async (result: MergeResult) => { + const first = photosRef.current.find((photo) => result.sourceIds.includes(photo.id)); + if (!first) return; + const id = uid(); + const label = result.kind === 'hdr' ? 'HDR' : result.kind === 'panorama' ? 'Panorama' : 'Focus stack'; + const name = `${label} ${new Date().toLocaleDateString()} ${new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`; + const record = normalizePhoto({ + ...first, + id, + name, + width: result.width, + height: result.height, + size: result.blob.size, + mime: 'image/jpeg', + thumb: result.thumb, + thumbUrl: undefined, + previewUrl: undefined, + raw: false, + decode: undefined, + addedAt: Date.now(), + copyOf: undefined, + copyName: undefined, + snapshots: [], + merge: { kind: result.kind, sourceIds: result.sourceIds }, + edits: defaultEdits(), + history: [], + stackId: undefined, + stackIndex: undefined, + keywords: [...new Set(result.sourceIds.flatMap((sourceId) => photosRef.current.find((photo) => photo.id === sourceId)?.keywords ?? []))], + }); + await putAsset(id, result.blob); + await putPhoto(record); + setPhotos((prev) => [record, ...prev]); + setSelected([id]); + setAnchorId(id); + setMergeOpen(false); + setToast(`${label} created`); + if (userRef.current) { + await uploadOriginal(id, result.blob, name).catch(() => undefined); + pushPhoto(record) + .then((saved) => + setPhotos((prev) => prev.map((photo) => (photo.id === id ? { ...photo, ...saved } : photo))), + ) + .catch(() => undefined); + } + }, + [], + ); + + // Keyboard selection walks the grid the way it is laid out: the column count + // comes from the rendered rows, so up/down move by whole rows at any width. + const moveSelection = useCallback( + (dx: number, dy: number, extend: boolean) => { + if (!sorted.length) return; + const currentId = selected[0] ?? anchorId; + const index = Math.max(0, sorted.findIndex((p) => p.id === currentId)); + let columns = 1; + const grid = document.querySelector('.grid'); + if (grid) { + const card = grid.querySelector('.card'); + if (card) { + const firstTop = Math.round(card.getBoundingClientRect().top); + const perRow = new Map(); + for (const el of grid.querySelectorAll('.card')) { + const top = Math.round(el.getBoundingClientRect().top); + perRow.set(top, (perRow.get(top) ?? 0) + 1); + } + columns = perRow.get(firstTop) ?? 1; + } + } + const nextIndex = Math.min(sorted.length - 1, Math.max(0, index + dy * columns + dx)); + const target = sorted[nextIndex]; + if (!target) return; + if (extend && anchorId) { + const a = sorted.findIndex((p) => p.id === anchorId); + const [lo, hi] = a < nextIndex ? [a, nextIndex] : [nextIndex, a]; + setSelected(sorted.slice(lo, hi + 1).map((p) => p.id)); + } else { + setSelected([target.id]); + setAnchorId(target.id); + } + }, + [anchorId, selected, sorted], + ); + + useEffect(() => { + const onKey = (e: KeyboardEvent) => { + const mod = e.metaKey || e.ctrlKey; + const k = e.key.toLowerCase(); + // Search is deliberately available even when a filter field has focus. + if ( + mod && + k === 'k' && + !helpOpen && + !importOpen && + !exportOpen && + !cloudOpen && + !adminOpen && + !compareOpen + ) { + e.preventDefault(); + setSearchOpen(true); + return; + } + const target = e.target as HTMLElement | null; + if (target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable)) return; + + if (e.key === '?') { + e.preventDefault(); + setHelpOpen((v) => !v); + return; + } + if (helpOpen || importOpen || exportOpen || cloudOpen || adminOpen || compareOpen) return; + + if (mod && k === 'i') { + e.preventDefault(); + setPendingFiles([]); + setImportOpen(true); + return; + } + if (mod && k === 'e') { + e.preventDefault(); + openExport(); + return; + } + if (mod && k === 'a' && view === 'grid') { + e.preventDefault(); + setSelected(sorted.map((p) => p.id)); + setAnchorId(sorted[0]?.id ?? null); + return; + } + if (!mod && k === 'c' && view === 'grid' && !trashOpen && selected.length >= 2 && selected.length <= 4) { + e.preventDefault(); + setCompareOpen(true); + return; + } + if ((e.key === 'Delete' || e.key === 'Backspace') && selected.length) { + e.preventDefault(); + if (trashOpen) void removePhotos(selected); + else trashPhotos(selected); + return; + } + if (view === 'grid') { + if (e.key.startsWith('Arrow')) { + e.preventDefault(); + const dx = e.key === 'ArrowRight' ? 1 : e.key === 'ArrowLeft' ? -1 : 0; + const dy = e.key === 'ArrowDown' ? 1 : e.key === 'ArrowUp' ? -1 : 0; + moveSelection(dx, dy, e.shiftKey); + return; + } + if (e.key === 'Home' || e.key === 'End') { + e.preventDefault(); + const target = e.key === 'Home' ? sorted[0] : sorted[sorted.length - 1]; + if (target) { + setSelected([target.id]); + setAnchorId(target.id); + } + return; + } + if (k === 'escape') { + setSelected([]); + return; + } + } + + if (!selected.length) { + if (k === 'g') setView('grid'); + return; + } + if (/^[0-5]$/.test(e.key)) { + bulkUpdate(selected, { rating: Number(e.key) }); + e.preventDefault(); + return; + } + if (/^[6-9]$/.test(e.key)) { + const label = COLOR_LABELS[Number(e.key) - 6]; + if (label) { + bulkUpdate(selected, { color: label.value }); + e.preventDefault(); + } + return; + } + if (k === 'p') bulkUpdate(selected, { flag: 'pick' }); + else if (k === 'x') bulkUpdate(selected, { flag: 'reject' }); + else if (k === 'u') bulkUpdate(selected, { flag: 'none' }); + else if (k === 'g') setView('grid'); + else if (k === 'e' && selected[0]) openPhoto(selected[0]); + }; + window.addEventListener('keydown', onKey); + return () => window.removeEventListener('keydown', onKey); + }, [ + selected, + sorted, + anchorId, + view, + bulkUpdate, + openPhoto, + moveSelection, + removePhotos, + trashOpen, + trashPhotos, + openExport, + helpOpen, + importOpen, + exportOpen, + cloudOpen, + adminOpen, + compareOpen, + ]); + + // Dropping files anywhere in the window imports them, like any desktop editor. + useEffect(() => { + const hasFiles = (e: DragEvent) => Array.from(e.dataTransfer?.types ?? []).includes('Files'); + let depth = 0; + const onEnter = (e: DragEvent) => { + if (!hasFiles(e)) return; + depth += 1; + setDropActive(true); + }; + const onOver = (e: DragEvent) => { + if (!hasFiles(e)) return; + e.preventDefault(); + if (e.dataTransfer) e.dataTransfer.dropEffect = 'copy'; + }; + const onLeave = (e: DragEvent) => { + if (!hasFiles(e)) return; + depth = Math.max(0, depth - 1); + if (!depth) setDropActive(false); + }; + const onDrop = (e: DragEvent) => { + if (!hasFiles(e)) return; + e.preventDefault(); + depth = 0; + setDropActive(false); + const files = Array.from(e.dataTransfer?.files ?? []); + if (!files.length) return; + setPendingFiles(files); + setImportOpen(true); + }; + window.addEventListener('dragenter', onEnter); + window.addEventListener('dragover', onOver); + window.addEventListener('dragleave', onLeave); + window.addEventListener('drop', onDrop); + return () => { + window.removeEventListener('dragenter', onEnter); + window.removeEventListener('dragover', onOver); + window.removeEventListener('dragleave', onLeave); + window.removeEventListener('drop', onDrop); + }; + }, []); + + const eventName = + eventId === 'all' + ? 'All photos' + : eventId === 'unsorted' + ? 'Unsorted' + : events.find((e) => e.id === eventId)?.name ?? 'All photos'; + + const paletteActions = [ + { + id: 'import', + label: 'Import photos', + hint: '⌘I', + run: () => { + setPendingFiles([]); + setImportOpen(true); + }, + }, + { id: 'export', label: 'Export selected photos', hint: '⌘E', run: openExport }, + { id: 'library', label: 'Go to Library', hint: 'G', run: () => setView('grid') }, + { + id: 'develop', + label: activePhoto ? 'Return to Develop' : 'Develop the first photo', + hint: 'E', + run: () => { + if (activePhoto) setView('develop'); + else if (sorted[0]) openPhoto(sorted[0].id); + else setToast('There are no photos in this view'); + }, + }, + { + id: 'sidebar', + label: sidebarOpen ? 'Collapse the catalog sidebar' : 'Expand the catalog sidebar', + hint: 'Panels', + run: () => setSidebarOpen((open) => !open), + }, + { + id: 'clear-filters', + label: 'Clear library filters', + hint: 'View', + run: () => setFilters(EMPTY_FILTERS), + }, + { id: 'shortcuts', label: 'Show keyboard shortcuts', hint: '?', run: () => setHelpOpen(true) }, + ...(cloudUser && eventId !== 'all' && eventId !== 'unsorted' + ? [{ id: 'share', label: 'Open client proofing', hint: 'Share', run: () => setShareEventId(eventId) }] + : []), + ]; + + if (!loaded) { + return ( +
    +
    Luminary
    +

    Opening your library…

    +
    + ); + } + + return ( +
    + { + setCatalogOpen(false); + if (v === 'develop' && !activePhoto) { + if (sorted[0]) openPhoto(sorted[0].id); + return; + } + setView(v); + }} + onImport={() => { + setPendingFiles([]); + setImportOpen(true); + }} + onExport={openExport} + onCloud={() => { + setCloudError(null); + setCloudOpen(true); + }} + onHelp={() => setHelpOpen(true)} + onSearch={() => setSearchOpen(true)} + onCatalog={() => { + setView('grid'); + setCatalogOpen(true); + }} + canShare={!!cloudUser && eventId !== 'all' && eventId !== 'unsorted' && !trashOpen} + onShare={() => setShareEventId(eventId)} + /> + + {loadError &&
    Storage unavailable: {loadError}
    } + + {quota && (quota.warn || quota.over || quota.pruneAt) && ( +
    + + + {quota.over + ? 'Storage quota exceeded.' + : quota.pruneAt + ? 'Storage cleanup scheduled.' + : 'Storage nearly full.'} + {' '} + {quota.used >= 1024 ** 3 + ? `${(quota.used / 1024 ** 3).toFixed(1)} GB` + : `${Math.round(quota.used / 1024 ** 2)} MB`}{' '} + of {quota.limit >= 1024 ** 3 ? `${Math.round(quota.limit / 1024 ** 3)} GB` : `${Math.round(quota.limit / 1024 ** 2)} MB`}{' '} + used ({quota.percent}%).{' '} + {quota.pruneAt + ? `The oldest planned content will be removed after ${new Date(quota.pruneAt).toLocaleString()}. Free space before then to stop it.` + : 'Delete photos or empty Trash to free space.'} + +
    + )} + + {bridgeEvent?.bridge && ( +
    + + Advanced edit of “{bridgeEvent.name}” — a temporary copy. Use “Save to + event” on a photo when its look is ready. + + + + + Back to dashboard + + +
    + )} + +
    + {view === 'grid' && ( + { + setCatalogOpen(false); + setTrashOpen(true); + setEventId('all'); + setSelected([]); + }} + onSelectEvent={(id) => { + setCatalogOpen(false); + setTrashOpen(false); + setEventId(id); + }} + onCreate={async (name) => { + await createEvent(name); + }} + onRename={renameEvent} + onDelete={removeEvent} + onReorderEvents={reorderEvents} + onDropPhotos={movePhotosToEvent} + storageNote={ + cloudUser + ? `Synced as ${cloudUser.name || cloudUser.email}. Originals live on the team server.` + : cloudHealth + ? 'Server found — sign in to share this library with the team.' + : 'Stored in this browser. Run "npm run server" to share with the team.' + } + collections={smartCollections} + activeCollectionId={activeCollection} + onSelectCollection={applySmartCollection} + onDeleteCollection={deleteSmartCollection} + /> + )} + {view === 'grid' && catalogOpen && ( + + )} + +
    + {view === 'grid' ? ( + <> + {trashOpen && ( +
    + Trash · {sorted.length} photo{sorted.length === 1 ? '' : 's'} +
    + + + +
    +
    + )} + { + const name = window.prompt('Smart collection name', 'My view'); + if (name?.trim()) saveSmartCollection(name); + }} + /> + updatePhoto(id, { rating })} + onBulkRate={(rating) => bulkUpdate(selected, { rating })} + onBulkFlag={(flag) => bulkUpdate(selected, { flag })} + onBulkColor={(color) => bulkUpdate(selected, { color })} + onDelete={() => (trashOpen ? void removePhotos(selected) : trashPhotos(selected))} + onExport={openExport} + onCompare={() => setCompareOpen(true)} + onStack={() => stackSelection(selected)} + onVirtualCopy={() => { + if (selected.length === 1) void createVirtualCopy(selected[0]); + }} + onMerge={() => setMergeOpen(true)} + onPrint={() => setPrintOpen(true)} + stacks={stackMeta} + onToggleStack={toggleStack} + onImport={() => { + setPendingFiles([]); + setImportOpen(true); + }} + onDropFiles={(files) => { + setPendingFiles(files); + setImportOpen(true); + }} + onClearSelection={() => setSelected([])} + onReorder={reorderPhotos} + onMarqueeSelect={(ids) => { + setSelected(ids); + setAnchorId(ids[0] ?? null); + }} + proofCounts={proofCounts} + proofStatus={proofStatus} + /> + + ) : activePhoto ? ( + setView('grid')} + onUpdate={updatePhoto} + clipboard={clipboard} + onCopy={copySettings} + onPaste={() => openPaste([activePhoto.id])} + localClipboard={localClipboard} + onLocalClipboard={setLocalClipboard} + onExport={openExport} + onPrint={() => setPrintOpen(true)} + presets={[...PRESETS, ...customPresets]} + onSavePreset={savePreset} + onDelete={() => trashPhotos([activePhoto.id])} + onVirtualCopy={() => void createVirtualCopy(activePhoto.id, true)} + metadataPresets={metadataPresets} + keywordLibrary={[...new Set(photos.flatMap((photo) => photo.keywords))].sort()} + onSaveSnapshot={(name) => saveSnapshot(activePhoto.id, name)} + onRestoreSnapshot={(snapshot) => restoreSnapshot(activePhoto.id, snapshot)} + onDeleteSnapshot={(snapshot) => deleteSnapshot(activePhoto.id, snapshot.id)} + onSaveMetadataPreset={saveMetadataPreset} + onDeleteMetadataPreset={deleteMetadataPreset} + /> + ) : ( +
    +

    No photo selected

    + +
    + )} +
    +
    + + {importOpen && ( + { + setImportOpen(false); + setCloudError(null); + setCloudOpen(true); + }} + onClose={() => { + setImportOpen(false); + setPendingFiles([]); + }} + onImported={(imported, targetEventId) => { + const tagged = imported.map((p) => + cloudUser ? { ...p, workspace: cloudUser.id } : p, + ); + for (const p of tagged) putPhoto(p).catch(() => undefined); + setPhotos((prev) => [...tagged, ...prev]); + setEventId(targetEventId); + setSelected(imported.map((p) => p.id)); + setToast(`Imported ${imported.length} photo${imported.length === 1 ? '' : 's'}`); + }} + onCreateEvent={createEvent} + /> + )} + + {compareOpen && selected.length >= 2 && selected.length <= 4 && ( + photos.find((photo) => photo.id === id)) + .filter((photo): photo is PhotoRecord => Boolean(photo)) + .slice(0, 4)} + onClose={() => setCompareOpen(false)} + onOpen={(id) => { + setCompareOpen(false); + openPhoto(id); + }} + /> + )} + + {printOpen && ( + selected.includes(photo.id))} + onClose={() => setPrintOpen(false)} + /> + )} + + {mergeOpen && ( + selected.includes(photo.id))} + onClose={() => setMergeOpen(false)} + onDone={(result) => void addMergedPhoto(result)} + /> + )} + + {exportOpen && ( + setExportOpen(false)} + recipes={exportRecipes} + onSaveRecipe={(name, options) => { + const next = [...exportRecipes, { id: uid(), name, options }]; + setExportRecipes(next); + setKV('exportRecipes', next).catch(() => undefined); + }} + onDeleteRecipe={(id) => { + const next = exportRecipes.filter((recipe) => recipe.id !== id); + setExportRecipes(next); + setKV('exportRecipes', next).catch(() => undefined); + }} + onDone={(message, options) => { + setExportOptions(options); + closeExport(message); + }} + /> + )} + + {helpOpen && setHelpOpen(false)} />} + + {searchOpen && ( + { + setTrashOpen(false); + setEventId(id); + setView('grid'); + setSelected([]); + }} + onOpenPhoto={openPhoto} + onClose={() => setSearchOpen(false)} + /> + )} + + {shareEventId && + (() => { + const shared = events.find((e) => e.id === shareEventId); + if (!shared) return null; + return ( + p.eventId === shared.id)} + onClose={() => setShareEventId(null)} + onToast={setToast} + onProofPublished={handleProofPublished} + /> + ); + })()} + + {dropActive && ( +
    +
    + Drop to import + JPEG, PNG, TIFF or camera raw — released anywhere in the window +
    +
    + )} + + {cloudOpen && ( + void handleCloudLogin(email, password)} + onRegister={(input) => void handleCloudRegister(input)} + onLogout={() => void handleCloudLogout()} + onSync={() => void handleSync()} + onAdmin={() => { + setCloudOpen(false); + setAdminOpen(true); + }} + onClose={() => setCloudOpen(false)} + /> + )} + + {adminOpen && cloudUser && ( + setAdminOpen(false)} + onChanged={() => { + void getHealth().then((health) => setCloudHealth(health)); + }} + onRestored={() => void refreshCatalogFromServer()} + /> + )} + + {menu && + (() => { + const targets = photos.filter((p) => menu.ids.includes(p.id)); + const lead = targets[0]; + if (!lead) return null; + const sharedRating = targets.every((p) => p.rating === lead.rating) ? lead.rating : 0; + const sharedFlag = targets.every((p) => p.flag === lead.flag) ? lead.flag : 'none'; + const sharedColor = targets.every((p) => p.color === lead.color) ? lead.color : ''; + const anyEdited = targets.some((p) => isEdited(p.edits)); + const entries: MenuEntry[] = [ + { label: 'Open in Develop', shortcut: 'E', onSelect: () => openPhoto(lead.id) }, + 'separator', + { label: 'Copy settings', shortcut: '⌘C', onSelect: () => copySettingsOf(lead.id) }, + { + label: 'Paste settings…', + shortcut: '⌘V', + disabled: !clipboard, + onSelect: () => openPaste(menu.ids), + }, + { + label: 'Sync settings from this photo…', + disabled: menu.ids.length < 2, + onSelect: () => openPaste(menu.ids, 'sync', lead), + }, + 'separator', + { label: 'Reset adjustments', disabled: !anyEdited, onSelect: () => resetEdits(menu.ids) }, + { + label: 'Create virtual copy', + disabled: menu.ids.length !== 1, + onSelect: () => void createVirtualCopy(lead.id), + }, + 'separator', + { + label: 'Compare selected', + shortcut: 'C', + disabled: menu.ids.length < 2 || menu.ids.length > 4, + onSelect: () => { + setSelected(menu.ids); + setCompareOpen(true); + }, + }, + { + label: 'Stack selected', + disabled: menu.ids.length < 2, + onSelect: () => stackSelection(menu.ids), + }, + { + label: 'Unstack', + disabled: !menu.ids.some((id) => photos.find((p) => p.id === id)?.stackId), + onSelect: () => unstackSelection(menu.ids), + }, + 'separator', + { + label: 'Merge selected…', + disabled: menu.ids.length < 2, + onSelect: () => setMergeOpen(true), + }, + { label: 'Export…', onSelect: openExport }, + { label: 'Print…', onSelect: () => setPrintOpen(true) }, + { + label: trashOpen ? 'Delete permanently…' : 'Move to Trash', + danger: true, + onSelect: () => (trashOpen ? void removePhotos(menu.ids) : trashPhotos(menu.ids)), + }, + ]; + return ( + setMenu(null)} + header={ +
    + bulkUpdate(menu.ids, { rating: n })} size="md" /> + bulkUpdate(menu.ids, { flag: f })} /> + bulkUpdate(menu.ids, { color: c })} /> +
    + } + entries={entries} + /> + ); + })()} + + {pasteRequest && ( + setPasteRequest(null)} + /> + )} + + {toast && ( +
    + {toast} + {undoAction && toast === undoAction.message && ( + + )} +
    + )} +
    + ); +} diff --git a/src/components/AdminPanel.tsx b/src/components/AdminPanel.tsx new file mode 100644 index 0000000..fa946fc --- /dev/null +++ b/src/components/AdminPanel.tsx @@ -0,0 +1,1051 @@ +import { useCallback, useEffect, useRef, useState } from 'react'; +import type { + AdminInvite, + AdminOverview, + AdminQuota, + AdminUser, + CatalogBackup, + MailStatus, + SessionUser, + StorageChange, +} from '../lib/api'; +import { + adminCancelPrune, + adminCreateInvite, + adminCreateUser, + adminDeleteEvent, + adminDeleteUser, + adminRestoreCatalog, + adminRevokeInvite, + adminOverview, + adminRenameEvent, + adminSaveMail, + adminSchedulePrune, + adminSetQuota, + adminSetStorage, + adminTestMail, + adminUpdateUser, + adminWarnUser, +} from '../lib/api'; + +interface Props { + user: SessionUser; + onClose: () => void; + onChanged: () => void; + onRestored?: () => void; +} + +const fmtBytes = (bytes: number) => { + if (bytes >= 1024 ** 3) return `${(bytes / 1024 ** 3).toFixed(1)} GB`; + if (bytes >= 1024 ** 2) return `${(bytes / 1024 ** 2).toFixed(0)} MB`; + if (bytes >= 1024) return `${Math.round(bytes / 1024)} KB`; + return `${bytes} B`; +}; + +const fmtDate = (ms: number | null) => + ms ? new Date(ms).toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric' }) : '—'; + +const fmtDateTime = (ms: number | null) => + ms + ? new Date(ms).toLocaleString(undefined, { + month: 'short', + day: 'numeric', + hour: 'numeric', + minute: '2-digit', + }) + : '—'; + +const GIB = 1024 ** 3; + +const planSummary = (quota: AdminQuota) => { + const parts: string[] = []; + for (const event of quota.plan.events) { + parts.push(`${event.name} (${event.photos.length} photos, ${fmtBytes(event.bytes)})`); + } + if (quota.plan.photos.length) { + parts.push(`${quota.plan.photos.length} unassigned photos`); + } + return parts.length ? parts.join(', ') : 'nothing'; +}; + +type Tab = 'users' | 'invites' | 'content' | 'storage' | 'quotas' | 'backup'; + +const inviteUrl = (token: string) => `${window.location.origin}/join/${token}`; + +const inviteStatusLabel: Record = { + pending: 'Pending', + accepted: 'Used', + expired: 'Expired', + revoked: 'Revoked', +}; + +export default function AdminPanel({ user, onClose, onChanged, onRestored }: Props) { + const [tab, setTab] = useState('users'); + const [overview, setOverview] = useState(null); + const [busy, setBusy] = useState(false); + const [error, setError] = useState(null); + const [note, setNote] = useState(null); + + const [newEmail, setNewEmail] = useState(''); + const [newName, setNewName] = useState(''); + const [newPassword, setNewPassword] = useState(''); + const [newRole, setNewRole] = useState('member'); + + const [resetFor, setResetFor] = useState(null); + const [resetValue, setResetValue] = useState(''); + const [confirmUser, setConfirmUser] = useState(null); + + const [newInviteEmail, setNewInviteEmail] = useState(''); + const [newInviteRole, setNewInviteRole] = useState('member'); + const [newInviteDays, setNewInviteDays] = useState(7); + const [createdInvite, setCreatedInvite] = useState(null); + const [copiedInvite, setCopiedInvite] = useState(null); + + const [editEvent, setEditEvent] = useState<{ id: string; name: string } | null>(null); + const [confirmEvent, setConfirmEvent] = useState(null); + + const [rootInput, setRootInput] = useState(''); + const [change, setChange] = useState(null); + const restoreInput = useRef(null); + const [restoreNote, setRestoreNote] = useState(null); + + const [quotaDrafts, setQuotaDrafts] = useState>({}); + const [mailDraft, setMailDraft] = useState({ user: '', appPassword: '', from: '' }); + const [mail, setMail] = useState(null); + + const restoreCatalog = async (file: File | undefined) => { + if (!file || busy) return; + setBusy(true); + setError(null); + setNote(null); + setRestoreNote(null); + try { + const parsed = JSON.parse(await file.text()) as CatalogBackup; + if (parsed?.kind !== 'lumenroom-catalog') throw new Error('That file is not a Luminary catalog backup'); + const count = parsed.photos?.length ?? 0; + if (!window.confirm(`Restore ${parsed.events?.length ?? 0} events and ${count} photo records? Existing records with the same ids will be replaced. This does not restore image files.`)) { + return; + } + const result = await adminRestoreCatalog(parsed); + setRestoreNote(`Restored ${result.events} events and ${result.photos} photo records.`); + await reload(); + onRestored?.(); + } catch (err) { + setError(err instanceof Error ? err.message : 'Could not restore the catalog'); + } finally { + setBusy(false); + if (restoreInput.current) restoreInput.current.value = ''; + } + }; + + useEffect(() => { + const onKey = (e: KeyboardEvent) => { + if (e.key !== 'Escape') return; + // Inline editors (event rename, password reset) own Escape: cancel the + // field first instead of tearing down the whole panel. + if ((e.target as HTMLElement | null)?.closest?.('.admin-inline')) return; + e.preventDefault(); + e.stopImmediatePropagation(); + if (!busy) onClose(); + }; + window.addEventListener('keydown', onKey, true); + return () => window.removeEventListener('keydown', onKey, true); + }, [busy, onClose]); + + const reload = useCallback(async () => { + const next = await adminOverview(); + setOverview(next); + setMail(next.mail); + setMailDraft((current) => ({ + ...current, + user: current.user || next.mail.user, + from: current.from || next.mail.from, + })); + setRootInput((current) => (current ? current : next.storage.root)); + onChanged(); + }, [onChanged]); + + useEffect(() => { + let alive = true; + (async () => { + try { + const next = await adminOverview(); + if (!alive) return; + setOverview(next); + setMail(next.mail); + setMailDraft({ user: next.mail.user, appPassword: '', from: next.mail.from }); + setRootInput(next.storage.root); + setQuotaDrafts( + Object.fromEntries( + next.quotas.map((quota) => [quota.user.id, String(Math.round(quota.limit / GIB))]), + ), + ); + } catch (err) { + if (alive) setError(err instanceof Error ? err.message : 'Could not load administration'); + } + })(); + return () => { + alive = false; + }; + }, []); + + const run = async (action: () => Promise) => { + if (busy) return; + setBusy(true); + setError(null); + setNote(null); + try { + await action(); + await reload(); + } catch (err) { + setError(err instanceof Error ? err.message : 'That change could not be saved'); + } finally { + setBusy(false); + } + }; + + const createAccount = () => + run(async () => { + const created = await adminCreateUser({ + email: newEmail.trim(), + name: newName.trim(), + password: newPassword, + role: newRole, + }); + setNewEmail(''); + setNewName(''); + setNewPassword(''); + setNewRole('member'); + setNote(`Created ${created.email} as ${created.role}`); + }); + + const createInvite = () => + run(async () => { + const invite = await adminCreateInvite({ + email: newInviteEmail.trim(), + role: newInviteRole, + days: newInviteDays, + }); + setCreatedInvite(invite); + setNewInviteEmail(''); + setNote(`Invite link created${invite.email ? ` for ${invite.email}` : ''}`); + }); + + const copyInvite = async (invite: AdminInvite) => { + try { + await navigator.clipboard.writeText(inviteUrl(invite.token)); + setCopiedInvite(invite.token); + setTimeout(() => setCopiedInvite((current) => (current === invite.token ? null : current)), 1800); + setNote('Invite link copied'); + } catch { + // Clipboard access needs a secure context and permission. Fall back to + // showing the link in the selectable field so it can still be copied. + setCreatedInvite(invite); + setError('Clipboard is unavailable here — select the link above and copy it'); + } + }; + + const revokeInviteLink = (invite: AdminInvite) => + run(async () => { + await adminRevokeInvite(invite.token); + if (createdInvite?.token === invite.token) setCreatedInvite(null); + setCopiedInvite(null); + setNote('Invite link revoked'); + }); + + const patchUser = (target: AdminUser, patch: Parameters[1]) => + run(async () => { + await adminUpdateUser(target.id, patch); + setNote(`Updated ${target.email}`); + }); + + const resetPassword = (target: AdminUser) => { + if (resetValue.length < 8) { + setError('Use at least 8 characters for the password'); + return; + } + void run(async () => { + await adminUpdateUser(target.id, { password: resetValue }); + setResetFor(null); + setResetValue(''); + setNote(`Password reset for ${target.email}`); + }); + }; + + const removeUser = (target: AdminUser) => + run(async () => { + await adminDeleteUser(target.id); + setConfirmUser(null); + setNote(`Deleted ${target.email}`); + }); + + const saveQuota = (quota: AdminQuota) => { + const gigabytes = Number(quotaDrafts[quota.user.id]); + if (!Number.isFinite(gigabytes) || gigabytes < 1) { + setError('Enter a quota of at least 1 GB'); + return; + } + void run(async () => { + await adminSetQuota(quota.user.id, Math.round(gigabytes * GIB)); + setNote(`Quota for ${quota.user.email} set to ${gigabytes} GB`); + }); + }; + + const scheduleQuotaPrune = (quota: AdminQuota) => { + if (!quota.warn) { + setError('This account only needs a prune after it reaches the warning threshold'); + return; + } + if (!overview?.mail.configured) { + setError('Set up Gmail email notifications before scheduling a prune'); + return; + } + const freed = fmtBytes(quota.plan.freedBytes); + const proceed = window.confirm( + `Email ${quota.user.email} a 24-hour warning, then permanently remove the oldest content?\n\n${planSummary(quota)}\n\nThis will free about ${freed}.`, + ); + if (!proceed) return; + void run(async () => { + const result = await adminSchedulePrune(quota.user.id); + setNote( + `Warning sent to ${quota.user.email} · prune runs ${fmtDateTime(result.pruneAt)}`, + ); + }); + }; + + const cancelQuotaPrune = (quota: AdminQuota) => { + if (!window.confirm(`Cancel the scheduled prune for ${quota.user.email}?`)) return; + void run(async () => { + await adminCancelPrune(quota.user.id); + setNote(`Scheduled prune cancelled for ${quota.user.email}`); + }); + }; + + const warnQuotaUser = (quota: AdminQuota) => + run(async () => { + await adminWarnUser(quota.user.id); + setNote(`Quota warning emailed to ${quota.user.email}`); + }); + + const saveEmail = () => + run(async () => { + const next = await adminSaveMail({ + user: mailDraft.user.trim(), + appPassword: mailDraft.appPassword, + from: mailDraft.from.trim(), + }); + setMail(next); + setMailDraft((current) => ({ ...current, appPassword: '' })); + setNote('Gmail notification settings saved'); + }); + + const testEmail = () => + run(async () => { + await adminTestMail(user.email); + setNote(`Test email sent to ${user.email}`); + }); + + const renameEvent = () => { + if (!editEvent) return; + const name = editEvent.name.trim(); + if (!name) { + setError('Enter an event name'); + return; + } + void run(async () => { + await adminRenameEvent(editEvent.id, name); + setEditEvent(null); + setNote(`Renamed event to “${name}”`); + }); + }; + + const removeEvent = (id: string, name: string) => + run(async () => { + const result = await adminDeleteEvent(id); + setConfirmEvent(null); + setNote(`Deleted “${name}” and ${result.photos} photo${result.photos === 1 ? '' : 's'}`); + }); + + const changeStorage = () => + run(async () => { + const result = await adminSetStorage(rootInput.trim()); + setChange(result); + setRootInput(result.root); + setNote( + result.moved + ? `Images now save to ${result.root} · moved ${result.files} file${result.files === 1 ? '' : 's'} (${fmtBytes(result.bytes)})` + : 'That is already the active image folder', + ); + }); + + return ( +
    e.target === e.currentTarget && onClose()}> +
    +
    +

    Administration

    + +
    + +
    + + + + + + +
    + +
    + {!overview ? ( +

    {error ?? 'Loading…'}

    + ) : tab === 'users' ? ( +
    +
    +

    Add an account

    +
    + setNewEmail(e.target.value)} + /> + setNewName(e.target.value)} + /> + setNewPassword(e.target.value)} + /> + + +
    +
    + +
    +
    + Account + Role + Status + Actions +
    + {overview.users.map((row) => { + const self = row.id === user.id; + return ( +
    +
    + {(row.name || row.email).slice(0, 1).toUpperCase()} +
    + + {row.name || row.email} + {self && you} + +
    + {row.email} · joined {fmtDate(row.createdAt)} +
    +
    +
    + + + + + +
    + + {confirmUser === row.id ? ( + <> + + + + ) : ( + + )} +
    + + {resetFor === row.id && ( +
    + setResetValue(e.target.value)} + onKeyDown={(e) => { + if (e.key === 'Enter') resetPassword(row); + if (e.key === 'Escape') { + e.stopPropagation(); + setResetFor(null); + } + }} + /> + + + Signs that account out everywhere. +
    + )} +
    + ); + })} +
    +
    + ) : tab === 'invites' ? ( +
    +
    +

    Create an invite link

    +
    + setNewInviteEmail(e.target.value)} + /> + + + +
    +

    + {newInviteEmail.trim() + ? `Only ${newInviteEmail.trim()} can use this link.` + : 'Anyone with the link can create one account.'}{' '} + Each link is single-use and can be revoked. +

    +
    + + {createdInvite && ( +
    +
    + Invite link ready + Expires {fmtDate(createdInvite.expiresAt)} +
    +
    + e.currentTarget.select()} + /> + +
    +

    + Send this link to {createdInvite.email || 'the person you want to invite'}. They create + their own account and get their own workspace. +

    +
    + )} + +
    +
    + Invite + Role + Status + Actions +
    + {(overview.invites ?? []).length === 0 && ( +

    No invite links yet.

    + )} + {(overview.invites ?? []).map((invite) => { + const joined = invite.acceptedBy + ? overview.users.find((row) => row.id === invite.acceptedBy) + : null; + return ( +
    +
    + + {invite.email ? invite.email.slice(0, 1).toUpperCase() : '↗'} + +
    + {invite.email || 'Anyone with the link'} +
    + {invite.status === 'accepted' + ? `Joined ${fmtDate(invite.acceptedAt)}${joined ? ` as ${joined.email}` : ''}` + : `Created ${fmtDate(invite.createdAt)} · expires ${fmtDate(invite.expiresAt)}`} +
    +
    +
    + {invite.role === 'admin' ? 'Admin' : 'Member'} + + {inviteStatusLabel[invite.status] ?? invite.status} + +
    + {invite.status === 'pending' ? ( + <> + + + + ) : ( + — + )} +
    +
    + ); + })} +
    + +

    + Invite links are single-use and expire automatically. Revoking a link stops it immediately. +

    +
    + ) : tab === 'content' ? ( +
    +
    +
    +
    Photos
    +
    {overview.totals.photos}
    +
    +
    +
    Photo size
    +
    {fmtBytes(overview.totals.bytes)}
    +
    +
    +
    Events
    +
    {overview.events.length}
    +
    +
    + +
    +
    + Event + Photos + Size + Actions +
    + {overview.events.length === 0 &&

    No events yet.

    } + {overview.events.map((event) => ( +
    + {editEvent?.id === event.id ? ( +
    + setEditEvent({ id: event.id, name: e.target.value })} + onKeyDown={(e) => { + if (e.key === 'Enter') renameEvent(); + if (e.key === 'Escape') { + e.stopPropagation(); + setEditEvent(null); + } + }} + /> + + +
    + ) : ( +
    + {event.name} +
    + {event.ownerEmail || 'unassigned'} · created {fmtDate(event.createdAt)} +
    +
    + )} + + {event.photos} + {fmtBytes(event.bytes)} + +
    + + {confirmEvent === event.id ? ( + <> + + + + ) : ( + + )} +
    +
    + ))} +
    +

    + Deleting an event removes its photos and the files on disk. Accounts are unaffected. +

    +
    + ) : tab === 'quotas' ? ( +
    +
    +
    +
    Default per account
    +
    {fmtBytes(overview.quotas[0]?.limit ?? 100 * GIB)}
    +
    +
    +
    Near their limit
    +
    {overview.quotas.filter((quota) => quota.warn).length}
    +
    +
    +
    Scheduled prunes
    +
    {overview.quotas.filter((quota) => quota.pruneAt).length}
    +
    +
    + +
    +

    Gmail notifications

    +
    + setMailDraft((current) => ({ ...current, user: e.target.value }))} + /> + + setMailDraft((current) => ({ ...current, appPassword: e.target.value })) + } + /> + setMailDraft((current) => ({ ...current, from: e.target.value }))} + /> + + +
    +

    + {mail?.configured + ? `Sending through ${mail.host}:${mail.port} as ${mail.user}. A Google app password is required, not the normal Gmail password.` + : 'Add a Gmail address and its Google app password to send 24-hour prune warnings. The password is stored only on this server.'} +

    +
    + +
    +
    + Account + Usage + Quota + Actions +
    + {overview.quotas.map((quota) => ( +
    +
    + + {(quota.user.name || quota.user.email).slice(0, 1).toUpperCase()} + +
    + {quota.user.name || quota.user.email} +
    {quota.user.email}
    +
    +
    + +
    +
    + {fmtBytes(quota.used)} + / {fmtBytes(quota.limit)} · {quota.percent}% +
    +
    + +
    +
    + {quota.pruneAt + ? `Prune scheduled ${fmtDateTime(quota.pruneAt)} · warning ${fmtDateTime(quota.pruneNotifiedAt)}` + : quota.warn + ? `Warning threshold ${fmtBytes(quota.warnAt)} · ${fmtBytes(quota.remaining)} free` + : `${fmtBytes(quota.remaining)} free`} +
    +
    + +
    + + setQuotaDrafts((current) => ({ ...current, [quota.user.id]: e.target.value })) + } + aria-label={`Quota in GB for ${quota.user.email}`} + /> + GB + +
    + +
    + {quota.pruneAt ? ( + + ) : ( + + )} + +
    +
    + ))} +
    + +
    +

    + When an account reaches 90% of its quota, the user sees an in-app warning and is + emailed at most once a day. A scheduled prune always sends a warning first and + waits 24 hours. At that time the oldest events listed in the warning are removed; + photos uploaded after the warning are not touched. +

    +

    + Prune candidates: {planSummary(overview.quotas.find((quota) => quota.warn) ?? overview.quotas[0])} +

    +
    +
    + ) : tab === 'backup' ? ( +
    +

    Catalog backup

    +

    + Save events, photo records, edits, ratings, keywords, presets, collections and export + recipes as one JSON file. Image files and account passwords are not included. +

    + + +
    +

    + Restore merges records by id into this account. Existing records with the same ids are + replaced; records that are not in the backup are left alone. +

    +

    + Originals, previews and thumbnails stay in the image folder. Keep those backed up + separately if you need a complete restore after a disk loss. +

    +
    + + + + {restoreNote &&
    {restoreNote}
    } +
    + ) : ( +
    +
    +
    +
    Image folder
    +
    {overview.storage.root}
    +
    +
    +
    On disk
    +
    {fmtBytes(overview.storage.diskBytes ?? overview.totals.bytes)}
    +
    +
    +
    Photos
    +
    {overview.totals.photos}
    +
    +
    + + + +
    + + + {overview.storage.root !== overview.storage.defaultRoot && ( + + )} +
    + + {change?.moved && ( +
    + Moved {change.files} file{change.files === 1 ? '' : 's'} ({fmtBytes(change.bytes)}) from{' '} + {change.previous} to {change.root}. +
    + )} + +
    +

    + Originals, previews and thumbnails are stored here. Changing the folder moves the existing + images so the library keeps working; the database stays in the server data folder. +

    +

    + Default: {overview.storage.defaultRoot} — also settable with{' '} + LUMINARY_DATA before first start. +

    +

    + The server must be able to write to this path. In Docker, mount the host folder into the + container first (for example -v /photos:/photos), then use that container path. +

    +
    +
    + )} + + {note &&
    {note}
    } + {error &&
    {error}
    } +
    + +
    + + Signed in as {user.email} · {user.role} + + +
    +
    +
    + ); +} diff --git a/src/components/CloudPanel.tsx b/src/components/CloudPanel.tsx new file mode 100644 index 0000000..7e8ca5a --- /dev/null +++ b/src/components/CloudPanel.tsx @@ -0,0 +1,203 @@ +import { useEffect, useState } from 'react'; +import type { Health, SessionUser } from '../lib/api'; + +interface Props { + health: Health | null; + user: SessionUser | null; + busy: boolean; + note: string | null; + error: string | null; + onLogin: (email: string, password: string) => void; + onRegister: (input: { email: string; password: string; name: string; invite: string }) => void; + onLogout: () => void; + onSync: () => void; + onAdmin: () => void; + onClose: () => void; +} + +function fmtBytes(bytes: number) { + if (bytes > 1024 ** 3) return `${(bytes / 1024 ** 3).toFixed(1)} GB`; + if (bytes > 1024 ** 2) return `${(bytes / 1024 ** 2).toFixed(0)} MB`; + return `${Math.round(bytes / 1024)} KB`; +} + +export default function CloudPanel({ + health, + user, + busy, + note, + error, + onLogin, + onRegister, + onLogout, + onSync, + onAdmin, + onClose, +}: Props) { + const [mode, setMode] = useState<'signin' | 'signup'>('signin'); + const [email, setEmail] = useState(''); + const [password, setPassword] = useState(''); + const [name, setName] = useState(''); + const [invite, setInvite] = useState(''); + + useEffect(() => { + const onKey = (e: KeyboardEvent) => { + if (e.key !== 'Escape') return; + e.preventDefault(); + e.stopImmediatePropagation(); + if (!busy) onClose(); + }; + window.addEventListener('keydown', onKey, true); + return () => window.removeEventListener('keydown', onKey, true); + }, [busy, onClose]); + + const submit = () => { + if (busy) return; + if (mode === 'signin') onLogin(email.trim(), password); + else onRegister({ email: email.trim(), password, name: name.trim(), invite: invite.trim() }); + }; + + return ( +
    e.target === e.currentTarget && onClose()}> +
    +
    +

    Team server

    + +
    + +
    + {!health ? ( +
    + No server detected +

    + The library is running fully in this browser. To share photos with the team, start the + server and reload: +

    +
    npm run server
    +

    + Originals, edits and ratings are then stored on disk under server/data. +

    +
    + ) : user ? ( +
    +
    +
    {(user.name || user.email).slice(0, 1).toUpperCase()}
    +
    + {user.name || user.email} +
    + {user.email} · {user.role} +
    +
    +
    +
    +
    +
    Photos on server
    +
    {health.photos}
    +
    +
    +
    Storage used
    +
    {fmtBytes(health.bytes)}
    +
    +
    +
    Raw engine
    +
    {health.raw.libraw ? 'LibRaw demosaic' : 'Embedded previews'}
    +
    +
    +
    Server version
    +
    {health.version}
    +
    +
    +
    + + + {user.role === 'admin' && ( + + )} +
    + {note &&
    {note}
    } +
    + ) : ( + <> +
    + + +
    + + + + {mode === 'signup' && ( + + )} + + + + {mode === 'signup' && !health.needsSetup && ( + + )} + + {mode === 'signup' && health.needsSetup && ( +

    + The first account becomes the team admin. After that, create single-use invite links under + Administration → Invites. +

    + )} + + + + )} + + {error &&
    {error}
    } + + {health && ( +

    + Server sharing the folder {health.storage?.root ?? 'server/data'} · raw formats:{' '} + {health.raw.formats.length} · {health.raw.sharp ? 'JPEG encoder ready' : 'PNG fallback'} +

    + )} +
    +
    +
    + ); +} diff --git a/src/components/CommandPalette.tsx b/src/components/CommandPalette.tsx new file mode 100644 index 0000000..305c828 --- /dev/null +++ b/src/components/CommandPalette.tsx @@ -0,0 +1,183 @@ +import { useEffect, useMemo, useRef, useState } from 'react'; +import type { EventRecord, PhotoRecord } from '../types'; + +export interface PaletteAction { + id: string; + label: string; + hint?: string; + run: () => void; +} + +interface Props { + events: EventRecord[]; + photos: PhotoRecord[]; + actions: PaletteAction[]; + onOpenEvent: (id: string) => void; + onOpenPhoto: (id: string) => void; + onClose: () => void; +} + +interface Result { + key: string; + label: string; + hint: string; + kind: 'event' | 'photo' | 'action'; + thumb?: string; + run: () => void; +} + +export default function CommandPalette({ + events, + photos, + actions, + onOpenEvent, + onOpenPhoto, + onClose, +}: Props) { + const [query, setQuery] = useState(''); + const [active, setActive] = useState(0); + const inputRef = useRef(null); + const listRef = useRef(null); + + useEffect(() => { + inputRef.current?.focus(); + }, []); + + useEffect(() => { + setActive(0); + }, [query]); + + const eventNames = useMemo( + () => new Map(events.map((event) => [event.id, event.name])), + [events], + ); + + const results = useMemo(() => { + const term = query.trim().toLowerCase(); + const matches = (values: (string | undefined)[]) => + !term || values.some((value) => value?.toLowerCase().includes(term)); + const actionsFound: Result[] = actions + .filter((action) => matches([action.label, action.hint])) + .slice(0, 5) + .map((action) => ({ + key: `action:${action.id}`, + label: action.label, + hint: action.hint ?? 'Action', + kind: 'action', + run: action.run, + })); + const eventsFound: Result[] = events + .filter((event) => matches([event.name])) + .slice(0, 6) + .map((event) => ({ + key: `event:${event.id}`, + label: event.name, + hint: 'Event', + kind: 'event', + run: () => onOpenEvent(event.id), + })); + const photosFound: Result[] = photos + .filter((photo) => + matches([ + photo.name, + photo.title, + photo.caption, + photo.creator, + photo.meta.camera, + photo.meta.lens, + eventNames.get(photo.eventId), + ...photo.keywords, + ]), + ) + .slice(0, 18) + .map((photo) => ({ + key: `photo:${photo.id}`, + label: photo.title || photo.name, + hint: [eventNames.get(photo.eventId), photo.meta.camera].filter(Boolean).join(' · ') || 'Photo', + kind: 'photo', + thumb: photo.thumbUrl ?? photo.thumb, + run: () => onOpenPhoto(photo.id), + })); + return [...actionsFound, ...eventsFound, ...photosFound]; + }, [actions, eventNames, events, onOpenEvent, onOpenPhoto, photos, query]); + + useEffect(() => { + const item = listRef.current?.querySelector(`[data-index="${active}"]`); + item?.scrollIntoView({ block: 'nearest' }); + }, [active]); + + const choose = (result: Result | undefined) => { + if (!result) return; + result.run(); + onClose(); + }; + + return ( +
    e.target === e.currentTarget && onClose()}> +
    +
    + + setQuery(e.target.value)} + onKeyDown={(e) => { + if (e.key === 'Escape') { + e.preventDefault(); + onClose(); + } else if (e.key === 'ArrowDown') { + e.preventDefault(); + setActive((index) => Math.min(results.length - 1, index + 1)); + } else if (e.key === 'ArrowUp') { + e.preventDefault(); + setActive((index) => Math.max(0, index - 1)); + } else if (e.key === 'Enter') { + e.preventDefault(); + choose(results[active]); + } + }} + /> + esc +
    + +
    + {results.length ? ( + results.map((result, index) => ( + + )) + ) : ( +
    No matches for “{query.trim()}”.
    + )} +
    + +
    + ↑↓ navigate + ↵ open + esc close +
    +
    +
    + ); +} diff --git a/src/components/CompareView.tsx b/src/components/CompareView.tsx new file mode 100644 index 0000000..e2a93fb --- /dev/null +++ b/src/components/CompareView.tsx @@ -0,0 +1,162 @@ +import { useEffect, useRef, useState } from 'react'; +import { getBitmap } from '../lib/images'; +import { rotatedBounds, Renderer } from '../gl/renderer'; +import { buildLensCorrection, type LensCorrection } from '../lib/lensfun'; +import type { PhotoRecord } from '../types'; + +interface Props { + photos: PhotoRecord[]; + onClose: () => void; + onOpen: (id: string) => void; +} + +function CompareTile({ photo, onOpen }: { photo: PhotoRecord; onOpen: (id: string) => void }) { + const canvasRef = useRef(null); + const boxRef = useRef(null); + const rendererRef = useRef(null); + const [bitmap, setBitmap] = useState(null); + const [box, setBox] = useState({ w: 0, h: 0 }); + const [lensCorrection, setLensCorrection] = useState(null); + const [error, setError] = useState(null); + + useEffect(() => { + let alive = true; + getBitmap(photo) + .then((next) => alive && setBitmap(next)) + .catch((err) => alive && setError(err instanceof Error ? err.message : 'Could not load the photo')); + return () => { + alive = false; + }; + }, [photo]); + + useEffect(() => { + let alive = true; + if (!photo.edits.lens || !bitmap) { + setLensCorrection(null); + return; + } + buildLensCorrection(photo.edits.lens, { + width: bitmap.width, + height: bitmap.height, + meta: photo.meta, + }) + .then((correction) => alive && setLensCorrection(correction)) + .catch(() => alive && setLensCorrection(null)); + return () => { + alive = false; + }; + }, [bitmap, photo.edits.lens, photo.meta]); + + useEffect(() => { + const el = boxRef.current; + if (!el) return; + const measure = () => setBox({ w: el.clientWidth, h: el.clientHeight }); + measure(); + const observer = new ResizeObserver(measure); + observer.observe(el); + return () => observer.disconnect(); + }, []); + + useEffect(() => { + const canvas = canvasRef.current; + if (!canvas) return; + try { + rendererRef.current = new Renderer(canvas); + } catch (err) { + setError(err instanceof Error ? err.message : 'The image engine could not start'); + } + return () => { + rendererRef.current?.dispose(); + rendererRef.current = null; + }; + }, []); + + useEffect(() => { + const renderer = rendererRef.current; + const canvas = canvasRef.current; + if (!renderer || !canvas || !bitmap || box.w < 30 || box.h < 30) return; + // Wait for the layout pass, then draw in a frame callback: uploading the + // source while the tile is still being measured can lose the first frame. + const raf = requestAnimationFrame(() => { + const frame = rotatedBounds(bitmap.width, bitmap.height, photo.edits.crop.angle, photo.edits.crop.quarter); + const aspect = (frame.w * photo.edits.crop.w) / Math.max(1, frame.h * photo.edits.crop.h); + let cssW = box.w; + let cssH = cssW / aspect; + if (cssH > box.h) { + cssH = box.h; + cssW = cssH * aspect; + } + cssW = Math.max(20, Math.round(cssW)); + cssH = Math.max(20, Math.round(cssH)); + canvas.style.width = `${cssW}px`; + canvas.style.height = `${cssH}px`; + const dpr = Math.min(window.devicePixelRatio || 1, 2); + const cap = Math.min(1, 2200 / Math.max(cssW * dpr, cssH * dpr)); + const opts = { + width: Math.max(1, Math.round(cssW * dpr * cap)), + height: Math.max(1, Math.round(cssH * dpr * cap)), + lens: lensCorrection, + }; + try { + renderer.setImage(bitmap); + renderer.render(photo.edits, opts); + } catch (err) { + setError(err instanceof Error ? err.message : 'Rendering failed'); + } + }); + return () => cancelAnimationFrame(raf); + }, [bitmap, box, photo, lensCorrection]); + + return ( +
    onOpen(photo.id)}> +
    + {error ?
    {error}
    : } +
    +
    + + {photo.name} + + {photo.rating ? '★'.repeat(photo.rating) : '—'} + +
    +
    + ); +} + +/** Side-by-side survey of 2–4 selected frames. */ +export default function CompareView({ photos, onClose, onOpen }: Props) { + useEffect(() => { + const onKey = (e: KeyboardEvent) => { + if (e.key !== 'Escape') return; + e.preventDefault(); + e.stopImmediatePropagation(); + onClose(); + }; + window.addEventListener('keydown', onKey, true); + return () => window.removeEventListener('keydown', onKey, true); + }, [onClose]); + + return ( +
    +
    +
    + Compare + + {' '} + · {photos.length} photo{photos.length === 1 ? '' : 's'} · double-click a frame to edit + +
    + +
    +
    + {photos.map((photo) => ( + + ))} +
    +
    + ); +} diff --git a/src/components/ContextMenu.tsx b/src/components/ContextMenu.tsx new file mode 100644 index 0000000..9447dff --- /dev/null +++ b/src/components/ContextMenu.tsx @@ -0,0 +1,99 @@ +import { useEffect, useLayoutEffect, useRef, useState, type ReactNode } from 'react'; +import { createPortal } from 'react-dom'; + +export interface MenuAction { + label: string; + shortcut?: string; + onSelect: () => void; + disabled?: boolean; + danger?: boolean; +} + +export type MenuEntry = MenuAction | 'separator'; + +interface Props { + x: number; + y: number; + entries: MenuEntry[]; + header?: ReactNode; + onClose: () => void; +} + +/** + * Right-click menu anchored to the pointer. Rendered in a portal so the app's + * scroll containers and panel overflow cannot clip it, and nudged inside the + * window when the cursor is close to an edge. + */ +export default function ContextMenu({ x, y, entries, header, onClose }: Props) { + const ref = useRef(null); + const [pos, setPos] = useState<{ left: number; top: number } | null>(null); + + useLayoutEffect(() => { + const el = ref.current; + if (!el) return; + const rect = el.getBoundingClientRect(); + const margin = 8; + setPos({ + left: Math.max(margin, Math.min(x, window.innerWidth - rect.width - margin)), + top: Math.max(margin, Math.min(y, window.innerHeight - rect.height - margin)), + }); + }, [x, y]); + + useEffect(() => { + const onPointerDown = (e: PointerEvent) => { + if (ref.current && e.target instanceof Node && ref.current.contains(e.target)) return; + onClose(); + }; + const onKeyDown = (e: KeyboardEvent) => { + if (e.key !== 'Escape') return; + e.preventDefault(); + e.stopPropagation(); + onClose(); + }; + window.addEventListener('pointerdown', onPointerDown, true); + window.addEventListener('keydown', onKeyDown, true); + window.addEventListener('resize', onClose); + window.addEventListener('blur', onClose); + window.addEventListener('wheel', onClose, { passive: true }); + return () => { + window.removeEventListener('pointerdown', onPointerDown, true); + window.removeEventListener('keydown', onKeyDown, true); + window.removeEventListener('resize', onClose); + window.removeEventListener('blur', onClose); + window.removeEventListener('wheel', onClose); + }; + }, [onClose]); + + return createPortal( +
    e.preventDefault()} + > + {header &&
    {header}
    } + {entries.map((entry, i) => + entry === 'separator' ? ( +
    + ) : ( + + ), + )} +
    , + document.body, + ); +} diff --git a/src/components/CropOverlay.tsx b/src/components/CropOverlay.tsx new file mode 100644 index 0000000..3ca1b6f --- /dev/null +++ b/src/components/CropOverlay.tsx @@ -0,0 +1,268 @@ +import { useEffect, useRef, useState, type PointerEvent } from 'react'; +import { clamp } from '../lib/curves'; +import { grainSampleWindow, Renderer } from '../gl/renderer'; +import type { CropState, Edits } from '../types'; + +type Mode = 'move' | 'nw' | 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w'; + +/** + * Point (frame uv) the loupe sits on when dragged to `u`,`v` inside the crop + * rectangle, kept a half-box away from its edges so the patch stays inside. + */ +export function clampLoupe( + crop: { x: number; y: number; w: number; h: number }, + u: number, + v: number, + halfU: number, + halfV: number, +) { + const cx = Math.min(1 - halfU, Math.max(halfU, Math.min(1, Math.max(0, u)))); + const cy = Math.min(1 - halfV, Math.max(halfV, Math.min(1, Math.max(0, v)))); + return { x: crop.x + cx * crop.w, y: crop.y + cy * crop.h }; +} + +interface Props { + crop: CropState; + frame: { w: number; h: number }; + ratio: number | null; + bitmap: ImageBitmap | null; + edits: Edits; + onChange: (rect: Partial) => void; + /** lets the preview hold the grain still while a handle is moving */ + onDragChange?: (busy: boolean) => void; +} + +const MIN = 0.04; + +function clampRect(r: CropState): CropState { + let w = clamp(r.w, MIN, 1); + let h = clamp(r.h, MIN, 1); + const x = clamp(r.x, 0, 1 - w); + const y = clamp(r.y, 0, 1 - h); + return { ...r, x, y, w, h }; +} + +function applyDrag( + start: CropState, + mode: Mode, + dx: number, + dy: number, + ratio: number | null, + frame: { w: number; h: number }, +): Partial { + let { x, y, w, h } = start; + + if (mode === 'move') { + x = clamp(x + dx, 0, 1 - w); + y = clamp(y + dy, 0, 1 - h); + return { x, y }; + } + + if (mode.includes('e')) w = clamp(w + dx, MIN, 1 - x); + if (mode.includes('s')) h = clamp(h + dy, MIN, 1 - y); + if (mode.includes('w')) { + const nx = clamp(x + dx, 0, x + w - MIN); + w += x - nx; + x = nx; + } + if (mode.includes('n')) { + const ny = clamp(y + dy, 0, y + h - MIN); + h += y - ny; + y = ny; + } + + if (ratio) { + const frameRatio = frame.w / frame.h; + const dragsWidth = mode.includes('e') || mode.includes('w'); + if (dragsWidth) { + const targetH = (w * frameRatio) / ratio; + if (mode.includes('n')) y = y + h - targetH; + h = targetH; + } else if (mode.includes('n') || mode.includes('s')) { + const targetW = (h * ratio) / frameRatio; + x += (w - targetW) / 2; + w = targetW; + } + if (w > 1) { + const k = 1 / w; + w *= k; + h *= k; + } + if (h > 1) { + const k = 1 / h; + w *= k; + h *= k; + } + if (mode.includes('w')) x = start.x + start.w - w; + if (mode.includes('n')) y = start.y + start.h - h; + x = clamp(x, 0, 1 - w); + y = clamp(y, 0, 1 - h); + } + + return clampRect({ ...start, x, y, w, h }); +} + +export default function CropOverlay({ crop, frame, ratio, bitmap, edits, onChange, onDragChange }: Props) { + const ref = useRef(null); + const start = useRef<{ mode: Mode; x: number; y: number; rect: CropState } | null>(null); + const [dragging, setDragging] = useState(false); + const loupe = useRef(null); + const loupeRenderer = useRef(null); + /** where the patch is sampling, in frame uv; null = centre of the rectangle */ + const [loupePoint, setLoupePoint] = useState<{ x: number; y: number } | null>(null); + /** pointer offset from the patch centre while it is being dragged */ + const grab = useRef<{ x: number; y: number } | null>(null); + + useEffect( + () => () => { + loupeRenderer.current?.dispose(); + loupeRenderer.current = null; + }, + [], + ); + + // A live 1:1 grain patch inside the crop rectangle: it samples whatever area the + // rectangle frames, so the rectangle can be judged as it is dragged. + useEffect(() => { + const canvas = loupe.current; + if (!canvas || !bitmap) return; + const dpr = Math.min(window.devicePixelRatio || 1, 2); + const cssW = 120; + const cropPxW = Math.max(1, frame.w * crop.w); + const cropPxH = Math.max(1, frame.h * crop.h); + const cssH = Math.round(Math.min(96, Math.max(48, cssW * (cropPxH / cropPxW)))); + const W = Math.max(1, Math.round(cssW * dpr)); + const H = Math.max(1, Math.round(cssH * dpr)); + canvas.style.width = `${cssW}px`; + canvas.style.height = `${cssH}px`; + if (canvas.width !== W) canvas.width = W; + if (canvas.height !== H) canvas.height = H; + try { + if (!loupeRenderer.current) loupeRenderer.current = new Renderer(canvas); + const r = loupeRenderer.current; + r.setImage(bitmap); + const view = grainSampleWindow(frame, crop, W, H, loupePoint); + r.render({ ...edits, crop }, { width: W, height: H, view }); + } catch { + // The overlay still works if the engine cannot start a second context. + } + }, [bitmap, crop, edits, frame, loupePoint]); + + const dpr = Math.min(typeof window === 'undefined' ? 1 : window.devicePixelRatio || 1, 2); + const loupeCssW = 120; + const cropPxW = Math.max(1, frame.w * crop.w); + const cropPxH = Math.max(1, frame.h * crop.h); + const loupeCssH = Math.round(Math.min(96, Math.max(48, loupeCssW * (cropPxH / cropPxW)))); + const loupeW = Math.max(1, Math.round(loupeCssW * dpr)); + const loupeH = Math.max(1, Math.round(loupeCssH * dpr)); + const view = grainSampleWindow(frame, crop, loupeW, loupeH, loupePoint); + const fits = crop.w > 0.16 && crop.h > 0.16; + const loupeAt = { + left: `${((view.x + view.w / 2 - crop.x) / crop.w) * 100}%`, + top: `${((view.y + view.h / 2 - crop.y) / crop.h) * 100}%`, + width: `${loupeCssW}px`, + height: `${loupeCssH}px`, + transform: 'translate(-50%, -50%)', + display: fits && bitmap ? 'block' : 'none', + }; + + const startLoupe = (e: PointerEvent) => { + e.preventDefault(); + e.stopPropagation(); + e.currentTarget.setPointerCapture(e.pointerId); + const box = e.currentTarget.parentElement?.getBoundingClientRect(); + if (!box || !box.width || !box.height) return; + const cx = box.left + ((view.x + view.w / 2 - crop.x) / crop.w) * box.width; + const cy = box.top + ((view.y + view.h / 2 - crop.y) / crop.h) * box.height; + grab.current = { x: e.clientX - cx, y: e.clientY - cy }; + }; + + const moveLoupe = (e: PointerEvent) => { + const g = grab.current; + if (!g) return; + const box = e.currentTarget.parentElement?.getBoundingClientRect(); + if (!box || !box.width || !box.height) return; + const halfU = Math.min(0.5, loupeCssW / 2 / box.width); + const halfV = Math.min(0.5, loupeCssH / 2 / box.height); + setLoupePoint( + clampLoupe( + crop, + (e.clientX - g.x - box.left) / box.width, + (e.clientY - g.y - box.top) / box.height, + halfU, + halfV, + ), + ); + }; + + const endLoupe = () => { + grab.current = null; + }; + + const onPointerDown = (e: React.PointerEvent) => { + const el = e.target as HTMLElement; + const mode = (el.dataset.mode ?? 'move') as Mode; + e.preventDefault(); + e.stopPropagation(); + ref.current?.setPointerCapture(e.pointerId); + start.current = { mode, x: e.clientX, y: e.clientY, rect: { ...crop } }; + setDragging(true); + onDragChange?.(true); + }; + + const onPointerMove = (e: React.PointerEvent) => { + const s = start.current; + const el = ref.current; + if (!s || !el) return; + const rect = el.getBoundingClientRect(); + if (!rect.width || !rect.height) return; + const dx = (e.clientX - s.x) / rect.width; + const dy = (e.clientY - s.y) / rect.height; + onChange(applyDrag(s.rect, s.mode, dx, dy, ratio, frame)); + }; + + const end = (e: React.PointerEvent) => { + if (ref.current?.hasPointerCapture(e.pointerId)) ref.current.releasePointerCapture(e.pointerId); + start.current = null; + setDragging(false); + onDragChange?.(false); + }; + + const style = { + left: `${crop.x * 100}%`, + top: `${crop.y * 100}%`, + width: `${crop.w * 100}%`, + height: `${crop.h * 100}%`, + }; + + return ( +
    +
    +
    + {(['nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w'] as Mode[]).map((m) => ( + + ))} + + + {Math.round(crop.w * 100)}% × {Math.round(crop.h * 100)}% + +
    +
    + ); +} diff --git a/src/components/CurveEditor.tsx b/src/components/CurveEditor.tsx new file mode 100644 index 0000000..2db1ad2 --- /dev/null +++ b/src/components/CurveEditor.tsx @@ -0,0 +1,122 @@ +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { buildSampler, clamp01 } from '../lib/curves'; +import type { CurvePoint } from '../types'; + +interface Props { + points: CurvePoint[]; + onChange: (points: CurvePoint[]) => void; + color: string; +} + +export default function CurveEditor({ points, onChange, color }: Props) { + const svgRef = useRef(null); + const pointsRef = useRef(points); + const [drag, setDrag] = useState(null); + const [hover, setHover] = useState(null); + + useEffect(() => { + pointsRef.current = points; + }, [points]); + + const sampler = useMemo(() => buildSampler(points), [points]); + + const path = useMemo(() => { + const segs: string[] = []; + for (let i = 0; i <= 80; i++) { + const x = i / 80; + const y = sampler(x); + segs.push(`${i === 0 ? 'M' : 'L'}${(x * 100).toFixed(2)},${((1 - y) * 100).toFixed(2)}`); + } + return segs.join(' '); + }, [sampler]); + + const toNorm = useCallback((clientX: number, clientY: number) => { + const svg = svgRef.current; + if (!svg) return { x: 0, y: 0 }; + const rect = svg.getBoundingClientRect(); + return { + x: clamp01((clientX - rect.left) / rect.width), + y: clamp01(1 - (clientY - rect.top) / rect.height), + }; + }, []); + + const handleDown = (e: React.PointerEvent) => { + e.preventDefault(); + const idxAttr = (e.target as Element).getAttribute('data-idx'); + let idx: number; + if (idxAttr !== null) { + idx = Number(idxAttr); + } else { + const p = toNorm(e.clientX, e.clientY); + const next = [...points, { x: p.x, y: p.y }].sort((a, b) => a.x - b.x); + idx = next.findIndex((pt) => pt.x === p.x && pt.y === p.y); + onChange(next); + } + setDrag(idx); + e.currentTarget.setPointerCapture(e.pointerId); + }; + + const handleMove = (e: React.PointerEvent) => { + if (drag === null) return; + const pts = pointsRef.current; + const idx = drag; + if (!pts[idx]) return; + const p = toNorm(e.clientX, e.clientY); + const lo = idx > 0 ? pts[idx - 1].x + 0.01 : 0; + const hi = idx < pts.length - 1 ? pts[idx + 1].x - 0.01 : 1; + const next = pts.map((pt, i) => (i === idx ? { x: Math.min(hi, Math.max(lo, p.x)), y: p.y } : pt)); + onChange(next); + }; + + const handleUp = () => setDrag(null); + + const removePoint = (idx: number) => { + const pts = pointsRef.current; + if (pts.length <= 2) return; + onChange(pts.filter((_, i) => i !== idx)); + setDrag(null); + }; + + return ( +
    + { + const idxAttr = (e.target as Element).getAttribute('data-idx'); + if (idxAttr !== null) removePoint(Number(idxAttr)); + }} + > + + {[25, 50, 75].map((v) => ( + + + + + ))} + + + {points.map((p, i) => ( + setHover(i)} + onPointerLeave={() => setHover((h) => (h === i ? null : h))} + /> + ))} + +
    Click to add a point · drag to shape · double-click a point to remove
    +
    + ); +} diff --git a/src/components/Develop.tsx b/src/components/Develop.tsx new file mode 100644 index 0000000..3728987 --- /dev/null +++ b/src/components/Develop.tsx @@ -0,0 +1,2392 @@ +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { + ASPECTS, + defaultEdits, + defaultLocalLayer, + MAX_HEAL_SPOTS, + MAX_LOCAL_LAYERS, + thumbTransform, +} from '../lib/edits'; +import { subscribeClipPreview } from '../lib/clipPreview'; +import { getBitmap, getDenoisedBitmap } from '../lib/images'; +import { useMediaQuery } from '../lib/useMediaQuery'; +import { usePersistentState } from '../lib/usePersistentState'; +import { solveWhiteBalance } from '../lib/whiteBalance'; +import { buildAutoMask, type AutoMaskKind } from '../lib/autoMask'; +import { + buildLensCorrection, + correctLensPoint, + uncorrectLensPoint, + type LensCorrection, +} from '../lib/lensfun'; +import { + frameToSource, + rotatedBounds, + Renderer, + sourceToFrame, + unwarpGeometryPoint, + warpGeometryPoint, +} from '../gl/renderer'; +import type { + ColorLabel, + Edits, + EventRecord, + Flag, + HealSpot, + LocalLayer, + LocalMaskKind, + LocalStroke, + MetadataPreset, + PhotoRecord, + Preset, + Snapshot, +} from '../types'; +import ContextMenu, { type MenuEntry } from './ContextMenu'; +import CropOverlay from './CropOverlay'; +import Histogram from './Histogram'; +import { + BasicPanel, + ColorGradingPanel, + CropPanel, + CurvePanel, + DetailPanel, + EffectsPanel, + HistoryPanel, + HslPanel, + LocalPanel, + MetadataPanel, + NavigatorPanel, + OpticsPanel, + PresetsPanel, + ProofPanel, + SnapshotsPanel, +} from './Panels'; +import Stars, { ColorSwatches, FlagButtons } from './Stars'; + +/** Zoom is expressed as a percentage of actual pixels, like Lightroom's readout. */ +const MAX_ZOOM = 400; +const clampNum = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v)); + +interface Rect { + x: number; + y: number; + w: number; + h: number; +} + +interface Geometry { + fitScale: number; + fitPct: number; + frameW: number; + frameH: number; + zoomFactor: number; + availW: number; + availH: number; + content: Rect; + view: Rect; +} + +const EMPTY_GEO: Geometry = { + fitScale: 0, + fitPct: 100, + frameW: 1, + frameH: 1, + zoomFactor: 1, + availW: 0, + availH: 0, + content: { x: 0, y: 0, w: 1, h: 1 }, + view: { x: 0, y: 0, w: 1, h: 1 }, +}; + +function cloneLocalLayer(layer: LocalLayer): LocalLayer { + return { + ...layer, + brush: { + strokes: layer.brush.strokes.map((stroke) => ({ + ...stroke, + points: stroke.points.map((point) => ({ ...point })), + })), + }, + linear: { ...layer.linear }, + radial: { ...layer.radial }, + adjust: { ...layer.adjust }, + range: { ...layer.range }, + }; +} + +interface Props { + photo: PhotoRecord; + photos: PhotoRecord[]; + events: EventRecord[]; + onSelect: (id: string) => void; + onExit: () => void; + onUpdate: (id: string, patch: Partial, historyLabel?: string) => void; + clipboard: Edits | null; + onCopy: () => void; + onPaste: () => void; + localClipboard: LocalLayer | null; + onLocalClipboard: (layer: LocalLayer | null) => void; + onExport: () => void; + onPrint: () => void; + presets: Preset[]; + onSavePreset: (name: string, edits: Edits) => void; + onDelete: () => void; + onVirtualCopy: () => void; + metadataPresets: MetadataPreset[]; + keywordLibrary: string[]; + onSaveSnapshot: (name: string) => void; + onRestoreSnapshot: (snapshot: Snapshot) => void; + onDeleteSnapshot: (snapshot: Snapshot) => void; + onSaveMetadataPreset: (preset: Omit) => void; + onDeleteMetadataPreset: (id: string) => void; +} + +export default function Develop({ + photo, + photos, + events, + onSelect, + onExit, + onUpdate, + clipboard, + onCopy, + onPaste, + localClipboard, + onLocalClipboard, + onExport, + onPrint, + presets, + onSavePreset, + onDelete, + onVirtualCopy, + metadataPresets, + keywordLibrary, + onSaveSnapshot, + onRestoreSnapshot, + onDeleteSnapshot, + onSaveMetadataPreset, + onDeleteMetadataPreset, +}: Props) { + const canvasRef = useRef(null); + const stageRef = useRef(null); + const stripRef = useRef(null); + const rendererRef = useRef(null); + const histRef = useRef(null); + const geoRef = useRef(EMPTY_GEO); + const panRef = useRef<{ x: number; y: number; cx: number; cy: number } | null>(null); + + const [bitmap, setBitmap] = useState(null); + const [denoisedBitmap, setDenoisedBitmap] = useState(null); + const [stage, setStage] = useState({ w: 0, h: 0 }); + const [cropMode, setCropMode] = useState(false); + const [cropDrag, setCropDrag] = useState(false); + const [clipPreview, setClipPreview] = useState(false); + const [picking, setPicking] = useState(false); + const [clipping, setClipping] = useState<'highlights' | 'shadows' | null>(null); + const [loupe, setLoupe] = useState(false); + const [adjustOpen, setAdjustOpen] = useState(false); + const [leftOpen, setLeftOpen] = usePersistentState('develop.left.open', true); + const [rightOpen, setRightOpen] = usePersistentState('develop.right.open', true); + const [stripOpen, setStripOpen] = usePersistentState('develop.filmstrip.open', true); + const [mobileStripOpen, setMobileStripOpen] = useState(false); + const [mobileAdjustOpen, setMobileAdjustOpen] = useState(false); + const [tipDismissed, setTipDismissed] = usePersistentState('develop.tip.dismissed', false); + const mobile = useMediaQuery('(max-width: 760px)'); + const shownStripOpen = mobile ? mobileStripOpen : stripOpen; + const toggleStrip = () => (mobile ? setMobileStripOpen((open) => !open) : setStripOpen((open) => !open)); + const [filmMinRating, setFilmMinRating] = useState(0); + const [filmFlag, setFilmFlag] = useState('any'); + const [showOriginal, setShowOriginal] = useState(false); + const [histVersion, setHistVersion] = useState(0); + const [error, setError] = useState(null); + const [loading, setLoading] = useState(true); + const [zoom, setZoom] = useState<{ pct: number | 'fit'; cx: number; cy: number }>({ + pct: 'fit', + cx: 0.5, + cy: 0.5, + }); + const [panning, setPanning] = useState(false); + const [navigatorView, setNavigatorView] = useState(null); + const [readout, setReadout] = useState({ shown: 100, fit: 100 }); + const [menu, setMenu] = useState<{ x: number; y: number; kind: 'canvas' | 'film' } | null>(null); + const [healMode, setHealMode] = useState(false); + const [brushPx, setBrushPx] = useState(56); + const [healFeather, setHealFeather] = useState(50); + const [healSelected, setHealSelected] = useState(null); + const [healHover, setHealHover] = useState<{ x: number; y: number } | null>(null); + const healDrag = useRef<{ index: number; mode: 'target' | 'source'; spot: HealSpot } | null>(null); + + const [localSelected, setLocalSelected] = useState(null); + const [localMode, setLocalMode] = useState(false); + const [autoMaskBusy, setAutoMaskBusy] = useState(false); + const [localBrush, setLocalBrush] = useState(72); + const [localHover, setLocalHover] = useState<{ x: number; y: number } | null>(null); + const [localDraft, setLocalDraft] = useState(null); + const [lensCorrection, setLensCorrection] = useState(null); + const [lensSplit, setLensSplit] = useState(false); + const [lensSplitAt, setLensSplitAt] = useState(0.5); + const [lensState, setLensState] = useState<{ loading: boolean; error: string | null }>({ + loading: false, + error: null, + }); + const localDrag = useRef<{ + id: string; + mode: 'brush' | 'center' | 'edge' | 'edgeX' | 'edgeY' | 'start' | 'end'; + stroke: LocalStroke | null; + } | null>(null); + + const edits = photo.edits; + const activeLocal = (edits.local ?? []).find((layer) => layer.id === localSelected) ?? null; + const zoomed = zoom.pct !== 'fit'; + + // The filmstrip has its own Lightroom-style cull filter so you can narrow the + // strip without changing the grid filters or the photo open on the canvas. + const filmFilterActive = filmMinRating > 0 || filmFlag !== 'any'; + const filmPhotos = useMemo( + () => + photos.filter( + (item) => item.rating >= filmMinRating && (filmFlag === 'any' || item.flag === filmFlag), + ), + [photos, filmMinRating, filmFlag], + ); + const filmPosition = filmPhotos.findIndex((item) => item.id === photo.id); + const currentInFilm = filmPosition >= 0; + + const navigateFilm = useCallback( + (dir: -1 | 1) => { + if (!filmPhotos.length) return; + const at = filmPhotos.findIndex((item) => item.id === photo.id); + if (at < 0) { + const edge = dir > 0 ? filmPhotos[0] : filmPhotos[filmPhotos.length - 1]; + if (edge) onSelect(edge.id); + return; + } + const next = filmPhotos[at + dir]; + if (next) onSelect(next.id); + }, + [filmPhotos, onSelect, photo.id], + ); + + const moveLensSplit = (e: React.PointerEvent) => { + const rect = e.currentTarget.parentElement?.getBoundingClientRect(); + if (!rect || rect.width <= 0) return; + setLensSplitAt(clampNum((e.clientX - rect.left) / rect.width, 0.02, 0.98)); + }; + + const setEdits = useCallback( + (patch: Partial, label: string) => { + onUpdate(photo.id, { edits: { ...photo.edits, ...patch } }, label); + }, + [onUpdate, photo.id, photo.edits], + ); + + useEffect(() => { + const canvas = canvasRef.current; + if (!canvas) return; + try { + rendererRef.current = new Renderer(canvas); + } catch (err) { + setError(err instanceof Error ? err.message : 'The image engine could not start'); + } + return () => { + rendererRef.current?.dispose(); + rendererRef.current = null; + }; + }, []); + + // Ctrl held while dragging Exposure paints clipped channels on the preview. + useEffect(() => subscribeClipPreview(setClipPreview), []); + + useEffect(() => { + const el = stageRef.current; + if (!el) return; + setStage({ w: el.clientWidth, h: el.clientHeight }); + const ro = new ResizeObserver((entries) => { + const rect = entries[0].contentRect; + setStage({ w: Math.round(rect.width), h: Math.round(rect.height) }); + }); + ro.observe(el); + return () => ro.disconnect(); + }, [cropMode]); + + // The denoised proxy is a separate server asset keyed by the edit. Load it + // alongside the source so the first frame after generating is not stale, and + // drop it when the key is cleared. + useEffect(() => { + const key = edits.aiDenoise.key; + if (!key) { + setDenoisedBitmap(null); + return; + } + let alive = true; + getDenoisedBitmap(photo, key) + .then((bmp) => { + if (alive) setDenoisedBitmap(bmp); + }) + .catch(() => { + if (alive) setDenoisedBitmap(null); + }); + return () => { + alive = false; + }; + }, [photo.id, edits.aiDenoise.key]); + + useEffect(() => { + let alive = true; + setLoading(true); + getBitmap(photo) + .then((bmp) => { + if (!alive) return; + setBitmap(bmp); + setLoading(false); + }) + .catch((err) => { + if (!alive) return; + setError(err instanceof Error ? err.message : 'Could not load the original image'); + setLoading(false); + }); + return () => { + alive = false; + }; + }, [photo.id, photo.raw, photo.previewUrl]); + + // Warm the previous and next originals while the current frame is being + // edited, so arrow-key culling does not wait on a network fetch each time. + useEffect(() => { + const at = filmPhotos.findIndex((item) => item.id === photo.id); + if (at < 0) return; + const neighbours = [filmPhotos[at - 1], filmPhotos[at + 1]].filter( + (item): item is PhotoRecord => Boolean(item), + ); + if (!neighbours.length) return; + let alive = true; + const timer = setTimeout(() => { + if (!alive) return; + for (const next of neighbours) void getBitmap(next).catch(() => undefined); + }, 450); + return () => { + alive = false; + clearTimeout(timer); + }; + }, [filmPhotos, photo.id]); + + // Build the calibrated maps for the selected profile once per photo and + // correction setting. Lensfun is loaded lazily, so photos without a profile + // never pay for the database. + useEffect(() => { + const profile = edits.lens; + if (!profile) { + setLensCorrection(null); + setLensState({ loading: false, error: null }); + setLensSplit(false); + return; + } + let alive = true; + setLensCorrection(null); + setLensState({ loading: true, error: null }); + buildLensCorrection(profile, { + width: bitmap?.width ?? photo.width, + height: bitmap?.height ?? photo.height, + meta: photo.meta, + }) + .then((correction) => { + if (!alive) return; + setLensCorrection(correction); + setLensState({ loading: false, error: null }); + }) + .catch((err) => { + if (!alive) return; + console.error('Lens correction failed', err); + setLensCorrection(null); + setLensState({ + loading: false, + error: err instanceof Error ? err.message : 'Could not build the lens correction', + }); + }); + return () => { + alive = false; + }; + }, [edits.lens, bitmap, photo.id, photo.width, photo.height, photo.meta]); + + // A new photo, a crop change or entering crop mode all invalidate the current view. + useEffect(() => { + setZoom({ pct: 'fit', cx: 0.5, cy: 0.5 }); + }, [photo.id, cropMode, edits.crop]); + + // Leaving crop mode mid-drag must not leave the grain frozen. + useEffect(() => { + if (!cropMode) setCropDrag(false); + }, [cropMode]); + + const drawPreview = useCallback(() => { + const renderer = rendererRef.current; + const canvas = canvasRef.current; + if (!renderer || !canvas || !bitmap) return; + if (stage.w < 40 || stage.h < 40) return; + + const activeEdits = showOriginal ? { ...defaultEdits(), crop: edits.crop } : edits; + const frame = rotatedBounds(bitmap.width, bitmap.height, edits.crop.angle, edits.crop.quarter); + const content: Rect = cropMode + ? { x: 0, y: 0, w: 1, h: 1 } + : { x: edits.crop.x, y: edits.crop.y, w: edits.crop.w, h: edits.crop.h }; + const contentW = Math.max(1, frame.w * content.w); + const contentH = Math.max(1, frame.h * content.h); + + const availW = Math.max(60, stage.w - 48); + const availH = Math.max(60, stage.h - 48); + const fitScale = Math.min(availW / contentW, availH / contentH); + const fitPct = Math.min(100, fitScale * 100); + const zoomFactor = zoom.pct === 'fit' ? 1 : Math.max(1, zoom.pct / 100 / fitScale); + + let view: Rect = content; + let cssW = Math.max(40, Math.round(contentW * fitScale)); + let cssH = Math.max(40, Math.round(contentH * fitScale)); + + if (zoomFactor > 1.0001) { + // The visible window keeps the stage's aspect, so the canvas is stage sized + // and the shader maps it onto a sub-rect of the frame. Cost stays constant + // no matter how far you zoom, and detail comes from the source bitmap. + const vw = Math.min(1, availW / (fitScale * zoomFactor) / frame.w); + const vh = Math.min(1, availH / (fitScale * zoomFactor) / frame.h); + const cx = + vw >= content.w + ? content.x + content.w / 2 + : clampNum(zoom.cx, content.x + vw / 2, content.x + content.w - vw / 2); + const cy = + vh >= content.h + ? content.y + content.h / 2 + : clampNum(zoom.cy, content.y + vh / 2, content.y + content.h - vh / 2); + view = { x: cx - vw / 2, y: cy - vh / 2, w: vw, h: vh }; + cssW = Math.round(availW); + cssH = Math.round(availH); + } + + const dpr = Math.min(window.devicePixelRatio || 1, 2); + const cap = Math.min(1, 3200 / Math.max(1, Math.max(cssW * dpr, cssH * dpr))); + const pxW = Math.max(1, Math.round(cssW * dpr * cap)); + const pxH = Math.max(1, Math.round(cssH * dpr * cap)); + + canvas.style.width = `${cssW}px`; + canvas.style.height = `${cssH}px`; + + geoRef.current = { + fitScale, + fitPct, + frameW: frame.w, + frameH: frame.h, + zoomFactor, + availW, + availH, + content, + view, + }; + const shown = Math.round(fitScale * zoomFactor * 100); + const fit = Math.round(fitPct); + setReadout((prev) => (prev.shown === shown && prev.fit === fit ? prev : { shown, fit })); + setNavigatorView((prev) => + prev && prev.x === view.x && prev.y === view.y && prev.w === view.w && prev.h === view.h + ? prev + : view, + ); + + try { + renderer.setImage(bitmap); + // "Show original" must show the untouched source, not the cleaned proxy. + renderer.setDenoised(showOriginal ? null : denoisedBitmap, activeEdits.aiDenoise.amount / 100); + renderer.render(activeEdits, { + width: pxW, + height: pxH, + cropPreview: cropMode, + // The histogram describes the whole photo, so it is only refreshed at fit. + histogram: !cropMode && !showOriginal && zoomFactor <= 1.0001, + view: zoomFactor <= 1.0001 ? undefined : view, + // Holding the grain still keeps the noise from crawling while a crop + // handle moves; the new crop-relative scale applies on release. + freezeGrain: cropDrag, + // One source pixel per device pixel is the crossover: below it mipmaps + // resample cleanly, above it bicubic keeps magnified detail from squaring off. + upscale: dpr * cap * fitScale * zoomFactor > 1.1, + clipPreview, + clipping: clipping ?? undefined, + lens: showOriginal ? null : lensCorrection, + lensSplit: lensSplit && !showOriginal ? lensSplitAt : undefined, + }); + histRef.current = renderer.histogram; + setHistVersion((v) => v + 1); + } catch (err) { + setError(err instanceof Error ? err.message : 'Rendering failed'); + } + }, [ + bitmap, + denoisedBitmap, + edits, + cropMode, + showOriginal, + stage, + zoom, + cropDrag, + clipPreview, + clipping, + lensCorrection, + lensSplit, + lensSplitAt, + ]); + + useEffect(() => { + if (!bitmap) return; + const raf = requestAnimationFrame(drawPreview); + return () => cancelAnimationFrame(raf); + }, [bitmap, drawPreview]); + + /* ------------------------------------------------------------ zoom & pan */ + + const applyZoom = useCallback((rawPct: number | 'fit', point?: { x: number; y: number }) => { + const geo = geoRef.current; + if (!geo.fitScale) return; + const fitPct = geo.fitPct; + if (rawPct === 'fit' || rawPct <= fitPct * 1.015 || fitPct >= 99.5) { + setZoom({ pct: 'fit', cx: 0.5, cy: 0.5 }); + return; + } + const next = clampNum(rawPct, fitPct * 1.02, MAX_ZOOM); + const zNow = Math.max(1, geo.zoomFactor); + const zNext = Math.max(1, next / fitPct); + const centerX = geo.view.x + geo.view.w / 2; + const centerY = geo.view.y + geo.view.h / 2; + let cx = centerX; + let cy = centerY; + + if (point) { + // Keep the frame point under the cursor fixed while the scale changes. + const rect = canvasRef.current?.getBoundingClientRect(); + if (rect) { + const dx = point.x - (rect.left + rect.width / 2); + const dy = point.y - (rect.top + rect.height / 2); + const pointX = centerX + dx / (geo.fitScale * zNow) / geo.frameW; + const pointY = centerY + dy / (geo.fitScale * zNow) / geo.frameH; + cx = pointX - dx / (geo.fitScale * zNext) / geo.frameW; + cy = pointY - dy / (geo.fitScale * zNext) / geo.frameH; + } + } + + const vw = geo.availW / (geo.fitScale * zNext) / geo.frameW; + const vh = geo.availH / (geo.fitScale * zNext) / geo.frameH; + const c = geo.content; + cx = vw >= c.w ? c.x + c.w / 2 : clampNum(cx, c.x + vw / 2, c.x + c.w - vw / 2); + cy = vh >= c.h ? c.y + c.h / 2 : clampNum(cy, c.y + vh / 2, c.y + c.h - vh / 2); + setZoom({ pct: next, cx, cy }); + }, []); + + /** Click or drag in the navigator thumbnail to move the zoomed viewport. */ + const navigateZoom = useCallback( + (fx: number, fy: number) => { + const geo = geoRef.current; + if (!geo.fitScale) return; + // A click while fitted behaves like Lightroom: jump to actual pixels at + // the chosen point. Once zoomed, dragging keeps the current scale. + if (zoom.pct === 'fit' && geo.fitPct >= 99.5) return; + const pct = zoom.pct === 'fit' ? 100 : zoom.pct; + const z = Math.max(1, pct / geo.fitPct); + const c = geo.content; + const vw = Math.min(c.w, geo.availW / (geo.fitScale * z) / geo.frameW); + const vh = Math.min(c.h, geo.availH / (geo.fitScale * z) / geo.frameH); + const cx = + vw >= c.w + ? c.x + c.w / 2 + : clampNum(fx, c.x + vw / 2, c.x + c.w - vw / 2); + const cy = + vh >= c.h + ? c.y + c.h / 2 + : clampNum(fy, c.y + vh / 2, c.y + c.h - vh / 2); + setZoom({ pct, cx, cy }); + }, + [zoom.pct], + ); + + // Filmstrip: the wheel browses photos sideways, and the current one is kept + // in view as you move through the shoot. + useEffect(() => { + const el = stripRef.current; + if (!el) return; + const onWheel = (e: WheelEvent) => { + if (Math.abs(e.deltaY) <= Math.abs(e.deltaX)) return; + e.preventDefault(); + el.scrollLeft += e.deltaY; + }; + el.addEventListener('wheel', onWheel, { passive: false }); + return () => el.removeEventListener('wheel', onWheel); + }, []); + + useEffect(() => { + stripRef.current?.querySelector('.film.active')?.scrollIntoView({ block: 'nearest', inline: 'nearest' }); + }, [photo.id, filmMinRating, filmFlag, shownStripOpen]); + + useEffect(() => { + const el = stageRef.current; + if (!el) return; + const onWheel = (e: WheelEvent) => { + // The fullscreen adjustment panel scrolls independently of the photo. + if ((e.target as HTMLElement | null)?.closest('.loupe-adjust')) return; + if (cropMode) return; + // While painting a mask, the wheel sizes the brush instead of zooming. + if (localMode && activeLocal?.kind === 'brush') { + e.preventDefault(); + setLocalBrush((v) => clampNum(v * Math.exp(-e.deltaY * 0.0015), 8, 320)); + return; + } + // While healing, the wheel sizes the brush instead of zooming. + if (healMode) { + e.preventDefault(); + setBrushPx((v) => clampNum(v * Math.exp(-e.deltaY * 0.0015), 14, 240)); + return; + } + const geo = geoRef.current; + if (!geo.fitScale) return; + if (!e.ctrlKey && Math.abs(e.deltaX) > Math.abs(e.deltaY)) return; + e.preventDefault(); + const base = geo.fitPct * Math.max(1, geo.zoomFactor); + applyZoom(base * Math.exp(-e.deltaY * 0.0022), { x: e.clientX, y: e.clientY }); + }; + el.addEventListener('wheel', onWheel, { passive: false }); + return () => el.removeEventListener('wheel', onWheel); + }, [cropMode, applyZoom, healMode, localMode, activeLocal]); + + const beginPan = (e: React.PointerEvent) => { + if (picking || cropMode || healMode || localMode || !zoomed || e.button !== 0) return; + const geo = geoRef.current; + panRef.current = { + x: e.clientX, + y: e.clientY, + cx: geo.view.x + geo.view.w / 2, + cy: geo.view.y + geo.view.h / 2, + }; + e.currentTarget.setPointerCapture(e.pointerId); + setPanning(true); + }; + + const movePan = (e: React.PointerEvent) => { + const start = panRef.current; + if (!start) return; + const geo = geoRef.current; + const z = Math.max(1, geo.zoomFactor); + const dx = (e.clientX - start.x) / (geo.fitScale * z * geo.frameW); + const dy = (e.clientY - start.y) / (geo.fitScale * z * geo.frameH); + const c = geo.content; + const cx = + geo.view.w >= c.w + ? c.x + c.w / 2 + : clampNum(start.cx - dx, c.x + geo.view.w / 2, c.x + c.w - geo.view.w / 2); + const cy = + geo.view.h >= c.h + ? c.y + c.h / 2 + : clampNum(start.cy - dy, c.y + geo.view.h / 2, c.y + c.h - geo.view.h / 2); + setZoom((prev) => ({ pct: prev.pct, cx, cy })); + }; + + const endPan = (e: React.PointerEvent) => { + if (!panRef.current) return; + panRef.current = null; + setPanning(false); + if (e.currentTarget.hasPointerCapture(e.pointerId)) e.currentTarget.releasePointerCapture(e.pointerId); + }; + + // The eyedropper reads through the renderer so the sample follows the same + // crop, straighten and zoom mapping as the pixels on screen. + const pickWhiteBalance = (e: React.MouseEvent) => { + if (!picking || cropMode) return; + const canvas = canvasRef.current; + const renderer = rendererRef.current; + if (!canvas || !renderer) return; + const rect = canvas.getBoundingClientRect(); + if (!rect.width || !rect.height) return; + const geo = geoRef.current; + const sample = renderer.pickSource(edits, { + nx: clampNum((e.clientX - rect.left) / rect.width, 0, 1), + ny: clampNum((e.clientY - rect.top) / rect.height, 0, 1), + view: geo.zoomFactor > 1.0001 ? geo.view : undefined, + upscale: Math.min(window.devicePixelRatio || 1, 2) * geo.fitScale * geo.zoomFactor > 1.1, + }); + setPicking(false); + if (!sample) return; + const wb = solveWhiteBalance(sample); + if (wb) setEdits({ temp: wb.temp, tint: wb.tint }, 'White balance'); + }; + + /* --------------------------------------------------------------- healing */ + + /** Pointer position as normalized source-image uv, through crop and zoom. */ + const sourcePointFromEvent = useCallback( + (e: { clientX: number; clientY: number }): { x: number; y: number } | null => { + const canvas = canvasRef.current; + if (!canvas || !bitmap) return null; + const rect = canvas.getBoundingClientRect(); + if (!rect.width || !rect.height) return null; + const geo = geoRef.current; + const view = geo.zoomFactor > 1.0001 ? geo.view : edits.crop; + const nx = clampNum((e.clientX - rect.left) / rect.width, 0, 1); + const ny = clampNum((e.clientY - rect.top) / rect.height, 0, 1); + const frame = { x: view.x + nx * view.w, y: view.y + ny * view.h }; + const source = frameToSource( + frame, + bitmap.width, + bitmap.height, + edits.crop.angle, + edits.crop.quarter, + edits.crop.flipH, + edits.crop.flipV, + ); + // Masks and heal spots live in the warped source space the shader samples. + const warped = warpGeometryPoint(source, edits.geometry, bitmap.width, bitmap.height); + return correctLensPoint(lensCorrection, warped.x, warped.y); + }, + [bitmap, edits.crop, edits.geometry, lensCorrection], + ); + + /** Brush size on screen converted to a fraction of the source width. */ + const brushRadius = useCallback(() => { + const geo = geoRef.current; + if (!bitmap || !geo.fitScale) return 0.02; + return Math.max(0.0015, brushPx / 2 / (geo.fitScale * geo.zoomFactor * bitmap.width)); + }, [bitmap, brushPx]); + + const commitHeal = useCallback( + (spots: HealSpot[], label = 'Healing') => { + setEdits({ heal: spots.slice(-MAX_HEAL_SPOTS) }, label); + }, + [setEdits], + ); + + /** Places a new spot, borrowing a clean patch from the nearest free side. */ + const makeSpot = useCallback( + (src: { x: number; y: number }, r: number): HealSpot => { + if (!bitmap) return { x: src.x, y: src.y, r, feather: healFeather, sx: src.x, sy: src.y }; + const yRoom = (r * bitmap.width) / bitmap.height; + const gap = r * 2.2; + const fits = (p: { x: number; y: number }) => + p.x > r * 1.1 && + p.x < 1 - r * 1.1 && + p.y > yRoom * 1.1 && + p.y < 1 - yRoom * 1.1; + const options = [ + { x: src.x + gap, y: src.y }, + { x: src.x - gap, y: src.y }, + { x: src.x, y: src.y + gap }, + { x: src.x, y: src.y - gap }, + ]; + const source = options.find(fits) ?? { x: src.x, y: src.y - gap }; + return { + x: src.x, + y: src.y, + r, + feather: healFeather, + sx: clampNum(source.x, 0, 1), + sy: clampNum(source.y, 0, 1), + }; + }, + [bitmap, healFeather], + ); + + /** Distance from a point to a spot, measured in source-width units. */ + const distanceToSpot = useCallback( + (p: { x: number; y: number }, spot: HealSpot) => { + if (!bitmap) return Infinity; + const dy = (p.y - spot.y) * (bitmap.height / bitmap.width); + return Math.hypot(p.x - spot.x, dy); + }, + [bitmap], + ); + + const removeHealSpot = useCallback(() => { + const spots = edits.heal ?? []; + if (!spots.length) return; + const index = healSelected ?? spots.length - 1; + commitHeal(spots.filter((_, i) => i !== index)); + setHealSelected(null); + }, [commitHeal, edits.heal, healSelected]); + + const startHeal = (e: React.PointerEvent) => { + if (!bitmap || e.button !== 0) return; + const src = sourcePointFromEvent(e); + if (!src) return; + e.preventDefault(); + const spots = edits.heal ?? []; + let hit = -1; + for (let i = spots.length - 1; i >= 0; i--) { + if (distanceToSpot(src, spots[i]) <= spots[i].r * 1.15) { + hit = i; + break; + } + } + e.currentTarget.setPointerCapture(e.pointerId); + if (hit >= 0) { + healDrag.current = { index: hit, mode: e.altKey ? 'source' : 'target', spot: { ...spots[hit] } }; + setHealSelected(hit); + if (e.altKey) setHealFeather(spots[hit].feather); + return; + } + const spot = makeSpot(src, brushRadius()); + let next = [...spots, spot]; + let index = next.length - 1; + if (next.length > MAX_HEAL_SPOTS) { + next = next.slice(-MAX_HEAL_SPOTS); + index = MAX_HEAL_SPOTS - 1; + } + commitHeal(next, 'Heal spot'); + setHealSelected(index); + healDrag.current = { index, mode: 'target', spot }; + }; + + const moveHeal = (e: React.PointerEvent) => { + if (!healMode) return; + const src = sourcePointFromEvent(e); + if (!src) return; + setHealHover(src); + const drag = healDrag.current; + if (!drag) return; + const spots = photo.edits.heal ?? []; + const current = spots[drag.index]; + if (!current) return; + // Dragging the spot moves it with its sample; Alt-drag moves the sample. + const patch: HealSpot = + drag.mode === 'source' + ? { ...current, sx: src.x, sy: src.y } + : { + ...current, + x: clampNum(drag.spot.x + (src.x - drag.spot.x), 0, 1), + y: clampNum(drag.spot.y + (src.y - drag.spot.y), 0, 1), + sx: clampNum(drag.spot.sx + (src.x - drag.spot.x), 0, 1), + sy: clampNum(drag.spot.sy + (src.y - drag.spot.y), 0, 1), + }; + const next = [...spots]; + next[drag.index] = patch; + commitHeal(next); + }; + + const endHeal = (e: React.PointerEvent) => { + healDrag.current = null; + if (e.currentTarget.hasPointerCapture(e.pointerId)) { + e.currentTarget.releasePointerCapture(e.pointerId); + } + }; + + const toggleHeal = useCallback(() => { + setHealMode((v) => !v); + setCropMode(false); + setPicking(false); + setLocalMode(false); + setHealSelected(null); + }, []); + + /* ------------------------------------------------------- local adjustments */ + + const localRadius = useCallback(() => { + const geo = geoRef.current; + if (!bitmap || !geo.fitScale) return 0.03; + return Math.max(0.0015, localBrush / 2 / (geo.fitScale * geo.zoomFactor * bitmap.width)); + }, [bitmap, localBrush]); + + const commitLocal = useCallback( + (layers: LocalLayer[], label = 'Local adjustment') => { + setEdits({ local: layers.slice(0, MAX_LOCAL_LAYERS) }, label); + }, + [setEdits], + ); + + const patchLocal = useCallback( + (id: string, patch: Partial, label = 'Local adjustment') => { + commitLocal( + (photo.edits.local ?? []).map((layer) => (layer.id === id ? { ...layer, ...patch } : layer)), + label, + ); + }, + [commitLocal, photo.edits.local], + ); + + const addLocalLayer = useCallback( + (kind: LocalMaskKind) => { + const layers = edits.local ?? []; + if (layers.length >= MAX_LOCAL_LAYERS) return; + const layer = defaultLocalLayer(kind, layers.length); + commitLocal([...layers, layer], 'Add local adjustment'); + setLocalSelected(layer.id); + setLocalMode(true); + setCropMode(false); + setHealMode(false); + }, + [commitLocal, edits.local], + ); + + const addAutoMask = useCallback( + async (kind: AutoMaskKind) => { + const layers = edits.local ?? []; + if (layers.length >= MAX_LOCAL_LAYERS || autoMaskBusy) return; + setAutoMaskBusy(true); + try { + const source = bitmap ?? (await getBitmap(photo)); + const raster = await buildAutoMask(source, kind); + const layer = defaultLocalLayer('raster', layers.length); + layer.name = `Auto ${kind}`; + layer.raster = raster; + layer.feather = 30; + commitLocal([...layers, layer], `Auto ${kind} mask`); + setLocalSelected(layer.id); + setLocalMode(false); + setCropMode(false); + setHealMode(false); + } catch (err) { + setError(err instanceof Error ? err.message : 'Could not build the auto mask'); + } finally { + setAutoMaskBusy(false); + } + }, + [autoMaskBusy, bitmap, commitLocal, edits.local, photo], + ); + + const deleteLocalLayer = useCallback( + (id: string) => { + commitLocal((edits.local ?? []).filter((layer) => layer.id !== id), 'Delete local adjustment'); + setLocalSelected(null); + setLocalMode(false); + }, + [commitLocal, edits.local], + ); + + const duplicateLocalLayer = useCallback( + (id: string) => { + const layers = edits.local ?? []; + if (layers.length >= MAX_LOCAL_LAYERS) return; + const source = layers.find((layer) => layer.id === id); + if (!source) return; + const copy: LocalLayer = { + ...cloneLocalLayer(source), + id: `local-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 7)}`, + name: `${source.name} copy`, + }; + commitLocal([...layers, copy], 'Duplicate local adjustment'); + setLocalSelected(copy.id); + }, + [commitLocal, edits.local], + ); + + const copyLocalLayer = useCallback(() => { + if (activeLocal) onLocalClipboard(cloneLocalLayer(activeLocal)); + }, [activeLocal, onLocalClipboard]); + + const pasteLocalLayer = useCallback(() => { + if (!localClipboard) return; + const layers = edits.local ?? []; + if (layers.length >= MAX_LOCAL_LAYERS) return; + const copy: LocalLayer = { + ...cloneLocalLayer(localClipboard), + id: `local-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 7)}`, + name: `Local ${layers.length + 1}`, + }; + commitLocal([...layers, copy], 'Paste local adjustment'); + setLocalSelected(copy.id); + setLocalMode(true); + setCropMode(false); + setHealMode(false); + }, [commitLocal, edits.local, localClipboard]); + + const toggleLocalMode = useCallback(() => { + if (!activeLocal) return; + setLocalMode((v) => !v); + setCropMode(false); + setHealMode(false); + setPicking(false); + }, [activeLocal]); + + const startLocalMask = (e: React.PointerEvent) => { + if (!localMode || !activeLocal || !bitmap) return; + const p = sourcePointFromEvent(e); + if (!p) return; + e.preventDefault(); + e.currentTarget.setPointerCapture(e.pointerId); + if (activeLocal.kind === 'brush') { + const stroke: LocalStroke = { points: [p], size: localRadius(), erase: e.altKey }; + localDrag.current = { id: activeLocal.id, mode: 'brush', stroke }; + setLocalDraft(stroke); + return; + } + if (activeLocal.kind === 'radial') { + const aspect = bitmap.height / bitmap.width; + const nx = (p.x - activeLocal.radial.cx) / Math.max(0.001, activeLocal.radial.rx); + const ny = ((p.y - activeLocal.radial.cy) * aspect) / Math.max(0.001, activeLocal.radial.ry); + const mode = + Math.abs(nx) > 0.82 && Math.abs(ny) < 0.65 + ? 'edgeX' + : Math.abs(ny) > 0.82 && Math.abs(nx) < 0.65 + ? 'edgeY' + : Math.hypot(nx, ny) > 0.82 + ? 'edge' + : 'center'; + localDrag.current = { id: activeLocal.id, mode, stroke: null }; + return; + } + const ds = Math.hypot(p.x - activeLocal.linear.x1, (p.y - activeLocal.linear.y1) * (bitmap.height / bitmap.width)); + const de = Math.hypot(p.x - activeLocal.linear.x2, (p.y - activeLocal.linear.y2) * (bitmap.height / bitmap.width)); + localDrag.current = { id: activeLocal.id, mode: ds <= de ? 'start' : 'end', stroke: null }; + }; + + const moveLocalMask = (e: React.PointerEvent) => { + if (!localMode || !bitmap) return; + const p = sourcePointFromEvent(e); + if (!p) return; + setLocalHover(p); + const drag = localDrag.current; + if (!drag) return; + const layer = (photo.edits.local ?? []).find((item) => item.id === drag.id); + if (!layer) return; + if (drag.mode === 'brush' && drag.stroke) { + const last = drag.stroke.points[drag.stroke.points.length - 1]; + if (last && Math.hypot((p.x - last.x) * bitmap.width, (p.y - last.y) * bitmap.height) < 1.2) return; + const stroke = { ...drag.stroke, points: [...drag.stroke.points, p].slice(-4000) }; + drag.stroke = stroke; + setLocalDraft(stroke); + return; + } + if (drag.mode === 'center') { + patchLocal(layer.id, { radial: { ...layer.radial, cx: p.x, cy: p.y } }, 'Move local mask'); + } else if (drag.mode === 'edgeX') { + patchLocal( + layer.id, + { radial: { ...layer.radial, rx: clampNum(Math.abs(p.x - layer.radial.cx), 0.01, 1.5) } }, + 'Resize local mask', + ); + } else if (drag.mode === 'edgeY') { + patchLocal( + layer.id, + { radial: { ...layer.radial, ry: clampNum(Math.abs(p.y - layer.radial.cy), 0.01, 1.5) } }, + 'Resize local mask', + ); + } else if (drag.mode === 'edge') { + patchLocal( + layer.id, + { + radial: { + ...layer.radial, + rx: clampNum(Math.abs(p.x - layer.radial.cx), 0.01, 1.5), + ry: clampNum(Math.abs(p.y - layer.radial.cy), 0.01, 1.5), + }, + }, + 'Resize local mask', + ); + } else if (drag.mode === 'start') { + patchLocal(layer.id, { linear: { ...layer.linear, x1: p.x, y1: p.y } }, 'Move local gradient'); + } else if (drag.mode === 'end') { + patchLocal(layer.id, { linear: { ...layer.linear, x2: p.x, y2: p.y } }, 'Move local gradient'); + } + }; + + const endLocalMask = (e: React.PointerEvent) => { + const drag = localDrag.current; + if (drag?.mode === 'brush' && drag.stroke?.points.length) { + const layer = (photo.edits.local ?? []).find((item) => item.id === drag.id); + if (layer) { + patchLocal( + layer.id, + { brush: { strokes: [...layer.brush.strokes, drag.stroke].slice(-300) } }, + drag.stroke.erase ? 'Erase local mask' : 'Paint local mask', + ); + } + } + localDrag.current = null; + setLocalDraft(null); + if (e.currentTarget.hasPointerCapture(e.pointerId)) e.currentTarget.releasePointerCapture(e.pointerId); + }; + + // The feather slider edits the selected spot, and new spots inherit it. + const setFeather = (value: number) => { + setHealFeather(value); + const spots = edits.heal ?? []; + if (healSelected === null || !spots[healSelected]) return; + const next = [...spots]; + next[healSelected] = { ...next[healSelected], feather: value }; + commitHeal(next); + }; + + useEffect(() => { + if (cropMode) setHealMode(false); + }, [cropMode]); + + useEffect(() => { + if (!healMode) { + setHealHover(null); + healDrag.current = null; + } + }, [healMode]); + + useEffect(() => { + setLocalSelected(null); + setLocalMode(false); + setLocalDraft(null); + localDrag.current = null; + }, [photo.id]); + + useEffect(() => { + if (!(edits.local ?? []).some((layer) => layer.id === localSelected)) { + setLocalSelected(null); + setLocalMode(false); + } + }, [edits.local, localSelected]); + + // Escape cancels the picker without touching the edit. + useEffect(() => { + if (!picking) return; + const onKey = (e: KeyboardEvent) => { + if (e.key !== 'Escape') return; + e.preventDefault(); + e.stopPropagation(); + setPicking(false); + }; + window.addEventListener('keydown', onKey, true); + return () => window.removeEventListener('keydown', onKey, true); + }, [picking]); + + useEffect(() => { + if (cropMode) setPicking(false); + }, [cropMode]); + + // Full-screen loupe: the stage itself goes fullscreen, so the browser hides + // every panel and the canvas simply gets the whole screen. + useEffect(() => { + const onFs = () => { + const on = !!document.fullscreenElement; + setLoupe(on); + if (!on) setAdjustOpen(false); + }; + document.addEventListener('fullscreenchange', onFs); + return () => document.removeEventListener('fullscreenchange', onFs); + }, []); + + const toggleLoupe = useCallback(() => { + const el = stageRef.current; + if (document.fullscreenElement) { + setAdjustOpen(false); + void document.exitFullscreen().catch(() => undefined); + return; + } + setAdjustOpen(false); + if (el?.requestFullscreen) void el.requestFullscreen().catch(() => undefined); + }, []); + + const toggleZoom = (x?: number, y?: number) => { + if (cropMode) return; + if (zoomed) applyZoom('fit'); + else applyZoom(100, x !== undefined && y !== undefined ? { x, y } : undefined); + }; + + const historyPosition = photo.history.findIndex((entry) => entry.edits === photo.edits); + const canUndo = historyPosition > 0 || (historyPosition < 0 && photo.history.length > 1); + const canRedo = historyPosition >= 0 && historyPosition < photo.history.length - 1; + + const undo = useCallback(() => { + const hist = photo.history; + if (hist.length < 2) return; + const idx = hist.findIndex((h) => h.edits === photo.edits); + const target = idx > 0 ? hist[idx - 1] : hist[hist.length - 2]; + if (target) onUpdate(photo.id, { edits: target.edits }); + }, [photo.history, photo.edits, photo.id, onUpdate]); + + const redo = useCallback(() => { + const hist = photo.history; + const idx = hist.findIndex((h) => h.edits === photo.edits); + const target = idx >= 0 ? hist[idx + 1] : undefined; + if (target) onUpdate(photo.id, { edits: target.edits }); + }, [photo.history, photo.edits, photo.id, onUpdate]); + + useEffect(() => { + const down = (e: KeyboardEvent) => { + const target = e.target as HTMLElement | null; + if (target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable)) return; + if (e.key === '\\') { + setShowOriginal(true); + return; + } + // Ratings, labels and flags work here exactly as they do in the grid, so a + // shoot can be culled without leaving Develop. + if (/^[0-5]$/.test(e.key) && !e.metaKey && !e.ctrlKey && !e.altKey) { + onUpdate(photo.id, { rating: Number(e.key) }); + e.preventDefault(); + return; + } + if (/^[6-9]$/.test(e.key) && !e.metaKey && !e.ctrlKey && !e.altKey) { + const labels: ColorLabel[] = ['red', 'yellow', 'green', 'blue']; + onUpdate(photo.id, { color: labels[Number(e.key) - 6] }); + e.preventDefault(); + return; + } + if (e.key.toLowerCase() === 'j' && !e.metaKey && !e.ctrlKey && !e.altKey) { + e.preventDefault(); + setClipping((cur) => + e.shiftKey + ? cur === 'shadows' + ? null + : 'shadows' + : cur === 'highlights' + ? null + : 'highlights', + ); + return; + } + if (!e.metaKey && !e.ctrlKey && !e.altKey) { + const flagKey = e.key.toLowerCase(); + if (flagKey === 'p' || flagKey === 'x' || flagKey === 'u') { + onUpdate(photo.id, { flag: flagKey === 'p' ? 'pick' : flagKey === 'x' ? 'reject' : 'none' }); + e.preventDefault(); + return; + } + } + if (e.key === 'ArrowRight') { + navigateFilm(1); + e.preventDefault(); + } else if (e.key === 'ArrowLeft') { + navigateFilm(-1); + e.preventDefault(); + } else if (e.key.toLowerCase() === 'q' && !e.metaKey && !e.ctrlKey && !e.altKey) { + toggleHeal(); + e.preventDefault(); + } else if (e.key.toLowerCase() === 'c' && !e.metaKey && !e.ctrlKey) { + setCropMode((v) => !v); + } else if (e.key.toLowerCase() === 'z' && !e.metaKey && !e.ctrlKey) { + toggleZoom(); + e.preventDefault(); + } else if (e.key.toLowerCase() === 'f' && !e.metaKey && !e.ctrlKey) { + toggleLoupe(); + e.preventDefault(); + } else if (e.key.toLowerCase() === 'm' && !e.metaKey && !e.ctrlKey && !e.altKey) { + if (activeLocal) { + toggleLocalMode(); + e.preventDefault(); + } + } else if (e.key === 'Enter' && cropMode) { + setCropMode(false); + } else if (e.key === 'Escape') { + // In fullscreen the browser handles Escape; don't also leave Develop. + if (document.fullscreenElement) return; + if (localMode) setLocalMode(false); + else if (healMode) setHealMode(false); + else if (cropMode) setCropMode(false); + else onExit(); + } else if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.key.toLowerCase() === 'z') { + redo(); + e.preventDefault(); + } else if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'z') { + undo(); + e.preventDefault(); + } else if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'c') { + onCopy(); + } else if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'v') { + onPaste(); + } + }; + const up = (e: KeyboardEvent) => { + if (e.key === '\\') setShowOriginal(false); + }; + window.addEventListener('keydown', down); + window.addEventListener('keyup', up); + return () => { + window.removeEventListener('keydown', down); + window.removeEventListener('keyup', up); + }; + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [ + cropMode, + localMode, + activeLocal, + toggleLocalMode, + healMode, + onExit, + navigateFilm, + onCopy, + onPaste, + undo, + redo, + applyZoom, + zoomed, + onUpdate, + photo.id, + toggleLoupe, + toggleHeal, + ]); + + const applyPreset = useCallback( + (preset: Preset) => { + const next: Edits = + preset.id === 'original' + ? { ...defaultEdits(), crop: photo.edits.crop } + : { ...photo.edits, ...preset.edits, crop: photo.edits.crop }; + onUpdate(photo.id, { edits: next }, `Preset: ${preset.name}`); + }, + [onUpdate, photo.id, photo.edits], + ); + + const frame = bitmap + ? rotatedBounds(bitmap.width, bitmap.height, edits.crop.angle, edits.crop.quarter) + : { w: 1, h: 1 }; + const lockedRatio = useMemo(() => { + const def = ASPECTS.find((a) => a.id === edits.crop.aspect); + return def?.ratio ?? null; + }, [edits.crop.aspect]); + + // The same panel stack is used by the regular right rail and the fullscreen + // loupe overlay. Metadata stays in the rail so the overlay is purely tonal. + const adjustmentPanels = (includeMetadata: boolean) => ( + <> + {cropMode && ( + + setEdits({ crop: { ...edits.crop, flipH: !edits.crop.flipH } }, 'Flip horizontal') + } + mirrored={edits.crop.flipH} + /> + )} + + + + + setLocalSelected(id)} + onAdd={addLocalLayer} + onDelete={deleteLocalLayer} + onDuplicate={duplicateLocalLayer} + onEditMask={toggleLocalMode} + maskMode={localMode} + brushSize={localBrush} + onBrushSize={setLocalBrush} + onCopyLayer={copyLocalLayer} + onPasteLayer={pasteLocalLayer} + canPaste={Boolean(localClipboard)} + onAutoMask={(kind) => void addAutoMask(kind)} + autoBusy={autoMaskBusy} + /> + + + + + {includeMetadata && ( + onUpdate(photo.id, patch)} + presets={metadataPresets} + keywordLibrary={keywordLibrary} + onSavePreset={onSaveMetadataPreset} + onDeletePreset={onDeleteMetadataPreset} + /> + )} + + ); + + const applyAspect = useCallback( + (id: string) => { + const def = ASPECTS.find((a) => a.id === id); + if (!def) return; + const f = bitmap + ? rotatedBounds(bitmap.width, bitmap.height, photo.edits.crop.angle, photo.edits.crop.quarter) + : { w: 1, h: 1 }; + let w = 1; + let h = 1; + if (def.ratio) { + const frameRatio = f.w / f.h; + if (def.ratio > frameRatio) { + w = 1; + h = frameRatio / def.ratio; + } else { + h = 1; + w = def.ratio / frameRatio; + } + } + setEdits( + { crop: { ...photo.edits.crop, x: (1 - w) / 2, y: (1 - h) / 2, w, h, aspect: id } }, + def.ratio ? `Crop ${def.label}` : 'Crop', + ); + }, + [bitmap, photo.edits.crop, setEdits], + ); + + const rotate = useCallback( + (dir: -1 | 1) => { + const c = photo.edits.crop; + const quarter = ((c.quarter + dir) % 4 + 4) % 4; + const rect = + dir === 1 + ? { x: 1 - (c.y + c.h), y: c.x, w: c.h, h: c.w } + : { x: c.y, y: 1 - (c.x + c.w), w: c.h, h: c.w }; + setEdits( + { crop: { ...c, quarter, ...rect } }, + dir === 1 ? 'Rotate 90° right' : 'Rotate 90° left', + ); + }, + [photo.edits.crop, setEdits], + ); + + const resetAll = () => { + if (!window.confirm('Reset all develop settings for this photo?')) return; + onUpdate(photo.id, { edits: { ...defaultEdits(), crop: photo.edits.crop } }, 'Reset'); + }; + + const canvasMenu: MenuEntry[] = [ + { label: 'Zoom to Fit', shortcut: 'Z', onSelect: () => applyZoom('fit') }, + { label: 'Zoom to 100%', onSelect: () => applyZoom(100) }, + 'separator', + { label: 'Crop & Straighten', shortcut: 'C', onSelect: () => setCropMode((v) => !v) }, + { label: 'Before / After', shortcut: '\\', onSelect: () => setShowOriginal((v) => !v) }, + 'separator', + { label: 'Copy settings', shortcut: '⌘C', onSelect: onCopy }, + { label: 'Paste settings', shortcut: '⌘V', onSelect: onPaste, disabled: !clipboard }, + { label: 'Reset settings', onSelect: resetAll }, + 'separator', + { label: 'Export…', onSelect: onExport }, + { label: 'Delete photo…', danger: true, onSelect: onDelete }, + ]; + + const filmMenu: MenuEntry[] = [ + { label: 'Copy settings', onSelect: onCopy }, + { label: 'Paste settings', onSelect: onPaste, disabled: !clipboard }, + { label: 'Reset settings', onSelect: resetAll }, + 'separator', + { label: 'Export…', onSelect: onExport }, + { label: 'Delete photo…', danger: true, onSelect: onDelete }, + ]; + + const index = photos.findIndex((p) => p.id === photo.id); + + return ( +
    +
    + +
    + {photo.name} + + {index >= 0 ? `${index + 1} / ${photos.length}` : ''} · {photo.width}×{photo.height} + +
    + onUpdate(photo.id, { rating: r })} size="md" /> + onUpdate(photo.id, { flag: f })} /> + onUpdate(photo.id, { color: c })} /> +
    + + + + + + + + + + + + +
    + + {!mobile && !tipDismissed && ( +
    + + Hover a panel seam to collapse it · ⌘K searches everything · ? shows shortcuts + + +
    + )} + + {mobile && ( + <> +
    + + +
    + {photo.name} + + {filmPosition >= 0 ? filmPosition + 1 : '–'} / {filmPhotos.length} + +
    + + + +
    +
    + onUpdate(photo.id, { rating })} size="md" /> + onUpdate(photo.id, { flag })} /> + + {photo.meta.camera ?? 'Camera'} {photo.meta.focal ? `· ${photo.meta.focal}mm` : ''} + +
    + + )} + +
    + + + +
    { + e.preventDefault(); + setMenu({ x: e.clientX, y: e.clientY, kind: 'canvas' }); + }} + > + {error ? ( +
    {error}
    + ) : ( +
    + { + if (localMode) startLocalMask(e); + else if (healMode) startHeal(e); + else beginPan(e); + }} + onPointerMove={(e) => { + if (localMode) moveLocalMask(e); + else if (healMode) moveHeal(e); + else movePan(e); + }} + onPointerUp={(e) => { + if (localMode) endLocalMask(e); + else if (healMode) endHeal(e); + else endPan(e); + }} + onPointerCancel={(e) => { + if (localMode) endLocalMask(e); + else if (healMode) endHeal(e); + else endPan(e); + }} + onPointerLeave={() => { + setHealHover(null); + setLocalHover(null); + }} + onDoubleClick={(e) => { + if (healMode || localMode) return; + toggleZoom(e.clientX, e.clientY); + }} + /> + {lensSplit && lensCorrection && !showOriginal && ( +
    +
    + Before + After + +
    + )} + {healMode && bitmap && (() => { + const geo = geoRef.current; + const view = geo.view; + const marker = (p: { x: number; y: number }) => { + const f = sourceToFrame( + unwarpGeometryPoint( + uncorrectLensPoint(lensCorrection, p.x, p.y), + edits.geometry, + bitmap.width, + bitmap.height, + ), + bitmap.width, + bitmap.height, + edits.crop.angle, + edits.crop.quarter, + edits.crop.flipH, + edits.crop.flipV, + ); + return { + x: ((f.x - view.x) / view.w) * 100, + y: ((f.y - view.y) / view.h) * 100, + }; + }; + const rx = (r: number) => ((r * bitmap.width) / (frame.w * view.w)) * 100; + const ry = (r: number) => ((r * bitmap.width) / (frame.h * view.h)) * 100; + const spots = edits.heal ?? []; + const hoverR = brushRadius(); + return ( + + {spots.map((spot, i) => { + const t = marker(spot); + const s = marker({ x: spot.sx, y: spot.sy }); + const on = i === healSelected; + // Matches the shader: feather acts on the outer half at most. + const inner = Math.max(0, 1 - (spot.feather / 100) * 0.5); + return ( + + {on && } + {on && ( + + )} + + {inner > 0.02 && ( + + )} + + ); + })} + {healHover && !healDrag.current && ( + + )} + + ); + })()} + {localMode && bitmap && activeLocal && (() => { + const geo = geoRef.current; + const view = geo.view; + const marker = (p: { x: number; y: number }) => { + const source = unwarpGeometryPoint( + uncorrectLensPoint(lensCorrection, p.x, p.y), + edits.geometry, + bitmap.width, + bitmap.height, + ); + const f = sourceToFrame( + source, + bitmap.width, + bitmap.height, + edits.crop.angle, + edits.crop.quarter, + edits.crop.flipH, + edits.crop.flipV, + ); + return { + x: ((f.x - view.x) / view.w) * 100, + y: ((f.y - view.y) / view.h) * 100, + }; + }; + const xScale = bitmap.width / (frame.w * view.w); + const canvasEl = canvasRef.current; + const canvasW = canvasEl?.clientWidth || 1; + const canvasH = canvasEl?.clientHeight || 1; + const strokes = localDraft + ? [...activeLocal.brush.strokes, localDraft] + : activeLocal.brush.strokes; + return ( + + {activeLocal.kind === 'brush' && + strokes.map((stroke, i) => { + if (!stroke.points.length) return null; + const points = stroke.points.map(marker).map((p) => `${p.x},${p.y}`).join(' '); + const width = Math.max(1, stroke.size * 2 * canvasW); + return ( + + ); + })} + {activeLocal.kind === 'radial' && (() => { + const c = marker({ x: activeLocal.radial.cx, y: activeLocal.radial.cy }); + const edge = marker({ + x: activeLocal.radial.cx + activeLocal.radial.rx, + y: activeLocal.radial.cy, + }); + const edgeY = marker({ + x: activeLocal.radial.cx, + y: activeLocal.radial.cy + activeLocal.radial.ry, + }); + // Sample the perimeter so the guide follows the same warp + // as the picture instead of staying a screen-space ellipse. + const ring = Array.from({ length: 72 }, (_, i) => { + const angle = (i / 72) * Math.PI * 2; + const p = marker({ + x: activeLocal.radial.cx + Math.cos(angle) * activeLocal.radial.rx, + y: activeLocal.radial.cy + Math.sin(angle) * activeLocal.radial.ry, + }); + return `${p.x},${p.y}`; + }).join(' '); + return ( + + + + + + + ); + })()} + {activeLocal.kind === 'linear' && (() => { + const a = marker({ x: activeLocal.linear.x1, y: activeLocal.linear.y1 }); + const b = marker({ x: activeLocal.linear.x2, y: activeLocal.linear.y2 }); + return ( + + + + + + ); + })()} + {activeLocal.kind === 'brush' && localHover && !localDrag.current && ( + + )} + + ); + })()} + {cropMode && bitmap && ( + setEdits({ crop: { ...photo.edits.crop, ...rect } }, 'Crop')} + onDragChange={setCropDrag} + /> + )} +
    + )} + {localMode && activeLocal && !error && ( +
    + Local · {activeLocal.kind} + {activeLocal.kind === 'brush' && ( + <> + + {Math.round(localBrush)}px + + )} + {activeLocal.kind !== 'linear' && ( + <> + + {Math.round(activeLocal.feather)}% + + )} + + + + {activeLocal.kind === 'brush' + ? 'Paint the mask · Alt paints an erase stroke · wheel sizes the brush' + : activeLocal.kind === 'radial' + ? 'Drag the centre or the edge handle · wheel zooms' + : 'Drag either end of the gradient'} + +
    + )} + {healMode && !error && ( +
    + Healing + + {brushPx}px + + {healFeather}% + + {(edits.heal ?? []).length} spot{(edits.heal ?? []).length === 1 ? '' : 's'} + + + + + Click a blemish · Alt-drag moves the sample · wheel sizes the brush +
    + )} + {loading &&
    Loading original…
    } + {cropMode &&
    Drag the edges to crop · Enter to apply · Esc to cancel
    } + {!cropMode && !error && ( +
    + + + {readout.shown}% + +
    + )} + {zoomed && !cropMode &&
    Drag to pan · scroll to zoom · double-click to fit
    } + {showOriginal &&
    Before
    } + {loupe && !cropMode && ( +
    + +
    + {filmPosition >= 0 ? filmPosition + 1 : '–'} + / {filmPhotos.length} + {filmFilterActive && filtered} +
    +
    + onUpdate(photo.id, { rating })} + size="md" + /> + onUpdate(photo.id, { flag })} + /> +
    + +
    + )} + {clipPreview && ( +
    + red + green + blue + two channels + all three +
    + )} + {loupe && !adjustOpen && ( + + )} + {loupe && adjustOpen && ( + + )} +
    + + + +
    + +
    + + +
    + + +
    + Rating + {[0, 1, 2, 3, 4, 5].map((n) => ( + + ))} +
    + +
    + Flag + {(['any', 'pick', 'none', 'reject'] as const).map((value) => ( + + ))} +
    + + {filmFilterActive && ( + + )} + + {filmFilterActive && !currentInFilm && ( + <> + Current photo is hidden by this filter + + + )} + +
    + + {filmPhotos.length} / {photos.length} + +
    + + {shownStripOpen && ( +
    + {filmPhotos.map((p) => ( + + ))} + {!filmPhotos.length && ( +
    No photos match this filter.
    + )} +
    + )} +
    + + {menu && ( + setMenu(null)} + header={ + menu.kind === 'film' ? ( +
    + onUpdate(photo.id, { rating: r })} size="md" /> + onUpdate(photo.id, { flag: f })} /> + onUpdate(photo.id, { color: c })} /> +
    + ) : undefined + } + entries={menu.kind === 'canvas' ? canvasMenu : filmMenu} + /> + )} +
    + ); +} diff --git a/src/components/EventSidebar.tsx b/src/components/EventSidebar.tsx new file mode 100644 index 0000000..c64083a --- /dev/null +++ b/src/components/EventSidebar.tsx @@ -0,0 +1,263 @@ +import { useState } from 'react'; +import { + draggedEventId, + draggedPhotoIds, + endDrag, + EVENT_DRAG, + PHOTO_DRAG, + startEventDrag, + startPhotoDrag, +} from '../lib/drag'; +import type { EventRecord, PhotoRecord, SmartCollection } from '../types'; + +interface Props { + collapsed?: boolean; + mobileOpen?: boolean; + events: EventRecord[]; + photos: PhotoRecord[]; + eventId: string; + onSelectEvent: (id: string) => void; + onCreate: (name: string) => Promise | void; + onRename: (id: string, name: string) => void; + onDelete: (id: string) => void; + onReorderEvents: (dragId: string, targetId: string) => void; + onDropPhotos: (ids: string[], eventId: string) => void; + trashOpen: boolean; + trashCount: number; + onOpenTrash: () => void; + storageNote: string; + collections: SmartCollection[]; + activeCollectionId: string | null; + onSelectCollection: (id: string) => void; + onDeleteCollection: (id: string) => void; +} + +export default function EventSidebar({ + collapsed = false, + mobileOpen = false, + events, + photos, + eventId, + onSelectEvent, + onCreate, + onRename, + onDelete, + onReorderEvents, + onDropPhotos, + trashOpen, + trashCount, + onOpenTrash, + storageNote, + collections, + activeCollectionId, + onSelectCollection, + onDeleteCollection, +}: Props) { + const [adding, setAdding] = useState(false); + const [name, setName] = useState(''); + const [dropTarget, setDropTarget] = useState(null); + + const counts = new Map(); + let unsorted = 0; + for (const p of photos) { + if (!p.eventId) { + unsorted++; + continue; + } + counts.set(p.eventId, (counts.get(p.eventId) ?? 0) + 1); + } + + const submit = async () => { + if (!name.trim()) { + setAdding(false); + return; + } + await onCreate(name); + setName(''); + setAdding(false); + }; + + const dropProps = (targetId: string) => ({ + onDragOver: (e: React.DragEvent) => { + if (draggedPhotoIds().length) { + e.preventDefault(); + e.stopPropagation(); + e.dataTransfer.dropEffect = 'move'; + setDropTarget(targetId); + } + }, + onDragLeave: () => setDropTarget((cur) => (cur === targetId ? null : cur)), + onDrop: (e: React.DragEvent) => { + const ids = draggedPhotoIds(); + setDropTarget(null); + if (!ids.length) return; + e.preventDefault(); + e.stopPropagation(); + onDropPhotos(ids, targetId); + endDrag(); + }, + }); + + return ( + + ); +} diff --git a/src/components/ExportModal.tsx b/src/components/ExportModal.tsx new file mode 100644 index 0000000..457b197 --- /dev/null +++ b/src/components/ExportModal.tsx @@ -0,0 +1,569 @@ +import { useEffect, useMemo, useRef, useState } from 'react'; +import type { ExportOptions, ExportFormat, ExportRecipe, ResizeMode, WatermarkPosition } from '../lib/export'; +import { buildFileName, DEFAULT_EXPORT, exportPhotos } from '../lib/export'; +import Slider from './Slider'; +import { getBitmap } from '../lib/images'; +import { frameToSource, grainCellPx, grainSampleWindow, outputSize, rotatedBounds, Renderer } from '../gl/renderer'; +import type { PhotoRecord } from '../types'; + +interface Props { + photos: PhotoRecord[]; + initial: ExportOptions; + recipes: ExportRecipe[]; + onSaveRecipe: (name: string, options: ExportOptions) => void; + onDeleteRecipe: (id: string) => void; + onClose: () => void; + onDone: (message: string, options: ExportOptions) => void; +} + +const FORMATS: { value: ExportFormat; label: string }[] = [ + { value: 'jpeg', label: 'JPEG' }, + { value: 'png', label: 'PNG (8-bit)' }, + { value: 'webp', label: 'WebP' }, + { value: 'tiff16', label: 'TIFF (16-bit)' }, +]; + +/** + * Three 1:1 patches of the export at half, current and double the chosen size. + * Each patch is rendered on the export's own pixel grid, so it shows exactly the + * grain and detail that file will carry at 100%. + */ +function ExportDetailStrip({ photo, size }: { photo: PhotoRecord; size: { w: number; h: number } | null }) { + const tiles = useRef<(HTMLCanvasElement | null)[]>([]); + const pick = useRef(null); + const work = useRef(null); + const renderer = useRef(null); + const bitmap = useRef(null); + const [ready, setReady] = useState(false); + const [point, setPoint] = useState<{ x: number; y: number } | null>(null); + const { crop } = photo.edits; + const srcW = Math.max(1, photo.width); + const srcH = Math.max(1, photo.height); + + useEffect(() => { + let alive = true; + getBitmap(photo) + .then((bmp) => { + if (!alive) return; + bitmap.current = bmp; + setReady(true); + }) + .catch(() => undefined); + return () => { + alive = false; + }; + }, [photo.id]); + + useEffect( + () => () => { + renderer.current?.dispose(); + renderer.current = null; + }, + [], + ); + + const steps = useMemo(() => { + if (!size) return []; + const long = Math.max(size.w, size.h); + return [Math.max(200, Math.round(long / 2)), long, Math.min(20000, long * 2)]; + }, [size]); + + useEffect(() => { + const bmp = bitmap.current; + if (!ready || !bmp || !size || !steps.length) return; + if (!work.current) work.current = document.createElement('canvas'); + const workCanvas = work.current; + try { + if (!renderer.current) renderer.current = new Renderer(workCanvas); + const r = renderer.current; + r.setImage(bmp); + const frame = rotatedBounds(bmp.width, bmp.height, crop.angle, crop.quarter); + const cropPxW = Math.max(1, frame.w * crop.w); + const cropPxH = Math.max(1, frame.h * crop.h); + const PW = 132; + const PH = Math.round(Math.min(92, Math.max(56, PW * (cropPxH / cropPxW)))); + const outLong = Math.max(1, Math.max(size.w, size.h)); + steps.forEach((longEdge, i) => { + const tile = tiles.current[i]; + if (!tile) return; + if (tile.width !== PW) tile.width = PW; + if (tile.height !== PH) tile.height = PH; + const scale = longEdge / outLong; + const pxPerSource = (size.w * scale) / cropPxW; + const view = grainSampleWindow( + frame, + crop, + Math.max(1, Math.round(PW / pxPerSource)), + Math.max(1, Math.round(PH / pxPerSource)), + point, + ); + r.render(photo.edits, { width: PW, height: PH, view, upscale: pxPerSource > 1.05 }); + const ctx = tile.getContext('2d'); + if (ctx) ctx.drawImage(workCanvas, 0, 0); + }); + + // The picker shows the whole exported crop, oriented like the main view. + const pickCanvas = pick.current; + if (pickCanvas) { + const pickW = 132; + const pickH = Math.round(Math.min(112, Math.max(56, pickW * (cropPxH / cropPxW)))); + r.render(photo.edits, { width: pickW, height: pickH, upscale: pickW / cropPxW > 1.05 }); + const ctx = pickCanvas.getContext('2d'); + if (ctx) { + if (pickCanvas.width !== pickW) pickCanvas.width = pickW; + if (pickCanvas.height !== pickH) pickCanvas.height = pickH; + ctx.imageSmoothingQuality = 'high'; + ctx.clearRect(0, 0, pickW, pickH); + ctx.drawImage(workCanvas, 0, 0, pickW, pickH); + } + } + } catch { + // Keep the previous patches if the engine is unavailable. + } + }, [ready, photo, crop, size, steps, point]); + + // Where the patch is, in photo terms, and how big a grain cell is in the file. + const info = useMemo(() => { + // The point lives in frame coordinates; the picker shows only the crop. + const p = point ?? { x: crop.x + crop.w / 2, y: crop.y + crop.h / 2 }; + const at = frameToSource(p, srcW, srcH, crop.angle, crop.quarter, crop.flipH, crop.flipV); + return { + sx: at.x, + sy: at.y, + px: Math.round(at.x * 100), + py: Math.round(at.y * 100), + ux: (p.x - crop.x) / crop.w, + uy: (p.y - crop.y) / crop.h, + cell: size ? grainCellPx(photo.edits, srcW, srcH, size.w) : 0, + }; + }, [point, crop, srcW, srcH, size, photo.edits]); + + if (!size || !steps.length) return null; + return ( + <> +
    +
    { + const r = pick.current?.getBoundingClientRect(); + if (!r || !r.width || !r.height) return; + const u = Math.min(1, Math.max(0, (e.clientX - r.left) / r.width)); + const v = Math.min(1, Math.max(0, (e.clientY - r.top) / r.height)); + setPoint({ x: crop.x + u * crop.w, y: crop.y + v * crop.h }); + }} + > + + +
    + Click the photo to move the 100% patches +
    +
    + {steps.map((longEdge, i) => ( +
    + { tiles.current[i] = el; }} /> +
    + {longEdge === steps[1] ? 'This export' : longEdge < steps[1] ? 'Half size' : 'Double size'} · {longEdge} px · 100% +
    +
    + ))} +
    +

    + Sample {info.px}% × {info.py}% of the photo ·{' '} + {photo.edits.grain.amount > 1 + ? `grain ${info.cell < 1 ? info.cell.toFixed(2) : info.cell.toFixed(1)} px cells${ + info.cell < 0.9 ? ' (fades: finer than a pixel)' : '' + } at this size` + : 'grain off'} +

    + + ); +} + +export default function ExportModal({ photos, initial, recipes, onSaveRecipe, onDeleteRecipe, onClose, onDone }: Props) { + const [opts, setOpts] = useState({ ...DEFAULT_EXPORT, ...initial }); + const [recipeId, setRecipeId] = useState(''); + const [busy, setBusy] = useState(false); + const [progress, setProgress] = useState({ done: 0, total: 0 }); + const [stage, setStage] = useState<'render' | 'pack'>('render'); + const [error, setError] = useState(null); + + useEffect(() => { + // Capture phase so Escape closes the dialog even with the photo open behind it. + const onKey = (e: KeyboardEvent) => { + if (e.key !== 'Escape') return; + e.preventDefault(); + e.stopImmediatePropagation(); + if (!busy) onClose(); + }; + window.addEventListener('keydown', onKey, true); + return () => window.removeEventListener('keydown', onKey, true); + }, [busy, onClose]); + + const patch = (p: Partial) => setOpts((prev) => ({ ...prev, ...p })); + const patchWatermark = (p: Partial) => + setOpts((prev) => ({ ...prev, watermark: { ...prev.watermark, ...p } })); + + const sample = photos[0]; + const previewSize = useMemo(() => { + if (!sample) return null; + // Use the renderer's exact crop/rotation calculation, not a rectangle-only + // estimate: straightening expands the frame and changes both dimensions. + const base = outputSize(sample.edits, sample.width || 1, sample.height || 1); + let k = 1; + if (opts.resize === 'longEdge' && opts.longEdge > 0 && Math.max(base.w, base.h) > opts.longEdge) { + k = opts.longEdge / Math.max(base.w, base.h); + } else if (opts.resize === 'percent') { + k = Math.min(2, Math.max(0.05, opts.percent / 100)); + } + return { w: Math.max(1, Math.round(base.w * k)), h: Math.max(1, Math.round(base.h * k)) }; + }, [sample, opts.resize, opts.longEdge, opts.percent]); + + const sampleName = sample + ? buildFileName(opts.nameTemplate, sample, 0, opts) + : `export.${opts.format === 'jpeg' ? 'jpg' : opts.format === 'tiff16' ? 'tif' : opts.format}`; + + const run = async () => { + if (!photos.length || busy) return; + setBusy(true); + setError(null); + setStage('render'); + try { + const { count, failed } = await exportPhotos( + photos, + opts, + (done, total) => setProgress({ done, total }), + setStage, + ); + if (!count) { + setError(failed.length ? 'Nothing could be exported. Check the browser console.' : 'Nothing to export'); + setBusy(false); + return; + } + onDone(`Exported ${count} photo${count === 1 ? '' : 's'}`, opts); + onClose(); + } catch (err) { + setError(err instanceof Error ? err.message : 'Export failed'); + setBusy(false); + } + }; + + return ( +
    e.target === e.currentTarget && !busy && onClose()}> +
    +
    +

    Export

    + +
    + +
    +
    + + {photos.length} photo{photos.length === 1 ? '' : 's'} + + {previewSize && ( + + {previewSize.w} × {previewSize.h} px + + )} +
    + +
    + + + + + {opts.resize === 'longEdge' && ( + + )} + + {opts.resize === 'percent' && ( + + )} + + {photos.length > 1 && ( + + )} +
    + + {(opts.format === 'jpeg' || opts.format === 'webp') && ( + + )} + + {sample && } + + +

    + Tokens: {'{name}'} {'{date}'} {'{time}'}{' '} + {'{index}'} · first file: {sampleName} +

    + +
    + + + {recipeId && ( + + )} +
    + +
    + Output +
    + patch({ outputSharpen: v })} + format={(v) => `${Math.round(v)}`} + def={0} + /> + + + +
    + Watermark + +
    + {opts.format === 'tiff16' && ( +

    + 16-bit TIFF is a delivery master; watermarking and JPEG metadata are not applied. +

    + )} + {opts.watermark.enabled && ( + <> + +
    + + + +
    + + )} + + {busy && progress.total > 0 && ( +
    +
    +
    +
    +
    + {stage === 'pack' + ? `Packing ${progress.total} photos into a ZIP…` + : `${progress.done} / ${progress.total}`} +
    +
    + )} + + {error &&
    {error}
    } +
    + +
    + + +
    +
    +
    + ); +} diff --git a/src/components/FilterBar.tsx b/src/components/FilterBar.tsx new file mode 100644 index 0000000..116a9dc --- /dev/null +++ b/src/components/FilterBar.tsx @@ -0,0 +1,270 @@ +import { COLOR_LABELS, isEdited } from '../lib/edits'; +import { usePersistentState } from '../lib/usePersistentState'; +import type { ColorLabel, Filters, Flag, PhotoRecord, SortKey } from '../types'; + +interface Props { + filters: Filters; + setFilters: (next: Filters) => void; + count: number; + total: number; + /** Photos in the current scope before the filter controls are applied. */ + scopePhotos: PhotoRecord[]; + reviewCounts: { approved: number; changes: number }; + sort: SortKey; + setSort: (s: SortKey) => void; + asc: boolean; + setAsc: (v: boolean) => void; + /** photos in this scope that a client has picked */ + proofCount: number; + onSaveCollection: () => void; +} + +const FLAGS: { value: Flag | 'any'; label: string }[] = [ + { value: 'any', label: 'Any' }, + { value: 'pick', label: 'Picked' }, + { value: 'none', label: 'Unflagged' }, + { value: 'reject', label: 'Rejected' }, +]; + +const EMPTY_FILTERS: Filters = { + minRating: 0, + flag: 'any', + colors: [], + text: '', + editedOnly: false, + unrated: false, + proofed: false, + clientStatus: 'any', +}; + +export default function FilterBar({ + filters, + setFilters, + count, + total, + scopePhotos, + reviewCounts, + sort, + setSort, + asc, + setAsc, + proofCount, + onSaveCollection, +}: Props) { + const [collapsed, setCollapsed] = usePersistentState('library.filters.collapsed', false); + const patch = (p: Partial) => setFilters({ ...filters, ...p }); + const countWhere = (test: (photo: PhotoRecord) => boolean) => + scopePhotos.reduce((sum, photo) => sum + (test(photo) ? 1 : 0), 0); + const ratingCounts = [0, 1, 2, 3, 4, 5].map((n) => + n === 0 ? scopePhotos.length : countWhere((photo) => photo.rating >= n), + ); + const unratedCount = countWhere((photo) => photo.rating === 0); + const flagCounts = FLAGS.map((flag) => + flag.value === 'any' + ? scopePhotos.length + : countWhere((photo) => photo.flag === flag.value), + ); + const colorCounts = COLOR_LABELS.map((color) => + countWhere((photo) => photo.color === color.value), + ); + const editedCount = countWhere((photo) => isEdited(photo.edits)); + const active = + filters.minRating > 0 || + filters.flag !== 'any' || + filters.colors.length > 0 || + !!filters.text || + filters.editedOnly || + filters.unrated || + filters.proofed || + filters.clientStatus !== 'any'; + + const toggleColor = (color: ColorLabel) => { + const exists = filters.colors.includes(color); + patch({ colors: exists ? filters.colors.filter((c) => c !== color) : [...filters.colors, color] }); + }; + + const summary = [ + filters.minRating > 0 ? `${filters.minRating}★+` : '', + filters.unrated ? 'Unrated' : '', + filters.flag !== 'any' ? FLAGS.find((f) => f.value === filters.flag)?.label ?? '' : '', + filters.colors.length ? `${filters.colors.length} label${filters.colors.length === 1 ? '' : 's'}` : '', + filters.text ? `“${filters.text}”` : '', + filters.editedOnly ? 'Edited' : '', + filters.proofed ? 'Client picks' : '', + filters.clientStatus === 'approved' ? 'Approved' : filters.clientStatus === 'changes' ? 'Changes' : '', + ] + .filter(Boolean) + .join(' · '); + + return ( +
    + + + {collapsed ? ( + <> + + {active ? summary : 'No filters applied'} + + {active && ( + + )} + + ) : ( + <> +
    + Rating +
    + {[0, 1, 2, 3, 4, 5].map((n) => ( + + ))} + +
    +
    + +
    + Flag +
    + {FLAGS.map((f, index) => ( + + ))} +
    +
    + +
    + Label +
    + {COLOR_LABELS.map((c, index) => ( +
    +
    + +
    + patch({ text: e.target.value })} + /> +
    + + + + {proofCount > 0 && ( + + )} + +
    + Review +
    + + +
    +
    + +
    + Sort + + +
    + + + + {active && ( + + )} + + )} + +
    + {count} + {count !== total ? ` / ${total}` : ''} shown +
    +
    + ); +} diff --git a/src/components/Histogram.tsx b/src/components/Histogram.tsx new file mode 100644 index 0000000..153fcd0 --- /dev/null +++ b/src/components/Histogram.tsx @@ -0,0 +1,89 @@ +import { useEffect, useRef } from 'react'; +import type { Histogram as HistogramData } from '../gl/renderer'; + +export default function Histogram({ + data, + version, + clipping, + onClipping, +}: { + data: HistogramData | null; + version: number; + clipping?: 'highlights' | 'shadows' | null; + onClipping?: (next: 'highlights' | 'shadows' | null) => void; +}) { + const ref = useRef(null); + + useEffect(() => { + const canvas = ref.current; + if (!canvas) return; + const dpr = Math.min(window.devicePixelRatio || 1, 2); + const rect = canvas.getBoundingClientRect(); + const w = Math.max(1, Math.round(rect.width * dpr)); + const h = Math.max(1, Math.round(rect.height * dpr)); + if (canvas.width !== w) canvas.width = w; + if (canvas.height !== h) canvas.height = h; + const ctx = canvas.getContext('2d'); + if (!ctx) return; + ctx.clearRect(0, 0, w, h); + ctx.fillStyle = '#121214'; + ctx.fillRect(0, 0, w, h); + + // grid + ctx.strokeStyle = 'rgba(255,255,255,0.06)'; + ctx.lineWidth = 1; + for (let i = 1; i < 4; i++) { + const x = (i / 4) * w; + ctx.beginPath(); + ctx.moveTo(x, 0); + ctx.lineTo(x, h); + ctx.stroke(); + } + if (!data) return; + + let peak = 0; + for (let i = 1; i < 255; i++) { + peak = Math.max(peak, data.r[i], data.g[i], data.b[i]); + } + if (peak <= 0) return; + + const scale = (v: number) => Math.pow(v / peak, 0.42); + const drawChannel = (bins: Uint32Array, color: string) => { + ctx.beginPath(); + ctx.moveTo(0, h); + for (let i = 0; i < 256; i++) { + const x = (i / 255) * w; + const y = h - scale(bins[i]) * (h - 2); + ctx.lineTo(x, y); + } + ctx.lineTo(w, h); + ctx.closePath(); + ctx.fillStyle = color; + ctx.fill(); + }; + + ctx.globalCompositeOperation = 'lighter'; + drawChannel(data.r, 'rgba(220,64,64,0.55)'); + drawChannel(data.g, 'rgba(64,200,96,0.55)'); + drawChannel(data.b, 'rgba(72,120,240,0.55)'); + ctx.globalCompositeOperation = 'source-over'; + }, [data, version]); + + return ( +
    + +
    + ); +} diff --git a/src/components/ImportModal.tsx b/src/components/ImportModal.tsx new file mode 100644 index 0000000..e74c36c --- /dev/null +++ b/src/components/ImportModal.tsx @@ -0,0 +1,307 @@ +import { useEffect, useMemo, useRef, useState } from 'react'; +import type { CloudImport, ImportProgress } from '../lib/import'; +import { importFiles, isSupportedFile } from '../lib/import'; +import { isRawFile, RAW_ACCEPT } from '../lib/raw'; +import type { EventRecord, PhotoRecord } from '../types'; + +interface Props { + events: EventRecord[]; + initialEventId: string; + initialFiles: File[]; + /** Records already in the catalog, used to skip accidental re-imports. */ + existing: PhotoRecord[]; + onClose: () => void; + onImported: (photos: PhotoRecord[], eventId: string) => void; + onCreateEvent: (name: string) => Promise; + cloud?: CloudImport | null; + onNeedServer: () => void; +} + +export default function ImportModal({ + events, + initialEventId, + initialFiles, + existing, + onClose, + onImported, + onCreateEvent, + cloud, + onNeedServer, +}: Props) { + const startId = initialEventId !== 'all' && initialEventId !== 'unsorted' ? initialEventId : events[0]?.id ?? '__new'; + const [eventId, setEventId] = useState(startId); + const [newName, setNewName] = useState(''); + const [files, setFiles] = useState(initialFiles); + const [dragOver, setDragOver] = useState(false); + const [busy, setBusy] = useState(false); + const [progress, setProgress] = useState(null); + const [failures, setFailures] = useState([]); + const [allowDuplicates, setAllowDuplicates] = useState(false); + const [summary, setSummary] = useState<{ + imported: number; + failed: number; + skipped: number; + cancelled: boolean; + } | null>(null); + const inputRef = useRef(null); + const abortRef = useRef(null); + const rawCount = files.filter(isRawFile).length; + const existingKeys = useMemo( + () => new Set(existing.map((photo) => `${photo.name.toLowerCase()}:${photo.size}`)), + [existing], + ); + const duplicateFiles = useMemo( + () => files.filter((file) => existingKeys.has(`${file.name.toLowerCase()}:${file.size}`)), + [existingKeys, files], + ); + const readyFiles = allowDuplicates ? files : files.filter((file) => !duplicateFiles.includes(file)); + + useEffect(() => { + // Capture phase: Escape closes this dialog even while a photo is open behind it. + const onKey = (e: KeyboardEvent) => { + if (e.key !== 'Escape') return; + e.preventDefault(); + e.stopImmediatePropagation(); + if (!busy) onClose(); + }; + window.addEventListener('keydown', onKey, true); + return () => window.removeEventListener('keydown', onKey, true); + }, [busy, onClose]); + + const addFiles = (list: FileList | null) => { + if (!list) return; + setSummary(null); + const incoming = Array.from(list).filter(isSupportedFile); + setFiles((prev) => { + const seen = new Set(prev.map((f) => `${f.name}:${f.size}`)); + return [...prev, ...incoming.filter((f) => !seen.has(`${f.name}:${f.size}`))]; + }); + }; + + const run = async () => { + if (!readyFiles.length || busy) return; + setBusy(true); + setFailures([]); + setSummary(null); + const controller = new AbortController(); + abortRef.current = controller; + try { + let targetId = eventId; + if (targetId === '__new') { + const created = await onCreateEvent(newName || `Event ${new Date().toLocaleDateString()}`); + targetId = created.id; + } + const result = await importFiles(readyFiles, targetId, [], setProgress, cloud ?? null, controller.signal); + if (result.photos.length) onImported(result.photos, targetId); + const skipped = allowDuplicates ? 0 : duplicateFiles.length; + setSummary({ + imported: result.photos.length, + failed: result.failed.length, + skipped, + cancelled: Boolean(result.cancelled), + }); + if (result.failed.length) setFailures(result.failed.map((f) => `${f.name} — ${f.reason}`)); + } catch (err) { + setFailures([err instanceof Error ? err.message : 'Import failed']); + } finally { + setBusy(false); + setProgress(null); + abortRef.current = null; + } + }; + + const cancel = () => { + abortRef.current?.abort(); + setProgress((current) => + current ? { ...current, current: 'Cancelling after the files already in progress…' } : current, + ); + }; + + return ( +
    e.target === e.currentTarget && !busy && onClose()}> +
    +
    +

    Import photos

    + +
    + +
    + + + {eventId === '__new' && ( + + )} + +
    { + e.preventDefault(); + setDragOver(true); + }} + onDragLeave={() => setDragOver(false)} + onDrop={(e) => { + e.preventDefault(); + setDragOver(false); + addFiles(e.dataTransfer.files); + }} + onClick={() => inputRef.current?.click()} + > +
    ⤒
    +
    + Drop photos here +

    + 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. +

    +
    + addFiles(e.target.files)} + /> +
    + + {files.length > 0 && ( +
    + + {readyFiles.length} file{readyFiles.length === 1 ? '' : 's'} ready ·{' '} + {(readyFiles.reduce((sum, f) => sum + f.size, 0) / (1024 * 1024)).toFixed(1)} MB + {rawCount > 0 ? ` · ${rawCount} raw` : ''} + + +
    + )} + + {duplicateFiles.length > 0 && !summary && ( +
    +
    + + {duplicateFiles.length} file{duplicateFiles.length === 1 ? ' is' : 's are'} already in the catalog. + {' '} + {allowDuplicates + ? 'They will be imported again as new copies.' + : 'They will be skipped unless you choose to include them.'} +
    + +
    + )} + + {rawCount > 0 && !cloud && ( +
    + + {rawCount} raw file{rawCount === 1 ? '' : 's'} cannot be read by the browser. + {' '} + They are decoded by the team server, so sign in before importing — or import them later + from the library. + +
    + )} + + {rawCount > 0 && cloud && ( +
    + Raw files are demosaiced by the server (LibRaw), a few at a time in parallel. Each file + usually takes 2–4 seconds. +
    + )} + + {progress && ( +
    +
    +
    +
    +
    + {progress.done} / {progress.total} {progress.current ? `· ${progress.current}` : ''} +
    +
    + )} + + {summary && ( +
    + + {summary.cancelled ? 'Import cancelled' : 'Import complete'} + + + {summary.imported} imported + {summary.skipped ? ` · ${summary.skipped} duplicate${summary.skipped === 1 ? '' : 's'} skipped` : ''} + {summary.failed ? ` · ${summary.failed} failed` : ''} + +

    + {summary.cancelled + ? 'Files already in progress were allowed to finish. The imported photos are in the catalog.' + : 'New photos are selected in the library and ready to review.'} +

    +
    + )} + + {failures.length > 0 && ( +
    + Some files could not be imported +
      + {failures.map((f) => ( +
    • {f}
    • + ))} +
    +
    + )} +
    + +
    + {summary ? ( + + ) : ( + <> + + + + )} +
    +
    +
    + ); +} diff --git a/src/components/JoinPage.tsx b/src/components/JoinPage.tsx new file mode 100644 index 0000000..e17b112 --- /dev/null +++ b/src/components/JoinPage.tsx @@ -0,0 +1,193 @@ +import { useEffect, useState } from 'react'; +import { ApiError, loadInvite, register } from '../lib/api'; +import type { InviteInfo } from '../lib/api'; + +interface Props { + token: string; +} + +const fmtDate = (ms: number | null) => + ms ? new Date(ms).toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' }) : ''; + +const STATUS_COPY: Record = { + accepted: { + title: 'This invite has already been used', + body: 'Each invite link works once. Sign in if the account is yours, or ask an admin for a fresh link.', + }, + expired: { + title: 'This invite has expired', + body: 'Invite links are time-limited. Ask an admin to send you a new one.', + }, + revoked: { + title: 'This invite was turned off', + body: 'An admin revoked this link. Ask them for a new invite if you still need access.', + }, +}; + +/** Public signup screen reached from an admin's single-use invite link. */ +export default function JoinPage({ token }: Props) { + const [invite, setInvite] = useState(null); + const [missing, setMissing] = useState(false); + const [loadError, setLoadError] = useState(null); + const [email, setEmail] = useState(''); + const [name, setName] = useState(''); + const [password, setPassword] = useState(''); + const [busy, setBusy] = useState(false); + const [error, setError] = useState(null); + + useEffect(() => { + let alive = true; + loadInvite(token) + .then((next) => { + if (!alive) return; + setInvite(next); + setEmail(next.email); + }) + .catch((err) => { + if (!alive) return; + if (err instanceof ApiError && err.status === 404) setMissing(true); + else setLoadError(err instanceof Error ? err.message : 'Could not check this invite'); + }); + return () => { + alive = false; + }; + }, [token]); + + const submit = async (e: React.FormEvent) => { + e.preventDefault(); + if (!invite || invite.status !== 'pending' || busy) return; + if (password.length < 8) { + setError('Use at least 8 characters for the password'); + return; + } + setBusy(true); + setError(null); + try { + await register({ + email: email.trim(), + password, + name: name.trim(), + inviteToken: token, + }); + window.location.assign('/'); + } catch (err) { + setError(err instanceof Error ? err.message : 'Could not create the account'); + setBusy(false); + } + }; + + const state = missing ? 'missing' : invite?.status; + const lockedEmail = Boolean(invite?.email); + const copy = + state === 'missing' + ? { + title: 'This invite link is not valid', + body: 'Check the link you were sent, or ask an admin for a new invite.', + } + : state && STATUS_COPY[state] + ? STATUS_COPY[state] + : null; + + return ( +
    +
    + +LUMINARY +
    + +
    + {!invite && !missing && !loadError &&

    Checking your invite…

    } + + {loadError && ( + <> + Invite +

    Can’t reach the server

    +

    {loadError}

    + + Go to Luminary + + + )} + + {copy && ( + <> + Invite +

    {copy.title}

    +

    {copy.body}

    + + Go to sign in + + + )} + + {invite?.status === 'pending' && ( + <> + You’re invited +

    Join the studio

    +

    + {lockedEmail + ? `Create your account for ${invite.email}. This link works once.` + : 'Create your account to start editing, proofing and sharing photos. This link works once.'} +

    + +
    + + + + + + + {error &&
    {error}
    } + + +
    + +

    + You’ll join as a {invite.role === 'admin' ? 'administrator' : 'member'} + {invite.expiresAt ? ` · link expires ${fmtDate(invite.expiresAt)}` : ''} +

    +

    + Already have an account? Sign in +

    + + )} +
    +
    + ); +} diff --git a/src/components/LensDefaultsModal.tsx b/src/components/LensDefaultsModal.tsx new file mode 100644 index 0000000..ee55484 --- /dev/null +++ b/src/components/LensDefaultsModal.tsx @@ -0,0 +1,152 @@ +import { useEffect, useState } from 'react'; +import { + loadCameraLensDefaults, + removeCameraLensDefault, + type CameraLensDefault, +} from '../lib/lensDefaults'; + +interface Props { + onClose: () => void; + /** Called after a saved row is removed so an open Optics panel can refresh. */ + onChanged?: () => void; +} + +const correctionLabel = (entry: CameraLensDefault) => { + const corrections = entry.profile.corrections; + const enabled = [ + corrections.distortion ? 'distortion' : '', + corrections.tca ? 'chromatic aberration' : '', + corrections.vignetting ? 'vignetting' : '', + ].filter(Boolean); + return enabled.length ? enabled.join(' · ') : 'no corrections enabled'; +}; + +export default function LensDefaultsModal({ onClose, onChanged }: Props) { + const [defaults, setDefaults] = useState(null); + const [busy, setBusy] = useState(null); + const [error, setError] = useState(null); + + useEffect(() => { + let alive = true; + loadCameraLensDefaults() + .then((saved) => alive && setDefaults(saved)) + .catch((err) => { + if (!alive) return; + setDefaults([]); + setError(err instanceof Error ? err.message : 'Could not load saved defaults'); + }); + return () => { + alive = false; + }; + }, []); + + useEffect(() => { + const onKey = (e: KeyboardEvent) => { + if (e.key !== 'Escape') return; + e.preventDefault(); + e.stopImmediatePropagation(); + if (!busy) onClose(); + }; + window.addEventListener('keydown', onKey, true); + return () => window.removeEventListener('keydown', onKey, true); + }, [busy, onClose]); + + const remove = async (entry: CameraLensDefault) => { + const key = `${entry.camera}\u0000${entry.exifLens}`; + if (busy) return; + setBusy(key); + setError(null); + try { + await removeCameraLensDefault({ camera: entry.camera, lens: entry.exifLens }); + setDefaults((current) => + current?.filter( + (saved) => saved.camera !== entry.camera || saved.exifLens !== entry.exifLens, + ) ?? [], + ); + onChanged?.(); + } catch (err) { + setError(err instanceof Error ? err.message : 'Could not remove that default'); + } finally { + setBusy(null); + } + }; + + return ( +
    e.target === e.currentTarget && onClose()}> +
    +
    +
    + Settings +

    Camera lens defaults

    +
    + +
    + +
    +

    + These profiles apply automatically on this browser when a new import has the same camera + and EXIF lens. Removing one only affects future imports. +

    + + {defaults === null ? ( +

    Loading saved defaults…

    + ) : defaults.length === 0 ? ( +
    + No camera-lens defaults saved +

    + Open the Optics panel in Develop, choose a lens profile, then use “Set as camera + default”. +

    +
    + ) : ( +
    + {defaults.map((entry) => { + const key = `${entry.camera}\u0000${entry.exifLens}`; + return ( +
    +
    +
    + + {entry.profile.maker} {entry.profile.model} + + crop {entry.profile.crop}× +
    +

    + {entry.camera} + {entry.exifLens} +

    +

    + {correctionLabel(entry)} · saved{' '} + {new Date(entry.updatedAt).toLocaleDateString(undefined, { + year: 'numeric', + month: 'short', + day: 'numeric', + })} +

    +
    + +
    + ); + })} +
    + )} + + {error &&

    {error}

    } +
    + +
    + +
    +
    +
    + ); +} diff --git a/src/components/LibraryGrid.tsx b/src/components/LibraryGrid.tsx new file mode 100644 index 0000000..03ce2b8 --- /dev/null +++ b/src/components/LibraryGrid.tsx @@ -0,0 +1,520 @@ +import { useEffect, useRef, useState } from 'react'; +import { COLOR_LABELS, isEdited, thumbTransform } from '../lib/edits'; +import { draggedPhotoIds, endDrag, PHOTO_DRAG, startPhotoDrag } from '../lib/drag'; +import type { ColorLabel, Flag, PhotoRecord } from '../types'; +import Stars, { ColorSwatches, FlagButtons } from './Stars'; + +interface Props { + photos: PhotoRecord[]; + totalCount: number; + selected: string[]; + onSelect: (id: string, e: React.MouseEvent) => void; + onContextMenu: (e: React.MouseEvent, id: string) => void; + onOpen: (id: string) => void; + onRate: (id: string, rating: number) => void; + onBulkRate: (rating: number) => void; + onBulkFlag: (flag: Flag) => void; + onBulkColor: (color: ColorLabel) => void; + onDelete: () => void; + onExport: () => void; + onCompare: () => void; + onStack: () => void; + onVirtualCopy: () => void; + onMerge: () => void; + onPrint: () => void; + stacks: Map; + onToggleStack: (id: string) => void; + onImport: () => void; + onDropFiles: (files: File[]) => void; + onClearSelection: () => void; + onReorder: (ids: string[], targetId: string | null) => void; + /** rubber-band selection: the complete new selection */ + onMarqueeSelect: (ids: string[]) => void; + /** client proofing picks per photo, shown as a badge */ + proofCounts: Map; + proofStatus: Map; +} + +function fmtSize(bytes: number) { + if (bytes > 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`; + return `${Math.max(1, Math.round(bytes / 1024))} KB`; +} + +export default function LibraryGrid({ + photos, + totalCount, + selected, + onSelect, + onContextMenu, + onOpen, + onRate, + onBulkRate, + onBulkFlag, + onBulkColor, + onDelete, + onExport, + onCompare, + onStack, + onVirtualCopy, + onMerge, + onPrint, + stacks, + onToggleStack, + onImport, + onDropFiles, + onClearSelection, + onReorder, + onMarqueeSelect, + proofCounts, + proofStatus, +}: Props) { + const gridRef = useRef(null); + const band = useRef<{ sx: number; sy: number; base: string[]; moved: boolean; box: DOMRect } | null>(null); + const [bandRect, setBandRect] = useState<{ x: number; y: number; w: number; h: number } | null>(null); + const virtualize = photos.length > 140; + const [viewWindow, setViewWindow] = useState({ + start: 0, + end: Math.min(photos.length, 140), + top: 0, + bottom: 0, + }); + const selectedSet = new Set(selected); + + useEffect(() => { + if (!virtualize) { + setViewWindow({ start: 0, end: photos.length, top: 0, bottom: 0 }); + return; + } + const grid = gridRef.current; + if (!grid) return; + let frame = 0; + const measure = () => { + const card = grid.querySelector('.card'); + if (!card) { + if (viewWindow.start >= photos.length) { + setViewWindow({ start: 0, end: Math.min(photos.length, 140), top: 0, bottom: 0 }); + } + return; + } + const box = card.getBoundingClientRect(); + const style = getComputedStyle(grid); + const gapX = Number.parseFloat(style.columnGap) || 12; + const gapY = Number.parseFloat(style.rowGap) || 12; + const horizontalPadding = + (Number.parseFloat(style.paddingLeft) || 0) + (Number.parseFloat(style.paddingRight) || 0); + const columns = Math.max( + 1, + Math.round((grid.clientWidth - horizontalPadding + gapX) / (box.width + gapX)), + ); + const rowStep = box.height + gapY; + const firstRow = Math.max(0, Math.floor(grid.scrollTop / rowStep) - 2); + const lastRow = Math.ceil((grid.scrollTop + grid.clientHeight) / rowStep) + 2; + const start = Math.min(photos.length, firstRow * columns); + const end = Math.min(photos.length, Math.max(start + columns, lastRow * columns)); + const totalRows = Math.ceil(photos.length / columns); + const top = firstRow * rowStep; + const bottom = Math.max(0, totalRows - lastRow) * rowStep; + setViewWindow((current) => + current.start === start && + current.end === end && + current.top === top && + current.bottom === bottom + ? current + : { start, end, top, bottom }, + ); + }; + const schedule = () => { + cancelAnimationFrame(frame); + frame = requestAnimationFrame(measure); + }; + const observer = new ResizeObserver(schedule); + observer.observe(grid); + grid.addEventListener('scroll', schedule, { passive: true }); + schedule(); + return () => { + cancelAnimationFrame(frame); + observer.disconnect(); + grid.removeEventListener('scroll', schedule); + }; + }, [photos.length, virtualize, viewWindow.start]); + + const someSelected = selected.length > 0; + const sharedRating = (() => { + if (!someSelected) return 0; + const rated = photos.filter((p) => selectedSet.has(p.id)); + if (!rated.length) return 0; + const first = rated[0].rating; + return rated.every((p) => p.rating === first) ? first : 0; + })(); + + if (!photos.length) { + return ( +
    e.preventDefault()} + onDrop={(e) => { + e.preventDefault(); + const ids = draggedPhotoIds(); + if (ids.length) { onReorder(ids, null); + endDrag(); + return; + } + onDropFiles(Array.from(e.dataTransfer.files)); + }} + ref={gridRef} + onPointerDown={(e) => { + const grid = gridRef.current; + // A band starts on empty grid space; cards keep their own click/drag. + if (!grid || e.button !== 0 || e.target !== grid) return; + e.preventDefault(); + const box = grid.getBoundingClientRect(); + band.current = { + sx: e.clientX, + sy: e.clientY, + base: e.shiftKey || e.metaKey || e.ctrlKey ? [...selected] : [], + moved: false, + box, + }; + setBandRect({ x: e.clientX - box.left + grid.scrollLeft, y: e.clientY - box.top + grid.scrollTop, w: 0, h: 0 }); + grid.setPointerCapture(e.pointerId); + }} + onPointerMove={(e) => { + const grid = gridRef.current; + const start = band.current; + if (!grid || !start) return; + const left = Math.min(start.sx, e.clientX); + const top = Math.min(start.sy, e.clientY); + const right = Math.max(start.sx, e.clientX); + const bottom = Math.max(start.sy, e.clientY); + if (Math.abs(e.clientX - start.sx) > 3 || Math.abs(e.clientY - start.sy) > 3) start.moved = true; + setBandRect({ + x: left - start.box.left + grid.scrollLeft, + y: top - start.box.top + grid.scrollTop, + w: right - left, + h: bottom - top, + }); + if (!start.moved) return; + const hits: string[] = []; + for (const el of grid.querySelectorAll('.card')) { + const r = el.getBoundingClientRect(); + if (r.right > left && r.left < right && r.bottom > top && r.top < bottom) { + const id = el.dataset.id; + if (id) hits.push(id); + } + } + onMarqueeSelect([...start.base, ...hits.filter((id) => !start.base.includes(id))]); + }} + onPointerUp={(e) => { + const grid = gridRef.current; + const start = band.current; + band.current = null; + setBandRect(null); + if (!grid || !start) return; + if (grid.hasPointerCapture(e.pointerId)) grid.releasePointerCapture(e.pointerId); + if (!start.moved && !start.base.length) onClearSelection(); + }} + onPointerCancel={() => { + band.current = null; + setBandRect(null); + }} + > +
    + {totalCount > 0 ? ( + <> +

    No photos match these filters

    +

    Loosen the rating, flag or label filters to see more of this event.

    + + ) : ( + <> +

    Your library is empty

    +

    + Create an event and import a shoot. Photos are stored locally, or on your team server + when one is connected. +

    +
      +
    1. Import a shoot into an event.
    2. +
    3. Rate and flag the keepers.
    4. +
    5. Double-click a photo to open Develop.
    6. +
    7. Press ? anytime for shortcuts.
    8. +
    + +

    + Drop JPEG, PNG, TIFF or camera raw files anywhere in this area. +

    + + )} +
    +
    + ); + } + + return ( +
    +
    + {someSelected ? ( + <> + {selected.length} selected + + + +
    + + + + + + + + + + ) : ( + <> + + Click to select · drag on empty space to marquee · double-click to edit · 1–5 to rate ·{' '} + ? for shortcuts + +
    + {photos.length} photos + + )}
    + +
    { + if (draggedPhotoIds().length) { + e.preventDefault(); + e.dataTransfer.dropEffect = 'move'; + } + }} + onDrop={(e) => { + e.preventDefault(); + const ids = draggedPhotoIds(); + if (ids.length) { onReorder(ids, null); + endDrag(); + return; + } + onDropFiles(Array.from(e.dataTransfer.files)); + }} + ref={gridRef} + onPointerDown={(e) => { + const grid = gridRef.current; + // A band starts on empty grid space; cards keep their own click/drag. + if (!grid || e.button !== 0 || e.target !== grid) return; + e.preventDefault(); + const box = grid.getBoundingClientRect(); + band.current = { + sx: e.clientX, + sy: e.clientY, + base: e.shiftKey || e.metaKey || e.ctrlKey ? [...selected] : [], + moved: false, + box, + }; + setBandRect({ x: e.clientX - box.left + grid.scrollLeft, y: e.clientY - box.top + grid.scrollTop, w: 0, h: 0 }); + grid.setPointerCapture(e.pointerId); + }} + onPointerMove={(e) => { + const grid = gridRef.current; + const start = band.current; + if (!grid || !start) return; + const left = Math.min(start.sx, e.clientX); + const top = Math.min(start.sy, e.clientY); + const right = Math.max(start.sx, e.clientX); + const bottom = Math.max(start.sy, e.clientY); + if (Math.abs(e.clientX - start.sx) > 3 || Math.abs(e.clientY - start.sy) > 3) start.moved = true; + setBandRect({ + x: left - start.box.left + grid.scrollLeft, + y: top - start.box.top + grid.scrollTop, + w: right - left, + h: bottom - top, + }); + if (!start.moved) return; + const hits: string[] = []; + for (const el of grid.querySelectorAll('.card')) { + const r = el.getBoundingClientRect(); + if (r.right > left && r.left < right && r.bottom > top && r.top < bottom) { + const id = el.dataset.id; + if (id) hits.push(id); + } + } + onMarqueeSelect([...start.base, ...hits.filter((id) => !start.base.includes(id))]); + }} + onPointerUp={(e) => { + const grid = gridRef.current; + const start = band.current; + band.current = null; + setBandRect(null); + if (!grid || !start) return; + if (grid.hasPointerCapture(e.pointerId)) grid.releasePointerCapture(e.pointerId); + if (!start.moved && !start.base.length) onClearSelection(); + }} + onPointerCancel={() => { + band.current = null; + setBandRect(null); + }} + > + {bandRect && ( +
    + )} + {virtualize && viewWindow.top > 0 && ( + + ); +} diff --git a/src/components/MergeModal.tsx b/src/components/MergeModal.tsx new file mode 100644 index 0000000..a794a59 --- /dev/null +++ b/src/components/MergeModal.tsx @@ -0,0 +1,130 @@ +import { useState } from 'react'; +import type { PhotoRecord } from '../types'; +import { mergePhotos, type MergeKind, type MergeResult } from '../lib/merge'; + +interface Props { + photos: PhotoRecord[]; + onClose: () => void; + onDone: (result: MergeResult) => void; +} + +const OPTIONS: { kind: MergeKind; title: string; hint: string }[] = [ + { + kind: 'hdr', + title: 'HDR merge', + hint: 'Blend bracketed exposures with alignment and mid-tone weighting.', + }, + { + kind: 'panorama', + title: 'Panorama', + hint: 'Stitch a horizontal sequence; overlap is detected automatically.', + }, + { + kind: 'focus', + title: 'Focus stack', + hint: 'Choose the sharpest source at every pixel for extended depth of field.', + }, +]; + +export default function MergeModal({ photos, onClose, onDone }: Props) { + const [kind, setKind] = useState('hdr'); + const [busy, setBusy] = useState(false); + const [progress, setProgress] = useState(0); + const [error, setError] = useState(null); + const [result, setResult] = useState(null); + + const run = async () => { + setBusy(true); + setError(null); + setResult(null); + try { + const merged = await mergePhotos(photos, kind, (done, total) => setProgress(Math.round((done / total) * 100))); + setResult(merged); + } catch (err) { + setError(err instanceof Error ? err.message : 'The merge failed'); + } finally { + setBusy(false); + } + }; + + return ( +
    e.target === e.currentTarget && !busy && onClose()}> +
    +
    +
    +

    Merge photos

    +

    + {photos.length} source{photos.length === 1 ? '' : 's'} selected. The result becomes a new photo; + the originals stay untouched. +

    +
    + +
    +
    +
    + {OPTIONS.map((option) => ( + + ))} +
    + +
    + {photos.map((photo) => ( +
    + {photo.name} +
    {photo.name}
    +
    + ))} +
    + + {error &&
    {error}
    } + {busy && ( +
    +
    +
    +
    +
    Analysing and merging · {progress}%
    +
    + )} + {result && ( +
    + Merged result +
    + Merge ready +

    + {result.width} × {result.height} px. Add it to the catalog and continue editing it like any other photo. +

    +
    +
    + )} +
    +
    + + {result ? ( + + ) : ( + + )} +
    +
    +
    + ); +} diff --git a/src/components/Panels.tsx b/src/components/Panels.tsx new file mode 100644 index 0000000..9225edd --- /dev/null +++ b/src/components/Panels.tsx @@ -0,0 +1,1966 @@ +import { useEffect, useMemo, useRef, useState } from 'react'; +import { ASPECTS, BW_FILTERS, HUE_BANDS, identityCurve } from '../lib/edits'; +import { computeAutoEdits } from '../lib/auto'; +import { autoNoiseFor } from '../lib/noiseProfile'; +import { clearDenoised, getDenoiseJob, startDenoise } from '../lib/api'; +import { clamp } from '../lib/curves'; +import type { + CurveChannel, + Edits, + EventRecord, + HistoryEntry, + LocalLayer, + LocalMaskKind, + MetadataPreset, + PhotoRecord, + Preset, + Snapshot, +} from '../types'; +import CurveEditor from './CurveEditor'; +import { getBitmap } from '../lib/images'; +import { grainSampleWindow, rotatedBounds, Renderer } from '../gl/renderer'; +import { applyFilmVariant, FILM_VARIANTS, type FilmVariant } from '../lib/presets'; +import { usePresetThumbs } from './PresetThumbs'; +import { availableFor, findLensForMeta, searchLens, type LensSearchResult } from '../lib/lensfun'; +import { + getCameraLensDefault, + removeCameraLensDefault, + saveCameraLensDefault, + type CameraLensDefault, +} from '../lib/lensDefaults'; +import type { LensProfile } from '../types'; +import LensDefaultsModal from './LensDefaultsModal'; +import Slider from './Slider'; + +export function Panel({ + title, + children, + defaultOpen = true, + right, +}: { + title: string; + children: React.ReactNode; + defaultOpen?: boolean; + right?: React.ReactNode; +}) { + const [open, setOpen] = useState(defaultOpen); + return ( +
    +
    + + {right} +
    + {open &&
    {children}
    } +
    + ); +} + +export interface PanelSetProps { + edits: Edits; + photo: PhotoRecord; + set: (patch: Partial, label: string) => void; +} + +const HUE_TRACK = 'linear-gradient(90deg,#ff4d4d,#ffd24d,#6dff6d,#4dfff0,#4d8bff,#c44dff,#ff4dd2,#ff4d4d)'; + +export function BasicPanel({ + edits, + photo, + set, + picker = false, + onPicker, +}: PanelSetProps & { picker?: boolean; onPicker?: (active: boolean) => void }) { + const [autoBusy, setAutoBusy] = useState(false); + + const auto = async () => { + setAutoBusy(true); + try { + const partial = await computeAutoEdits(photo.thumb); + set(partial, 'Auto tone'); + } finally { + setAutoBusy(false); + } + }; + + return ( + +
    + White balance +
    + + +
    +
    + set({ temp: v }, 'Temperature')} + track="linear-gradient(90deg,#3f74d8,#a8b6c6,#f4b23f)" + /> + set({ tint: v }, 'Tint')} + track="linear-gradient(90deg,#54b364,#a8b6c6,#c56ad2)" + /> + +
    + Tone + +
    + set({ exposure: v }, 'Exposure')} + format={(v) => v.toFixed(2)} + previewClipping + /> + set({ recovery: v }, 'Recovery')} + previewClipping + /> + set({ contrast: v }, 'Contrast')} /> + set({ highlights: v }, 'Highlights')} /> + set({ shadows: v }, 'Shadows')} /> + set({ whites: v }, 'Whites')} /> + set({ blacks: v }, 'Blacks')} /> + +
    + Presence +
    + set({ texture: v }, 'Texture')} /> + set({ clarity: v }, 'Clarity')} /> + set({ dehaze: v }, 'Dehaze')} /> + set({ vibrance: v }, 'Vibrance')} /> + set({ saturation: v }, 'Saturation')} /> + + + {edits.bw && ( + <> +
    + B&W filter +
    +
    + {BW_FILTERS.map((f) => ( + + ))} +
    + {edits.bwFilter !== 'none' && ( + set({ bwFilterAmount: v }, 'B&W filter strength')} + /> + )} +
    + A filter darkens the colors it absorbs: red drops blue skies, green lifts foliage. The color mixer + below tunes individual hues on top. +
    + + )} +
    + ); +} + +const CURVE_COLORS: Record = { + rgb: '#e9e9ec', + red: '#e06a6a', + green: '#6ecf7d', + blue: '#6f9de8', +}; + +export function CurvePanel({ edits, set }: PanelSetProps) { + const [channel, setChannel] = useState('rgb'); + const points = edits.curve[channel]; + const update = (next: typeof points) => set({ curve: { ...edits.curve, [channel]: next } }, `Curve ${channel.toUpperCase()}`); + + return ( + + set( + { curve: { ...edits.curve, [channel]: identityCurve() }, parametric: { highlights: 0, lights: 0, darks: 0, blacks: 0 } }, + 'Reset tone curve', + ) + } + > + Reset + + } + > +
    + {(['rgb', 'red', 'green', 'blue'] as CurveChannel[]).map((c) => ( + + ))} +
    + +
    + Parametric +
    + set({ parametric: { ...edits.parametric, highlights: v } }, 'Parametric highlights')} + /> + set({ parametric: { ...edits.parametric, lights: v } }, 'Parametric lights')} + /> + set({ parametric: { ...edits.parametric, darks: v } }, 'Parametric darks')} + /> + set({ parametric: { ...edits.parametric, blacks: v } }, 'Parametric blacks')} + /> +
    + ); +} + +export function HslPanel({ edits, set }: PanelSetProps) { + const [band, setBand] = useState(0); + const active = HUE_BANDS[band]; + + const setBandValue = (kind: 'hue' | 'sat' | 'lum', value: number) => { + const arr = [...edits.hsl[kind]]; + arr[band] = value; + const label = kind === 'hue' ? 'Hue' : kind === 'sat' ? 'Saturation' : 'Luminance'; + set({ hsl: { ...edits.hsl, [kind]: arr } }, `${label} · ${active.name}`); + }; + + return ( + + set( + { hsl: { hue: HUE_BANDS.map(() => 0), sat: HUE_BANDS.map(() => 0), lum: HUE_BANDS.map(() => 0) } }, + 'Reset color mixer', + ) + } + > + Reset + + } + > +
    + {HUE_BANDS.map((b, i) => ( +
    +
    {active.name}
    + setBandValue('hue', v)} track={HUE_TRACK} /> + setBandValue('sat', v)} /> + setBandValue('lum', v)} /> +
    Shift, saturate or brighten one color range without touching the rest.
    +
    + ); +} + +export function ColorGradingPanel({ edits, set }: PanelSetProps) { + return ( + +
    + Shadows + +
    + set({ grading: { ...edits.grading, shadows: { ...edits.grading.shadows, h: v } } }, 'Grading shadows hue')} + track={HUE_TRACK} + /> + set({ grading: { ...edits.grading, shadows: { ...edits.grading.shadows, s: v } } }, 'Grading shadows')} + /> +
    + Highlights + +
    + + set({ grading: { ...edits.grading, highlights: { ...edits.grading.highlights, h: v } } }, 'Grading highlights hue') + } + track={HUE_TRACK} + /> + set({ grading: { ...edits.grading, highlights: { ...edits.grading.highlights, s: v } } }, 'Grading highlights')} + /> + set({ grading: { ...edits.grading, balance: v } }, 'Grading balance')} + /> +
    + ); +} + +/** + * 1:1 loupe of the grain. A small window of the real crop is rendered at actual + * pixels, which is the only way to judge a resolution independent grain size + * without exporting: this is what the file looks like at 100%. + */ +function GrainPatch({ + photo, + edits, + freezeGrain, +}: { + photo: PhotoRecord; + edits: Edits; + freezeGrain?: boolean; +}) { + const ref = useRef(null); + const renderer = useRef(null); + const bitmap = useRef(null); + const [ready, setReady] = useState(false); + + useEffect(() => { + let alive = true; + getBitmap(photo) + .then((bmp) => { + if (!alive) return; + bitmap.current = bmp; + setReady(true); + }) + .catch(() => undefined); + return () => { + alive = false; + }; + }, [photo.id]); + + useEffect( + () => () => { + renderer.current?.dispose(); + renderer.current = null; + }, + [], + ); + + useEffect(() => { + const canvas = ref.current; + const bmp = bitmap.current; + if (!canvas || !bmp) return; + const dpr = Math.min(window.devicePixelRatio || 1, 2); + const frame = rotatedBounds(bmp.width, bmp.height, edits.crop.angle, edits.crop.quarter); + // The patch takes the shape of the framed area, so it reads as a window onto + // the crop rather than a generic swatch. + const cropPxW = Math.max(1, frame.w * edits.crop.w); + const cropPxH = Math.max(1, frame.h * edits.crop.h); + const cssW = 148; + const cssH = Math.round(Math.min(148, Math.max(64, cssW * (cropPxH / cropPxW)))); + const W = Math.max(1, Math.round(cssW * dpr)); + const H = Math.max(1, Math.round(cssH * dpr)); + canvas.style.width = `${cssW}px`; + canvas.style.height = `${cssH}px`; + if (canvas.width !== W) canvas.width = W; + if (canvas.height !== H) canvas.height = H; + try { + if (!renderer.current) renderer.current = new Renderer(canvas); + const r = renderer.current; + r.setImage(bmp); + // One source pixel per device pixel, centred on whatever the crop frames: + // drag the crop rectangle and the patch samples that part of the photo. + const view = grainSampleWindow(frame, edits.crop, W, H); + r.render(edits, { width: W, height: H, view, freezeGrain }); + } catch { + // Keep the last good frame rather than blanking the patch. + } + }, [photo.id, ready, edits, freezeGrain]); + + return ( +
    + + Grain at 100% · inside the crop +
    + ); +} + +export function EffectsPanel({ edits, photo, set, grainFreeze }: PanelSetProps & { grainFreeze?: boolean }) { + return ( + +
    + Vignette +
    + set({ vignette: { ...edits.vignette, amount: v } }, 'Vignette amount')} + /> + set({ vignette: { ...edits.vignette, midpoint: v } }, 'Vignette midpoint')} + /> + set({ vignette: { ...edits.vignette, feather: v } }, 'Vignette feather')} + /> +
    + Grain +
    + set({ grain: { ...edits.grain, amount: v } }, 'Grain amount')} + /> + set({ grain: { ...edits.grain, size: v } }, 'Grain size')} + /> + set({ grain: { ...edits.grain, roughness: v } }, 'Grain roughness')} + /> + +
    + ); +} + +export function DetailPanel({ edits, photo, set }: PanelSetProps) { + const [aiBusy, setAiBusy] = useState(false); + const [aiNote, setAiNote] = useState(null); + const aiActive = Boolean(edits.aiDenoise.key); + + // Poll rather than stream: the job is seconds long, and a failed poll just + // leaves the previous note on screen instead of breaking the panel. + const generateAi = async () => { + if (aiBusy) return; + setAiBusy(true); + setAiNote('Rendering the denoised version on the server…'); + try { + const { jobId } = await startDenoise(photo.id); + for (let attempt = 0; attempt < 180; attempt++) { + await new Promise((resolve) => setTimeout(resolve, 1000)); + const job = await getDenoiseJob(jobId); + if (job.state === 'done') { + set({ aiDenoise: { ...edits.aiDenoise, key: job.key } }, 'AI denoise'); + // The pipeline tapers itself down on frames it measures as clean. That + // taper is in the rendered file now, so report it -- the Amount slider + // multiplies it rather than replacing it. + const applied = job.stats?.autoGate ?? 1; + const base = job.cached + ? 'Using the cached version' + : job.ms != null + ? `Cleaned in ${(job.ms / 1000).toFixed(1)}s` + : 'Denoise ready'; + setAiNote( + applied < 0.95 + ? `${base} · clean frame, correction reduced to ${Math.round(applied * 100)}%` + : base, + ); + return; + } + if (job.state === 'error') { + setAiNote(job.error ?? 'Denoise failed'); + return; + } + } + setAiNote('Denoise is still running — try again in a moment'); + } catch (err) { + setAiNote(err instanceof Error ? err.message : 'Denoise failed'); + } finally { + setAiBusy(false); + } + }; + + return ( + +
    + Sharpening +
    + set({ sharpen: { ...edits.sharpen, amount: v } }, 'Sharpen amount')} + /> + set({ sharpen: { ...edits.sharpen, radius: v } }, 'Sharpen radius')} + format={(v) => v.toFixed(1)} + def={1} + /> + set({ sharpen: { ...edits.sharpen, detail: v } }, 'Sharpen detail')} + /> + set({ sharpen: { ...edits.sharpen, mask: v } }, 'Sharpen masking')} + /> + set({ sharpen: { ...edits.sharpen, lensSoftness: v } }, 'Lens softness')} + format={(v) => `${Math.round(v)}`} + /> +

    + Edge-aware sharpening for lenses that soften towards the corners. +

    +
    + Noise reduction + +
    + set({ noise: { ...edits.noise, luminance: v } }, 'Noise reduction')} + /> + set({ noise: { ...edits.noise, detail: v } }, 'Noise detail')} + /> + set({ noise: { ...edits.noise, chroma: v } }, 'Color noise reduction')} + /> + set({ noise: { ...edits.noise, chromaDetail: v } }, 'Color detail')} + /> +
    + AI denoise + +
    + {aiActive ? ( + set({ aiDenoise: { ...edits.aiDenoise, amount: v } }, 'AI denoise amount')} + /> + ) : null} +

    + {aiNote ?? + (aiActive + ? 'Detail-preserving denoise, rendered from the full proxy.' + : 'Removes noise only where there is no structure to keep.')} +

    + {aiActive ? ( + + ) : null} +
    + Defringe +
    + set({ defringe: { ...edits.defringe, purple: v } }, 'Purple fringe')} + /> + set({ defringe: { ...edits.defringe, green: v } }, 'Green fringe')} + /> +
    + ); +} + +const BRAND_PREFIX = /^(Kodak|Fujifilm|Ilford|Agfa|CineStill|Lomography) /; + +export function PresetsPanel({ + presets, + photo, + onApply, + onSave, +}: { + presets: Preset[]; + photo: PhotoRecord; + onApply: (preset: Preset) => void; + onSave: (name: string) => void; +}) { + const [variant, setVariant] = useState('base'); + // Variants are derived on the fly, so every stock gets push/pull and split + // grade versions without tripling the catalogue. + const shown = useMemo(() => presets.map((p) => applyFilmVariant(p, variant)), [presets, variant]); + + const groups = new Map(); + for (const preset of shown) { + const arr = groups.get(preset.group) ?? []; + arr.push(preset); + groups.set(preset.group, arr); + } + const thumbs = usePresetThumbs(photo, shown); + + return ( +
    +
    + Presets + +
    +
    + {FILM_VARIANTS.map((v) => ( + + ))} +
    + {[...groups.entries()].map(([group, items]) => ( +
    +
    {group}
    +
    + {items.map((preset) => { + const src = thumbs[preset.id]; + return ( + + ); + })} +
    +
    + ))} +
    + ); +} + +export function HistoryPanel({ history, onRestore }: { history: HistoryEntry[]; onRestore: (edits: Edits) => void }) { + return ( +
    +
    + History + {history.length} +
    +
    + {[...history].reverse().map((entry, i) => ( + + ))} +
    +
    + ); +} + +export function SnapshotsPanel({ + snapshots, + onSave, + onRestore, + onDelete, +}: { + snapshots: Snapshot[]; + onSave: (name: string) => void; + onRestore: (snapshot: Snapshot) => void; + onDelete: (snapshot: Snapshot) => void; +}) { + return ( +
    +
    + Snapshots + +
    + {snapshots.length ? ( +
    + {[...snapshots].reverse().map((snapshot) => ( +
    + + +
    + ))} +
    + ) : ( +

    + Save a named look before trying another treatment. Snapshots stay with this photo and its virtual copies. +

    + )} +
    + ); +} + +export function CropPanel({ + edits, + set, + onAspect, + onRotate, + onFlipPreview, + mirrored, +}: { + edits: Edits; + set: PanelSetProps['set']; + frame: { w: number; h: number }; + onAspect: (id: string) => void; + onRotate: (dir: -1 | 1) => void; + onFlipPreview?: () => void; + mirrored?: boolean; +}) { + const crop = edits.crop; + return ( + +
    + + + {onFlipPreview && ( + + )} +
    +
    + {ASPECTS.map((a) => ( + + ))} +
    + set({ crop: { ...crop, angle: v } }, 'Straighten')} + format={(v) => `${v.toFixed(1)}°`} + /> +
    + + + +
    +
    + ); +} + +interface NavigatorRect { + x: number; + y: number; + w: number; + h: number; +} + +export function NavigatorPanel({ + photo, + content, + view, + zoomed, + zoomLabel, + onNavigate, +}: { + photo: PhotoRecord; + content: NavigatorRect; + view: NavigatorRect | null; + zoomed: boolean; + zoomLabel: string; + onNavigate: (x: number, y: number) => void; +}) { + const canvasRef = useRef(null); + const frameRef = useRef(null); + const dragRef = useRef(false); + const thumbSrc = photo.thumbUrl ?? photo.thumb; + const [thumb, setThumb] = useState(null); + const [boxWidth, setBoxWidth] = useState(0); + + useEffect(() => { + let alive = true; + const image = new Image(); + image.decoding = 'async'; + image.onload = () => { + if (alive) setThumb(image); + }; + image.src = thumbSrc; + return () => { + alive = false; + image.onload = null; + }; + }, [thumbSrc]); + + useEffect(() => { + const canvas = canvasRef.current; + if (!canvas) return; + const measure = () => setBoxWidth(canvas.clientWidth); + measure(); + const observer = new ResizeObserver(measure); + observer.observe(canvas); + return () => observer.disconnect(); + }, []); + + useEffect(() => { + const canvas = canvasRef.current; + if (!canvas || !boxWidth || !thumb) return; + const dpr = Math.min(window.devicePixelRatio || 1, 2); + const cssW = boxWidth; + const cssH = (boxWidth * 3) / 4; + const pixelsW = Math.max(1, Math.round(cssW * dpr)); + const pixelsH = Math.max(1, Math.round(cssH * dpr)); + if (canvas.width !== pixelsW || canvas.height !== pixelsH) { + canvas.width = pixelsW; + canvas.height = pixelsH; + } + const ctx = canvas.getContext('2d'); + if (!ctx) return; + ctx.setTransform(dpr, 0, 0, dpr, 0, 0); + ctx.clearRect(0, 0, cssW, cssH); + ctx.fillStyle = '#0d0d10'; + ctx.fillRect(0, 0, cssW, cssH); + + const crop = photo.edits.crop; + const frame = rotatedBounds(photo.width || 1, photo.height || 1, crop.angle, crop.quarter); + const inset = 7; + const scale = Math.min((cssW - inset * 2) / frame.w, (cssH - inset * 2) / frame.h); + const frameW = frame.w * scale; + const frameH = frame.h * scale; + const left = (cssW - frameW) / 2; + const top = (cssH - frameH) / 2; + frameRef.current = { x: left, y: top, w: frameW, h: frameH }; + + // The canvas miniature follows the same orientation order as the main + // renderer: flips on the photo, then the quarter turns and straighten. + ctx.save(); + ctx.translate(left + frameW / 2, top + frameH / 2); + ctx.rotate(((crop.quarter * 90 + crop.angle) * Math.PI) / 180); + ctx.scale(crop.flipH ? -1 : 1, crop.flipV ? -1 : 1); + ctx.imageSmoothingEnabled = true; + ctx.imageSmoothingQuality = 'high'; + ctx.drawImage( + thumb, + (-(photo.width || 1) * scale) / 2, + (-(photo.height || 1) * scale) / 2, + (photo.width || 1) * scale, + (photo.height || 1) * scale, + ); + ctx.restore(); + + const cropX = left + content.x * frameW; + const cropY = top + content.y * frameH; + const cropW = content.w * frameW; + const cropH = content.h * frameH; + + // Dim the part of the photo outside the crop so the navigator reads like + // an overview, while the white box marks the pixels currently on screen. + ctx.fillStyle = 'rgba(5, 5, 8, 0.58)'; + if (cropY > top) ctx.fillRect(left, top, frameW, cropY - top); + if (cropY + cropH < top + frameH) { + ctx.fillRect(left, cropY + cropH, frameW, top + frameH - cropY - cropH); + } + if (cropX > left) ctx.fillRect(left, cropY, cropX - left, cropH); + if (cropX + cropW < left + frameW) { + ctx.fillRect(cropX + cropW, cropY, left + frameW - cropX - cropW, cropH); + } + + const shown = view ?? content; + const viewX = left + shown.x * frameW; + const viewY = top + shown.y * frameH; + const viewW = shown.w * frameW; + const viewH = shown.h * frameH; + ctx.fillStyle = 'rgba(255, 255, 255, 0.07)'; + ctx.fillRect(viewX, viewY, viewW, viewH); + ctx.strokeStyle = 'rgba(255, 255, 255, 0.35)'; + ctx.lineWidth = 1; + ctx.strokeRect(cropX + 0.5, cropY + 0.5, Math.max(0, cropW - 1), Math.max(0, cropH - 1)); + ctx.strokeStyle = zoomed ? '#f4f4f7' : 'rgba(244, 244, 247, 0.78)'; + ctx.lineWidth = zoomed ? 2 : 1.25; + ctx.setLineDash(zoomed ? [] : [4, 3]); + ctx.strokeRect(viewX + 1, viewY + 1, Math.max(0, viewW - 2), Math.max(0, viewH - 2)); + ctx.setLineDash([]); + }, [boxWidth, thumb, photo.width, photo.height, photo.edits.crop, content, view, zoomed]); + + const locate = (event: React.PointerEvent) => { + const canvas = canvasRef.current; + const frame = frameRef.current; + if (!canvas || !frame) return null; + const rect = canvas.getBoundingClientRect(); + if (!rect.width || !rect.height) return null; + return { + x: Math.min(1, Math.max(0, (event.clientX - rect.left - frame.x) / frame.w)), + y: Math.min(1, Math.max(0, (event.clientY - rect.top - frame.y) / frame.h)), + }; + }; + + const endDrag = (event: React.PointerEvent) => { + dragRef.current = false; + if (event.currentTarget.hasPointerCapture(event.pointerId)) { + event.currentTarget.releasePointerCapture(event.pointerId); + } + }; + + return ( +
    +
    + Navigator + {zoomLabel} +
    +
    + { + if (event.button !== 0) return; + const point = locate(event); + if (!point) return; + dragRef.current = true; + event.currentTarget.setPointerCapture(event.pointerId); + onNavigate(point.x, point.y); + }} + onPointerMove={(event) => { + if (!dragRef.current) return; + const point = locate(event); + if (point) onNavigate(point.x, point.y); + }} + onPointerUp={endDrag} + onPointerCancel={endDrag} + /> +
    +
    + {photo.name} +
    +
    + {photo.raw ? (photo.decode === 'embedded' ? 'Raw · camera preview' : 'Raw · demosaiced') : 'JPEG/PNG'}{' '} + · {photo.width}×{photo.height} +
    +
    + ); +} + +const LOCAL_ICON: Record = { brush: '✎', linear: '▤', radial: '◉', raster: '✦' }; + +export function LocalPanel({ + edits, + set, + activeId, + onSelect, + onAdd, + onDelete, + onDuplicate, + onEditMask, + maskMode, + brushSize, + onBrushSize, + onCopyLayer, + onPasteLayer, + canPaste, + onAutoMask, + autoBusy, +}: PanelSetProps & { + activeId: string | null; + onSelect: (id: string) => void; + onAdd: (kind: LocalMaskKind) => void; + onDelete: (id: string) => void; + onDuplicate: (id: string) => void; + onEditMask: () => void; + maskMode: boolean; + brushSize: number; + onBrushSize: (value: number) => void; + onCopyLayer: () => void; + onPasteLayer: () => void; + canPaste: boolean; + onAutoMask: (kind: 'subject' | 'sky' | 'background') => void; + autoBusy?: boolean; +}) { + const layers = edits.local ?? []; + const active = layers.find((layer) => layer.id === activeId) ?? null; + + const patch = (next: Partial, label: string) => { + if (!active) return; + set({ local: layers.map((layer) => (layer.id === active.id ? { ...layer, ...next } : layer)) }, label); + }; + const adjust = (key: keyof LocalLayer['adjust'], value: number) => + active && patch({ adjust: { ...active.adjust, [key]: value } }, `Local ${key}`); + const range = (key: keyof LocalLayer['range'], value: number | boolean) => + active && patch({ range: { ...active.range, [key]: value } }, 'Local range'); + + return ( + {layers.length}/4}> +
    + + + +
    +
    + + + +
    +
    + + +
    + + {layers.length === 0 ? ( +

    + Add a layer to dodge, burn or colour part of the frame. Masks follow the photo through crops + and lens correction. +

    + ) : ( + <> +
    + {layers.map((layer) => ( + + ))} +
    + + {active && ( + <> +
    + + + +
    + + {active.kind === 'raster' && ( +

    + Auto mask · adjust the feather, invert it, paint it away by adding a brush layer, or regenerate from the buttons above. +

    + )} + + {active.kind === 'brush' && ( + `${Math.round(v)}px`} + /> + )} + + {active.kind !== 'linear' && ( + patch({ feather: v }, 'Local feather')} + format={(v) => `${Math.round(v)}%`} + /> + )} + +
    Light
    + adjust('exposure', v)} + format={(v) => `${v > 0 ? '+' : ''}${v.toFixed(2)}`} + /> + adjust('contrast', v)} + /> + adjust('highlights', v)} + /> + adjust('shadows', v)} + /> + +
    Colour
    + adjust('temp', v)} + format={(v) => (v > 0 ? `+${Math.round(v)}` : `${Math.round(v)}`)} + /> + adjust('tint', v)} /> + adjust('saturation', v)} + /> + +
    + Range + +
    + {active.range.enabled && ( + <> + range('lumaMin', Math.min(v, active.range.lumaMax))} + /> + range('lumaMax', Math.max(v, active.range.lumaMin))} + /> + range('hue', v)} + track={HUE_TRACK} + /> + range('hueRange', v)} + /> + range('satMin', v)} + /> + + )} + +
    + + +
    + + )} + + )} +
    + ); +} + +export function OpticsPanel({ + edits, + photo, + set, + lensState, + lensSplit, + onLensSplit, +}: PanelSetProps & { + lensState?: { loading: boolean; error: string | null }; + lensSplit?: boolean; + onLensSplit?: (next: boolean) => void; +}) { + const geometry = edits.geometry; + const profile = edits.lens; + const [query, setQuery] = useState(profile?.model ?? ''); + const [results, setResults] = useState([]); + const [searching, setSearching] = useState(false); + const [searchMsg, setSearchMsg] = useState(null); + const [available, setAvailable] = useState(null); + const [defaultProfile, setDefaultProfile] = useState(null); + const [defaultsOpen, setDefaultsOpen] = useState(false); + const patch = (next: Partial, label: string) => + set({ geometry: { ...geometry, ...next } }, label); + + useEffect(() => { + setQuery(profile?.model ?? ''); + }, [profile?.maker, profile?.model]); + + useEffect(() => { + let alive = true; + getCameraLensDefault(photo.meta) + .then((entry) => alive && setDefaultProfile(entry)) + .catch(() => alive && setDefaultProfile(null)); + return () => { + alive = false; + }; + }, [photo.meta.camera, photo.meta.lens]); + + useEffect(() => { + let alive = true; + if (!profile) { + setAvailable(null); + return; + } + availableFor(profile) + .then((flags) => alive && setAvailable(flags)) + .catch(() => alive && setAvailable(0)); + return () => { + alive = false; + }; + }, [profile]); + + const applyProfile = (result: Pick) => { + const next: LensProfile = { + maker: result.maker, + model: result.model, + crop: result.crop, + cameraModel: photo.meta.camera ?? undefined, + corrections: { distortion: true, tca: true, vignetting: true }, + distance: 1000, + }; + set({ lens: next }, 'Lens profile'); + setResults([]); + setSearchMsg(null); + }; + + const runSearch = async () => { + const text = query.trim(); + if (text.length < 2) return; + setSearching(true); + setSearchMsg(null); + try { + const found = await searchLens(text, photo.meta); + setResults(found); + if (!found.length) setSearchMsg('No matching lens in the database'); + } catch (err) { + setSearchMsg(err instanceof Error ? err.message : 'Lens search failed'); + } finally { + setSearching(false); + } + }; + + const autoMatch = async () => { + setSearching(true); + setSearchMsg(null); + try { + const match = await findLensForMeta(photo.meta); + if (!match) { + setSearchMsg(photo.meta.lens ? 'No confident match for this lens' : 'This photo has no lens in its EXIF data'); + } else { + applyProfile(match); + } + } catch (err) { + setSearchMsg(err instanceof Error ? err.message : 'Lens search failed'); + } finally { + setSearching(false); + } + }; + + const setCorrection = (key: keyof LensProfile['corrections'], value: boolean) => { + if (!profile) return; + set( + { lens: { ...profile, corrections: { ...profile.corrections, [key]: value } } }, + `Lens ${key}`, + ); + }; + + const saveDefault = async () => { + if (!profile) return; + try { + const entry = await saveCameraLensDefault(photo.meta, profile); + setDefaultProfile(entry); + setSearchMsg(entry ? 'Saved for this camera and lens' : 'A camera and EXIF lens name are required'); + } catch (err) { + setSearchMsg(err instanceof Error ? err.message : 'Could not save the camera default'); + } + }; + + const forgetDefault = async () => { + try { + await removeCameraLensDefault(photo.meta); + setDefaultProfile(null); + setSearchMsg('Camera default removed'); + } catch (err) { + setSearchMsg(err instanceof Error ? err.message : 'Could not remove the camera default'); + } + }; + + const refreshDefault = () => { + getCameraLensDefault(photo.meta) + .then(setDefaultProfile) + .catch(() => setDefaultProfile(null)); + }; + + const hasDefault = Boolean( + defaultProfile && + profile && + defaultProfile.profile.maker === profile.maker && + defaultProfile.profile.model === profile.model, + ); + + return ( + <> + +

    {photo.meta.lens || 'No lens in EXIF'}

    + +
    +
    + Lens profile + {profile && ( + + )} +
    + {profile ? ( +

    + {profile.maker} {profile.model} + · crop {profile.crop}× +

    + ) : ( +

    Search the Lensfun database or pick a match.

    + )} +
    + setQuery(e.target.value)} + onKeyDown={(e) => { + if (e.key === 'Enter') void runSearch(); + }} + /> + +
    +
    + +
    + {searchMsg &&

    {searchMsg}

    } + {results.length > 0 && ( +
    + {results.map((result) => ( + + ))} +
    + )} + {profile && ( +
    + + {defaultProfile && ( + + )} +
    + )} +
    + +
    + {profile && ( +
    + {(['distortion', 'tca', 'vignetting'] as const).map((key) => { + const labels = { distortion: 'Distortion', tca: 'Chromatic aberration', vignetting: 'Vignetting' }; + const bit = key === 'distortion' ? 8 : key === 'tca' ? 1 : 2; + const supported = available === null || (available & bit) !== 0; + return ( + + ); + })} + {lensState?.loading &&

    Building correction maps…

    } + {lensState?.error &&

    {lensState.error}

    } + {onLensSplit && ( + + )} +
    + )} +
    + patch({ distortion: v }, 'Lens distortion')} + /> + patch({ vertical: v }, 'Vertical perspective')} + /> + patch({ horizontal: v }, 'Horizontal perspective')} + /> + patch({ rotate: v }, 'Optics rotation')} + format={(v) => `${v.toFixed(1)}°`} + /> + patch({ scale: v }, 'Optics scale')} + format={(v) => `${Math.round(v)}%`} + /> +
    + +
    +
    + {defaultsOpen && ( + setDefaultsOpen(false)} + onChanged={refreshDefault} + /> + )} + + ); +} + +export function ProofPanel({ edits, set }: PanelSetProps) { + const proof = edits.proof; + return ( + +
    + + +
    + + set({ proof: { ...proof, blackPoint: v } }, 'Proof black point')} + format={(v) => `${Math.round(v)}%`} + def={2} + /> +

    + Paper white, black point and a print-gamut preview are applied to the canvas and export. Turn off before delivering screen files. +

    +
    + ); +} + +export function MetadataPanel({ + photo, + events, + onUpdate, + presets = [], + keywordLibrary = [], + onSavePreset, + onDeletePreset, +}: { + photo: PhotoRecord; + events: EventRecord[]; + onUpdate?: (patch: Partial) => void; + presets?: MetadataPreset[]; + keywordLibrary?: string[]; + onSavePreset?: (preset: Omit) => void; + onDeletePreset?: (id: string) => void; +}) { + const event = events.find((e) => e.id === photo.eventId); + const [keyword, setKeyword] = useState(''); + const [presetId, setPresetId] = useState(''); + const rows: [string, string][] = [ + ['File', photo.name], + ['Dimensions', `${photo.width} × ${photo.height}`], + ['Size', `${(photo.size / (1024 * 1024)).toFixed(2)} MB`], + ['Camera', photo.meta.camera ?? '—'], + ['Lens', photo.meta.lens ?? '—'], + ['ISO', photo.meta.iso ? String(photo.meta.iso) : '—'], + ['Aperture', photo.meta.aperture ? `f/${photo.meta.aperture}` : '—'], + ['Shutter', photo.meta.shutter ?? '—'], + ['Focal', photo.meta.focal ? `${photo.meta.focal} mm` : '—'], + ['Captured', photo.takenAt ? new Date(photo.takenAt).toLocaleString() : '—'], + ['Imported', new Date(photo.addedAt).toLocaleDateString()], + ['Event', event?.name ?? 'Unsorted'], + ]; + + const patch = (next: Partial) => onUpdate?.(next); + + const addKeyword = (raw?: string) => { + const value = (raw ?? keyword).trim().replace(/,$/, ''); + if (!value) return; + const exists = photo.keywords.some((word) => word.toLowerCase() === value.toLowerCase()); + if (!exists) patch({ keywords: [...photo.keywords, value.slice(0, 48)] }); + setKeyword(''); + }; + + const removeKeyword = (word: string) => { + patch({ keywords: photo.keywords.filter((item) => item !== word) }); + }; + + const applyPreset = (id: string) => { + setPresetId(id); + const preset = presets.find((item) => item.id === id); + if (!preset) return; + const words = new Set([...photo.keywords, ...preset.keywords]); + patch({ + creator: preset.creator, + copyright: preset.copyright, + keywords: [...words], + }); + }; + + const savePreset = () => { + if (!onSavePreset) return; + const name = window.prompt('Metadata preset name', 'My metadata'); + if (!name?.trim()) return; + onSavePreset({ + name: name.trim(), + creator: photo.creator, + copyright: photo.copyright, + keywords: photo.keywords, + }); + }; + + return ( + +
    + +