Add JPEG XL export with a lossless option

Export now offers JPEG XL (8-bit sRGB) next to JPEG, PNG, WebP and 16-bit
TIFF, encoded on-device by libjxl compiled to WebAssembly so the export stays
offline. The codec loads only when a JXL is chosen, the quality slider applies
to the lossy mode, and a lossless switch disables it. The user guide and
changelog describe the format and its current limits (no ICC or XMP yet).

Also adds SECURITY-AUDIT.md with the dependency scan and the review of the
server's trust boundaries.
This commit is contained in:
2026-12-01 14:43:29 +00:00
parent 8b309d9cad
commit 3759b47bc6
13 changed files with 309 additions and 8 deletions
+22 -3
View File
@@ -23,6 +23,7 @@ const FORMATS: { value: ExportFormat; label: string }[] = [
{ value: 'png', label: 'PNG (8-bit)' },
{ value: 'webp', label: 'WebP' },
{ value: 'tiff16', label: 'TIFF (16-bit)' },
{ value: 'jxl', label: 'JPEG XL' },
];
/**
@@ -360,7 +361,7 @@ export default function ExportModal({ photos, initial, recipes, onSaveRecipe, on
)}
</div>
{(opts.format === 'jpeg' || opts.format === 'webp') && (
{(opts.format === 'jpeg' || opts.format === 'webp' || opts.format === 'jxl') && (
<label className="field">
<span>Quality · {opts.quality}</span>
<input
@@ -369,11 +370,29 @@ export default function ExportModal({ photos, initial, recipes, onSaveRecipe, on
max={100}
value={opts.quality}
onChange={(e) => patch({ quality: Number(e.target.value) })}
disabled={busy}
disabled={busy || (opts.format === 'jxl' && opts.jxlLossless === true)}
/>
</label>
)}
{opts.format === 'jxl' && (
<>
<label className="check-row">
<input
type="checkbox"
checked={opts.jxlLossless === true}
onChange={(e) => patch({ jxlLossless: e.target.checked })}
disabled={busy}
/>
Lossless — keeps every pixel and ignores the quality setting
</label>
<p className="muted small">
JPEG XL exports are 8-bit sRGB. Chrome, Firefox and Safari open them; Microsoft Edge
does not yet.
</p>
</>
)}
{sample && <ExportDetailStrip photo={sample} size={previewSize} />}
<label className="field">
@@ -478,7 +497,7 @@ export default function ExportModal({ photos, initial, recipes, onSaveRecipe, on
type="checkbox"
checked={opts.embedProfile}
onChange={(e) => patch({ embedProfile: e.target.checked })}
disabled={opts.format === 'webp' || opts.format === 'png'}
disabled={opts.format === 'webp' || opts.format === 'png' || opts.format === 'jxl'}
/>
Embed {COLOR_SPACE_OPTIONS.find((option) => option.value === (opts.colorSpace ?? 'srgb'))?.label ?? 'sRGB'} profile (JPEG/TIFF)
</label>