Skip to content

LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust

Merge PR #1216

bflatastic84d6849cf321
diff --cc crates/engine/src/files.rs
index 7ebc9c91a,4d418bc46..ee17ee735
--- a/crates/engine/src/files.rs
+++ b/crates/engine/src/files.rs
@@@ -1135,152 -997,28 +1147,174 @@@ mod tests
let _ = std::fs::remove_dir_all(&dir);
}
+ /// What a fixture's IFD0 says about itself: the tag that makes `probe` call the file a raw, the
+ /// file's own orientation, and the EXIF colour space the container declares for its preview.
+ #[derive(Clone, Copy, Default)]
+ struct Fixture {
+ dng: bool,
+ sony: bool,
+ orientation: Option<u16>,
+ /// EXIF `ColorSpace` (0xA001): 1 = sRGB, 0xFFFF with an "R03" InteropIndex = Adobe RGB.
+ color_space: Option<u16>,
+ }
+
+ /// A TIFF-family raw no header field points into: IFD0 is the JPEG-compressed preview strip (the
+ /// shape a DNG's `PreviewImage`, a CR2's or an ARW's preview takes), IFD1 a CFA "sensor" strip of
+ /// `tail` bytes. The writer puts each IFD's table after its own chunk, so a `strip` bigger than
+ /// the plan's bounded header puts IFD0 (and any orientation tag in it) out of that header's reach.
+ fn tiff_with_preview_strip(strip: &[u8], tail: usize, what: Fixture) -> Vec<u8> {
+ use lightcraft_tiff::{IfdBuilder, ImageData, TiffWriter, Value, tags as t};
+ let mut preview = IfdBuilder::new();
+ if what.dng {
+ preview.set(t::DNG_VERSION, Value::Byte(vec![1, 4, 0, 0]));
+ }
+ if what.sony {
+ preview.set(t::MAKE, Value::Ascii("SONY".into()));
+ }
+ if let Some(o) = what.orientation {
+ preview.set(t::ORIENTATION, Value::Short(vec![o]));
+ }
+ if let Some(space) = what.color_space {
+ let mut exif = IfdBuilder::new();
+ exif.set(0xA001, Value::Short(vec![space]));
+ if space == 0xFFFF {
+ let mut interop = IfdBuilder::new();
+ interop.set(0x0001, Value::Undefined(b"R03".to_vec()));
+ exif.set_child(t::INTEROP_IFD, interop);
+ }
+ preview.set_child(t::EXIF_IFD, exif);
+ }
+ preview.set(t::COMPRESSION, Value::Short(vec![7]));
+ preview.set(t::PHOTOMETRIC, Value::Short(vec![t::photometric::RGB]));
+ preview.set(t::IMAGE_WIDTH, Value::Long(vec![48]));
+ preview.set(t::IMAGE_LENGTH, Value::Long(vec![32]));
+ preview.set_image(ImageData::Strips { rows_per_strip: 32, strips: vec![strip.to_vec()] });
+ let mut raw = IfdBuilder::new();
+ raw.set(t::COMPRESSION, Value::Short(vec![1]));
+ raw.set(t::PHOTOMETRIC, Value::Short(vec![t::photometric::CFA]));
+ raw.set(t::IMAGE_WIDTH, Value::Long(vec![6000]));
+ raw.set(t::IMAGE_LENGTH, Value::Long(vec![4000]));
+ raw.set_image(ImageData::Strips { rows_per_strip: 4000, strips: vec![vec![0x33u8; tail]] });
+ TiffWriter::default().write(&[preview, raw]).expect("the fixture writes")
+ }
+
+ /// A raw whose preview only its tags locate — a Canon CR3's JPEG track, a TIFF raw whose preview
+ /// tag sits past the prefix — is read in part too: `sparse::preview_plan` names the ranges
+ /// `embedded_preview` reads, so the preview strip is read and the sensor strip is not. The pixels
+ /// must equal the whole-file path's, exactly; a file the planner cannot describe must decline
+ /// rather than guess, so the caller keeps reading it whole.
+ #[test]
+ fn preview_loading_plans_the_ranges_it_needs() {
+ let (w, h) = (48u32, 32u32);
+ let rgb: Vec<u8> = (0..w * h * 3).map(|i| (i * 29 % 241) as u8).collect();
+ let img = EncodeImage::new(w, h, 3, Samples::U8(&rgb));
+ let jpeg = encode_jpeg(&img, 90, ChromaSubsampling::S420, &EncodeMeta::default()).unwrap();
+ let file = tiff_with_preview_strip(&jpeg, 400_000, Fixture { dng: true, ..Default::default() });
+ let dir = crate::tests_xmp::temp_dir("preview-plan");
+ let path = dir.join("preview.dng");
+ std::fs::write(&path, &file).unwrap();
+ let path = path.to_string_lossy().into_owned();
+ let max_edge = 512;
+
+ let (header, window, read) = preview_window(&path).expect("the file reads").expect("the plan locates its preview");
+ assert_eq!(header.len(), PLAN_PREFIX as usize, "the plan's header is bounded");
+ assert!(read.planned, "the planner is what answered");
+ assert!(read.header_path, "and it is still a bounded read");
+ assert_eq!(read.total, file.len() as u64);
+ assert!(read.fraction() < 0.5, "the read is a fraction of the file: {read:?} of {} bytes", file.len());
+ assert!(window.len() < file.len() / 2, "the sensor strip must not be read: {} of {} bytes", window.len(), file.len());
+
+ // The plan path and the whole-file path agree byte for byte.
+ let quick = quick_image_srgb(&header, &window, max_edge).expect("the window holds a decodable preview");
+ let whole = embedded_preview_srgb(&file, max_edge).expect("the whole file decodes too");
+ assert_eq!((quick.width, quick.height), (whole.width, whole.height), "same preview size");
+ assert_eq!(quick.data, whole.data, "byte for byte");
+
+ // The same structure without the tag that makes it a raw: the planner declines, and the
+ // caller's whole-file read is what answers (no guessing at what a file might hold).
+ let not_a_raw = tiff_with_preview_strip(&jpeg, 400_000, Fixture::default());
+ std::fs::write(&path, &not_a_raw).unwrap();
+ assert!(preview_window(&path).expect("the file reads").is_none(), "an unknown container falls back");
+ let _ = std::fs::remove_dir_all(&dir);
+ }
+
+ /// A file whose preview the quick path could not show the way the whole-file path does is left to
+ /// the whole file. Here the orientation tag sits in an IFD0 past the bounded header (its chunk is
+ /// bigger than that header) and the preview JPEG carries none of its own, so a window read would
+ /// come out unrotated where the whole-file path rotates it — the plan must decline instead of
+ /// handing on a wrong picture.
+ #[test]
+ fn preview_loading_declines_an_orientation_only_the_whole_file_shows() {
+ let (w, h) = (48u32, 32u32);
+ let rgb: Vec<u8> = (0..w * h * 3).map(|i| (i * 17 % 239) as u8).collect();
+ let img = EncodeImage::new(w, h, 3, Samples::U8(&rgb));
+ let jpeg = encode_jpeg(&img, 90, ChromaSubsampling::S420, &EncodeMeta::default()).unwrap();
+ // the strip (what the IFD's chunk covers) is padded past the plan's header, which is what puts
+ // IFD0 out of its reach; `embedded_preview` trims back to the JPEG's end-of-image
+ let mut strip = jpeg.clone();
+ strip.extend(std::iter::repeat_n(0u8, PLAN_PREFIX as usize));
+ let file = tiff_with_preview_strip(&strip, 400_000, Fixture { dng: true, orientation: Some(6), ..Default::default() });
+ let dir = crate::tests_xmp::temp_dir("preview-plan-orientation");
+ let path = dir.join("rotated.dng");
+ std::fs::write(&path, &file).unwrap();
+ let path = path.to_string_lossy().into_owned();
+
+ assert_eq!(lightcraft_meta::extract(&file).orientation, Some(Orientation::from_exif(6)), "the fixture states an orientation");
+ assert!(lightcraft_meta::extract(&file[..PLAN_PREFIX as usize]).orientation.is_none(), "which the bounded header cannot see");
+ assert!(lightcraft_meta::extract(&jpeg).orientation.is_none(), "and the preview JPEG carries none of its own");
+ assert!(preview_window(&path).expect("the file reads").is_none(), "the whole-file path keeps it");
+ let _ = std::fs::remove_dir_all(&dir);
+ }
+
+ /// A container can declare what its preview JPEG is in, and the whole-file path applies that
+ /// declaration (`decode_raw_preview`). A JPEG-only decode has the JPEG's own space, else sRGB, so
+ /// a container that declares Adobe RGB must keep the whole-file path — while one that declares
+ /// sRGB (what most bodies write) must **not** take the fast path away: that half is a regression
+ /// test, since a guard that declined every declared space did exactly that to a real Sony ARW.
+ #[test]
+ fn preview_loading_declines_only_a_container_colour_space_it_cannot_apply() {
+ use lightcraft_raw::PreviewColorSpace;
+ let (w, h) = (48u32, 32u32);
+ let rgb: Vec<u8> = (0..w * h * 3).map(|i| (i * 23 % 233) as u8).collect();
+ let img = EncodeImage::new(w, h, 3, Samples::U8(&rgb));
+ let jpeg = encode_jpeg(&img, 90, ChromaSubsampling::S420, &EncodeMeta::default()).unwrap();
+ let dir = crate::tests_xmp::temp_dir("preview-plan-space");
+ let path = dir.join("space.arw");
+ let path = path.to_string_lossy().into_owned();
+
+ let adobe = tiff_with_preview_strip(&jpeg, 400_000, Fixture { sony: true, color_space: Some(0xFFFF), ..Default::default() });
+ assert_eq!(lightcraft_raw::embedded_preview_color_space(&adobe), Some(PreviewColorSpace::AdobeRgb), "the fixture declares Adobe RGB");
+ std::fs::write(&path, &adobe).unwrap();
+ assert!(preview_window(&path).expect("the file reads").is_none(), "the whole-file path applies the space");
+
+ let srgb = tiff_with_preview_strip(&jpeg, 400_000, Fixture { sony: true, color_space: Some(1), ..Default::default() });
+ assert_eq!(lightcraft_raw::embedded_preview_color_space(&srgb), Some(PreviewColorSpace::Srgb), "the fixture declares sRGB");
+ std::fs::write(&path, &srgb).unwrap();
+ let (_, window, read) = preview_window(&path).expect("the file reads").expect("sRGB is what the JPEG-only decode assumes");
+ assert!(read.planned, "the plan still answers");
+ assert!(window.starts_with(&[0xff, 0xd8]), "and hands on the JPEG");
+ /// A JPEG with no date in its metadata (an export saved without it) takes the file's date, as
+ /// in Lightroom, instead of grouping under "Unknown Date"; a dated one keeps its capture time.
+ #[test]
+ fn undated_files_take_the_file_date() {
+ let dir = std::env::temp_dir().join(format!("lightcraft-undated-{}", std::process::id()));
+ std::fs::create_dir_all(&dir).unwrap();
+ let rgb = vec![128u8; 16 * 16 * 3];
+ let img = EncodeImage::new(16, 16, 3, Samples::U8(&rgb));
+ let jpeg = encode_jpeg(&img, 90, ChromaSubsampling::S420, &EncodeMeta::default()).unwrap();
+ let path = dir.join("export.jpg");
+ std::fs::write(&path, &jpeg).unwrap();
+ let path = path.to_string_lossy().to_string();
+ let mtime = std::fs::metadata(&path).unwrap().modified().unwrap().duration_since(std::time::UNIX_EPOCH).unwrap().as_secs();
+ let want = crate::import::civil(mtime as i64);
+ let (_, probe) = fs_hooks();
+ let info = probe(&path).unwrap();
+ assert_eq!(info.captured, None, "the file itself has no date");
+ assert_eq!(info.file_modified.as_deref(), Some(want.as_str()));
+ let mut s = crate::Session::new().with_fs();
+ let r = crate::import::import(&mut s, &[path], crate::import::ImportMode::Add).unwrap();
+ let id = lightcraft_catalog::PhotoId(r.imported[0]);
+ assert_eq!(s.catalog.photo(id).unwrap().captured.as_deref(), Some(want.as_str()));
let _ = std::fs::remove_dir_all(&dir);
}
diff --cc crates/ui-egui/locales/de-formats.json
index 2543ab681,22d707561..dff2ddb75
--- a/crates/ui-egui/locales/de-formats.json
+++ b/crates/ui-egui/locales/de-formats.json
@@@ -245,6 -245,5 +245,7 @@@
"{n} added to Apple Photos album “{album}”": "{n} zum Apple-Fotos-Album „{album}“ hinzugefügt",
"{n} added to Apple Photos": "{n} zu Apple Fotos hinzugefügt",
"{n} photos opened for editing; each is stacked with its original": "{n} Fotos zur Bearbeitung geöffnet; jedes ist mit seinem Original gestapelt",
+ "{name} opened in the other editor": "{name} im anderen Editor geöffnet",
- "{n} originals opened in the other editor": "{n} Originale im anderen Editor geöffnet"
++ "{n} originals opened in the other editor": "{n} Originale im anderen Editor geöffnet",
+ "· {in_source} identical copies": "· {in_source} identische Kopien"
}
diff --cc crates/ui-egui/locales/de.json
index b6716e83e,769cfc79f..69ca568ef
--- a/crates/ui-egui/locales/de.json
+++ b/crates/ui-egui/locales/de.json
@@@ -2114,6 -2110,5 +2114,7 @@@
"not added to Apple Photos (cancelled)": "nicht zu Apple Fotos hinzugefügt (abgebrochen)",
"The first time, macOS asks whether LightCraft may control Photos.": "Beim ersten Mal fragt macOS, ob LightCraft Fotos steuern darf.",
"Adding to Apple Photos": "Wird zu Apple Fotos hinzugefügt",
+ "No graphics processor found: LightCraft renders on the CPU, which is much slower. Details in Help → System Info.": "Kein Grafikprozessor gefunden: LightCraft rendert auf der CPU, was viel langsamer ist. Details unter Hilfe → Systeminformationen.",
- "On NixOS, start it from `nix develop`.": "Unter NixOS starten Sie es aus `nix develop`."
++ "On NixOS, start it from `nix develop`.": "Unter NixOS starten Sie es aus `nix develop`.",
+ "Files with the same content as another file in this import: only the first is imported.": "Dateien mit demselben Inhalt wie eine andere Datei dieses Imports: Nur die erste wird importiert."
}
diff --cc crates/ui-egui/locales/es-formats.json
index 76043a3f8,24b28fbaf..452fc6621
--- a/crates/ui-egui/locales/es-formats.json
+++ b/crates/ui-egui/locales/es-formats.json
@@@ -245,6 -245,5 +245,7 @@@
"{n} added to Apple Photos album “{album}”": "{n} añadidas al álbum “{album}” de Fotos de Apple",
"{n} added to Apple Photos": "{n} añadidas a Fotos de Apple",
"{n} photos opened for editing; each is stacked with its original": "{n} fotos abiertas para editar; cada una está apilada con su original",
+ "{name} opened in the other editor": "{name} abierto en el otro editor",
- "{n} originals opened in the other editor": "{n} originales abiertos en el otro editor"
++ "{n} originals opened in the other editor": "{n} originales abiertos en el otro editor",
+ "· {in_source} identical copies": "· {in_source} copias idénticas"
}
diff --cc crates/ui-egui/locales/es.json
index a0e0e7552,1e7ecd6d1..0b0ff32d5
--- a/crates/ui-egui/locales/es.json
+++ b/crates/ui-egui/locales/es.json
@@@ -1991,6 -1952,5 +1991,7 @@@
"not added to Apple Photos (cancelled)": "no se añadieron a Fotos de Apple (cancelado)",
"The first time, macOS asks whether LightCraft may control Photos.": "La primera vez, macOS pregunta si LightCraft puede controlar Fotos.",
"Adding to Apple Photos": "Añadiendo a Fotos de Apple",
+ "No graphics processor found: LightCraft renders on the CPU, which is much slower. Details in Help → System Info.": "No se encontró ningún procesador gráfico: LightCraft renderiza en la CPU, lo que es mucho más lento. Detalles en Ayuda → Información del sistema.",
- "On NixOS, start it from `nix develop`.": "En NixOS, inícielo desde `nix develop`."
++ "On NixOS, start it from `nix develop`.": "En NixOS, inícielo desde `nix develop`.",
+ "Files with the same content as another file in this import: only the first is imported.": "Archivos con el mismo contenido que otro archivo de esta importación: solo se importa el primero."
}
diff --cc crates/ui-egui/locales/fr-formats.json
index 02181d7cb,361613731..d85e837a3
--- a/crates/ui-egui/locales/fr-formats.json
+++ b/crates/ui-egui/locales/fr-formats.json
@@@ -245,6 -245,5 +245,7 @@@
"{n} added to Apple Photos album “{album}”": "{n} ajouté(s) à l'album Apple Photos « {album} »",
"{n} added to Apple Photos": "{n} ajouté(s) à Apple Photos",
"{n} photos opened for editing; each is stacked with its original": "{n} photos ouvertes pour modification ; chacune est empilée avec son original",
+ "{name} opened in the other editor": "{name} ouvert dans l’autre éditeur",
- "{n} originals opened in the other editor": "{n} originaux ouverts dans l’autre éditeur"
++ "{n} originals opened in the other editor": "{n} originaux ouverts dans l’autre éditeur",
+ "· {in_source} identical copies": "· {in_source} copies identiques"
}
diff --cc crates/ui-egui/locales/fr.json
index f872d5e6d,3676a692b..2147d4b5d
--- a/crates/ui-egui/locales/fr.json
+++ b/crates/ui-egui/locales/fr.json
@@@ -1953,6 -1952,5 +1953,7 @@@
"not added to Apple Photos (cancelled)": "non ajouté à Apple Photos (annulé)",
"The first time, macOS asks whether LightCraft may control Photos.": "La première fois, macOS demande si LightCraft peut contrôler Photos.",
"Adding to Apple Photos": "Ajout à Apple Photos",
+ "No graphics processor found: LightCraft renders on the CPU, which is much slower. Details in Help → System Info.": "Aucun processeur graphique trouvé : LightCraft effectue le rendu sur le processeur, ce qui est beaucoup plus lent. Détails dans Aide → Informations système.",
- "On NixOS, start it from `nix develop`.": "Sous NixOS, lancez-le depuis `nix develop`."
++ "On NixOS, start it from `nix develop`.": "Sous NixOS, lancez-le depuis `nix develop`.",
+ "Files with the same content as another file in this import: only the first is imported.": "Fichiers au contenu identique à un autre fichier de cette importation : seul le premier est importé."
}
diff --cc crates/ui-egui/locales/ja-formats.json
index 89f0e633b,af3a5560b..211e47e29
--- a/crates/ui-egui/locales/ja-formats.json
+++ b/crates/ui-egui/locales/ja-formats.json
@@@ -245,6 -245,5 +245,7 @@@
"{n} added to Apple Photos album “{album}”": "{n}件をAppleの写真のアルバム「{album}」に追加しました",
"{n} added to Apple Photos": "{n}件をAppleの写真に追加しました",
"{n} photos opened for editing; each is stacked with its original": "{n}枚の写真を編集用に開きました。それぞれ元の写真とスタックされています",
+ "{name} opened in the other editor": "{name}を別のエディタで開きました",
- "{n} originals opened in the other editor": "{n}個の元ファイルを別のエディタで開きました"
++ "{n} originals opened in the other editor": "{n}個の元ファイルを別のエディタで開きました",
+ "· {in_source} identical copies": "・同一のコピー {in_source} 件"
}
diff --cc crates/ui-egui/locales/ja.json
index 1f6d4d14a,0d3e6e210..0484f6dab
--- a/crates/ui-egui/locales/ja.json
+++ b/crates/ui-egui/locales/ja.json
@@@ -1957,6 -1954,5 +1957,7 @@@
"not added to Apple Photos (cancelled)": "Appleの写真には追加されませんでした(キャンセル)",
"The first time, macOS asks whether LightCraft may control Photos.": "初回は、LightCraftに写真の操作を許可するかmacOSが確認します。",
"Adding to Apple Photos": "Appleの写真に追加中",
+ "No graphics processor found: LightCraft renders on the CPU, which is much slower. Details in Help → System Info.": "グラフィックプロセッサが見つかりません。LightCraftはCPUで描画するため、かなり遅くなります。詳細は「ヘルプ → システム情報」を参照してください。",
- "On NixOS, start it from `nix develop`.": "NixOSでは `nix develop` から起動してください。"
++ "On NixOS, start it from `nix develop`.": "NixOSでは `nix develop` から起動してください。",
+ "Files with the same content as another file in this import: only the first is imported.": "この読み込み内の別のファイルと内容が同じファイルです。最初のファイルだけが読み込まれます。"
}
diff --cc crates/ui-egui/locales/pt-br-formats.json
index cae92dddb,115d7ec8b..e5f32f551
--- a/crates/ui-egui/locales/pt-br-formats.json
+++ b/crates/ui-egui/locales/pt-br-formats.json
@@@ -245,6 -245,5 +245,7 @@@
"{n} added to Apple Photos album “{album}”": "{n} adicionadas ao álbum “{album}” do Fotos da Apple",
"{n} added to Apple Photos": "{n} adicionadas ao Fotos da Apple",
"{n} photos opened for editing; each is stacked with its original": "{n} fotos abertas para edição; cada uma está empilhada com a original",
+ "{name} opened in the other editor": "{name} aberto no outro editor",
- "{n} originals opened in the other editor": "{n} originais abertos no outro editor"
++ "{n} originals opened in the other editor": "{n} originais abertos no outro editor",
+ "· {in_source} identical copies": "· {in_source} cópias idênticas"
}
diff --cc crates/ui-egui/locales/pt-br.json
index c843383c7,301475ef5..b1299a40d
--- a/crates/ui-egui/locales/pt-br.json
+++ b/crates/ui-egui/locales/pt-br.json
@@@ -1955,45 -1952,5 +1955,46 @@@
"not added to Apple Photos (cancelled)": "não adicionadas ao Fotos da Apple (cancelado)",
"The first time, macOS asks whether LightCraft may control Photos.": "Na primeira vez, o macOS pergunta se o LightCraft pode controlar o Fotos.",
"Adding to Apple Photos": "Adicionando ao Fotos da Apple",
+ "Sort Albums A–Z": "Ordenar álbuns de A a Z",
+ "Go back to listing them by name": "Voltar a listá-los por nome",
+ "Sort Contents A–Z": "Ordenar conteúdo de A a Z",
+ "Cancel Pending Photo Action": "Cancelar ação pendente da foto",
+ "Show Person": "Mostrar pessoa",
+ "Add Face Model…": "Adicionar modelo de rostos…",
+ "Cancel Face Model Download": "Cancelar download do modelo de rostos",
+ "Choose Face Recognition Model": "Escolher modelo de reconhecimento facial",
+ "Detect Faces": "Detectar rostos",
+ "Download Face Model": "Baixar modelo de rostos",
+ "Drag Crop Handle": "Arrastar alça de recorte",
+ "Evaluate Face Recognition": "Avaliar reconhecimento facial",
+ "Face Model Downloads": "Downloads de modelos de rostos",
+ "Face Models": "Modelos de rostos",
+ "Face Recognition On/Off": "Ativar/desativar reconhecimento facial",
+ "Faces of a Person": "Rostos de uma pessoa",
+ "Index Faces": "Indexar rostos",
+ "Index Faces in the Background": "Indexar rostos em segundo plano",
+ "Inspect Face Model File": "Inspecionar arquivo do modelo de rostos",
+ "Install Face Model": "Instalar modelo de rostos",
+ "Library Folders": "Pastas da biblioteca",
+ "Name Face": "Nomear rosto",
+ "Name Faces": "Nomear rostos",
+ "Remove Face Model": "Remover modelo de rostos",
+ "Reorder Album": "Reordenar álbum",
+ "Sort Albums by Name": "Ordenar álbuns por nome",
+ "Suggest Names for Faces": "Sugerir nomes para rostos",
+ "Test Face Model": "Testar modelo de rostos",
+ "Unnamed Faces": "Rostos sem nome",
+ "Faces": "Rostos",
+ "Face recognition": "Reconhecimento facial",
+ "This build has nowhere to keep face models, so the model list is not available. (The desktop app has.)": "Esta versão não tem onde guardar modelos de rostos, então a lista de modelos não está disponível. (O aplicativo para desktop tem.)",
+ "Recognise faces (experimental)": "Reconhecer rostos (experimental)",
+ "Suggests who is in a photo from the faces you have named. Everything stays on your computer.": "Sugere quem aparece em uma foto com base nos rostos que você nomeou. Tudo permanece no seu computador.",
+ "This build cannot run recognition models: they can be added and chosen, not used.": "Esta versão não consegue executar modelos de reconhecimento: eles podem ser adicionados e escolhidos, mas não usados.",
+ "Choose a model below (Use) to start.": "Escolha um modelo abaixo (Usar) para começar.",
+ "Face detector": "Detector de rostos",
+ "Detect Faces (Photo menu) needs it: a small one-time download.": "Detectar rostos (menu Foto) precisa dele: um pequeno download único.",
+ "Recognition models": "Modelos de reconhecimento",
+ "No graphics processor found: LightCraft renders on the CPU, which is much slower. Details in Help → System Info.": "Nenhum processador gráfico encontrado: o LightCraft renderiza na CPU, o que é muito mais lento. Detalhes em Ajuda → Informações do sistema.",
- "On NixOS, start it from `nix develop`.": "No NixOS, inicie-o a partir de `nix develop`."
++ "On NixOS, start it from `nix develop`.": "No NixOS, inicie-o a partir de `nix develop`.",
+ "Files with the same content as another file in this import: only the first is imported.": "Arquivos com o mesmo conteúdo de outro arquivo desta importação: apenas o primeiro é importado."
}
diff --cc crates/ui-egui/locales/ru-formats.json
index 81c568b58,c15364d78..38e28e356
--- a/crates/ui-egui/locales/ru-formats.json
+++ b/crates/ui-egui/locales/ru-formats.json
@@@ -245,6 -245,5 +245,7 @@@
"{n} added to Apple Photos album “{album}”": "Добавлено в альбом «{album}» Apple Фото: {n}",
"{n} added to Apple Photos": "Добавлено в Apple Фото: {n}",
"{n} photos opened for editing; each is stacked with its original": "Открыто для редактирования фото: {n}; каждое объединено в стопку с оригиналом",
+ "{name} opened in the other editor": "{name} открыт в другом редакторе",
- "{n} originals opened in the other editor": "Открыто оригиналов в другом редакторе: {n}"
++ "{n} originals opened in the other editor": "Открыто оригиналов в другом редакторе: {n}",
+ "· {in_source} identical copies": "· идентичных копий: {in_source}"
}
diff --cc crates/ui-egui/locales/ru.json
index 3aeb41093,02aea83d7..d171777c8
--- a/crates/ui-egui/locales/ru.json
+++ b/crates/ui-egui/locales/ru.json
@@@ -2147,6 -2144,5 +2147,7 @@@
"not added to Apple Photos (cancelled)": "не добавлено в Apple Фото (отменено)",
"The first time, macOS asks whether LightCraft may control Photos.": "В первый раз macOS спросит, может ли LightCraft управлять приложением «Фото».",
"Adding to Apple Photos": "Добавление в Apple Фото",
+ "No graphics processor found: LightCraft renders on the CPU, which is much slower. Details in Help → System Info.": "Графический процессор не найден: LightCraft выполняет рендеринг на CPU, а это намного медленнее. Подробности: Справка → Сведения о системе.",
- "On NixOS, start it from `nix develop`.": "В NixOS запускайте его из `nix develop`."
++ "On NixOS, start it from `nix develop`.": "В NixOS запускайте его из `nix develop`.",
+ "Files with the same content as another file in this import: only the first is imported.": "Файлы с тем же содержимым, что и другой файл этого импорта: импортируется только первый."
}
diff --cc crates/ui-egui/locales/uk-formats.json
index 3d7cc3ee2,a5c0e6e68..55636422f
--- a/crates/ui-egui/locales/uk-formats.json
+++ b/crates/ui-egui/locales/uk-formats.json
@@@ -245,6 -245,5 +245,7 @@@
"{n} added to Apple Photos album “{album}”": "Додано до альбому Apple Фото «{album}»: {n}",
"{n} added to Apple Photos": "Додано до Apple Фото: {n}",
"{n} photos opened for editing; each is stacked with its original": "Відкрито для редагування фото: {n}; кожне об’єднано в стос з оригіналом",
+ "{name} opened in the other editor": "{name} відкрито в іншому редакторі",
- "{n} originals opened in the other editor": "Відкрито оригіналів в іншому редакторі: {n}"
++ "{n} originals opened in the other editor": "Відкрито оригіналів в іншому редакторі: {n}",
+ "· {in_source} identical copies": "· ідентичних копій: {in_source}"
}
diff --cc crates/ui-egui/locales/uk.json
index d640ae334,a50ad26e2..3c66577b8
--- a/crates/ui-egui/locales/uk.json
+++ b/crates/ui-egui/locales/uk.json
@@@ -2147,6 -2146,5 +2147,7 @@@
"not added to Apple Photos (cancelled)": "не додано до Apple Фото (скасовано)",
"The first time, macOS asks whether LightCraft may control Photos.": "Першого разу macOS запитає, чи може LightCraft керувати програмою «Фото».",
"Adding to Apple Photos": "Додавання до Apple Фото",
+ "No graphics processor found: LightCraft renders on the CPU, which is much slower. Details in Help → System Info.": "Графічний процесор не знайдено: LightCraft виконує рендеринг на ЦП, а це набагато повільніше. Докладніше: Довідка → Інформація про систему.",
- "On NixOS, start it from `nix develop`.": "У NixOS запускайте його з `nix develop`."
++ "On NixOS, start it from `nix develop`.": "У NixOS запускайте його з `nix develop`.",
+ "Files with the same content as another file in this import: only the first is imported.": "Файли з тим самим вмістом, що й інший файл цього імпорту: імпортується лише перший."
}
diff --cc crates/ui-egui/locales/zh-hans-formats.json
index 9868f6697,87741a934..782f8d731
--- a/crates/ui-egui/locales/zh-hans-formats.json
+++ b/crates/ui-egui/locales/zh-hans-formats.json
@@@ -245,6 -245,5 +245,7 @@@
"{n} added to Apple Photos album “{album}”": "已将 {n} 个添加到 Apple 照片相册“{album}”",
"{n} added to Apple Photos": "已将 {n} 个添加到 Apple 照片",
"{n} photos opened for editing; each is stacked with its original": "已打开 {n} 张照片进行编辑;每张都与其原片堆叠在一起",
+ "{name} opened in the other editor": "已在其他编辑器中打开 {name}",
- "{n} originals opened in the other editor": "已在其他编辑器中打开 {n} 个原始文件"
++ "{n} originals opened in the other editor": "已在其他编辑器中打开 {n} 个原始文件",
+ "· {in_source} identical copies": "· {in_source} 个相同副本"
}
diff --cc crates/ui-egui/locales/zh-hans.json
index 8d16fea24,5fa024d57..2dae9129d
--- a/crates/ui-egui/locales/zh-hans.json
+++ b/crates/ui-egui/locales/zh-hans.json
@@@ -1993,6 -1990,5 +1993,7 @@@
"not added to Apple Photos (cancelled)": "未添加到 Apple 照片(已取消)",
"The first time, macOS asks whether LightCraft may control Photos.": "首次使用时,macOS 会询问是否允许 LightCraft 控制“照片”。",
"Adding to Apple Photos": "正在添加到 Apple 照片",
+ "No graphics processor found: LightCraft renders on the CPU, which is much slower. Details in Help → System Info.": "未找到图形处理器:LightCraft 改用 CPU 渲染,速度会慢很多。详情见“帮助 → 系统信息”。",
- "On NixOS, start it from `nix develop`.": "在 NixOS 上,请从 `nix develop` 启动。"
++ "On NixOS, start it from `nix develop`.": "在 NixOS 上,请从 `nix develop` 启动。",
+ "Files with the same content as another file in this import: only the first is imported.": "与本次导入中另一个文件内容相同的文件:只导入第一个。"
}
diff --cc crates/ui-egui/locales/zh-hant-formats.json
index 131f0495e,0cca3a08d..56db559c6
--- a/crates/ui-egui/locales/zh-hant-formats.json
+++ b/crates/ui-egui/locales/zh-hant-formats.json
@@@ -245,6 -245,5 +245,7 @@@
"{n} added to Apple Photos album “{album}”": "已將 {n} 個加入 Apple 照片相簿「{album}」",
"{n} added to Apple Photos": "已將 {n} 個加入 Apple 照片",
"{n} photos opened for editing; each is stacked with its original": "已開啟 {n} 張相片進行編輯;每張都與其原始相片堆疊在一起",
+ "{name} opened in the other editor": "已在其他編輯器中開啟 {name}",
- "{n} originals opened in the other editor": "已在其他編輯器中開啟 {n} 個原始檔案"
++ "{n} originals opened in the other editor": "已在其他編輯器中開啟 {n} 個原始檔案",
+ "· {in_source} identical copies": "· {in_source} 個相同副本"
}
diff --cc crates/ui-egui/locales/zh-hant.json
index 42f28b073,615abf87a..fc580c904
--- a/crates/ui-egui/locales/zh-hant.json
+++ b/crates/ui-egui/locales/zh-hant.json
@@@ -1955,6 -1952,5 +1955,7 @@@
"not added to Apple Photos (cancelled)": "未加入 Apple 照片(已取消)",
"The first time, macOS asks whether LightCraft may control Photos.": "第一次使用時,macOS 會詢問是否允許 LightCraft 控制「照片」。",
"Adding to Apple Photos": "正在加入 Apple 照片",
+ "No graphics processor found: LightCraft renders on the CPU, which is much slower. Details in Help → System Info.": "找不到圖形處理器:LightCraft 改用 CPU 算繪,速度會慢很多。詳情請見「說明 → 系統資訊」。",
- "On NixOS, start it from `nix develop`.": "在 NixOS 上,請從 `nix develop` 啟動。"
++ "On NixOS, start it from `nix develop`.": "在 NixOS 上,請從 `nix develop` 啟動。",
+ "Files with the same content as another file in this import: only the first is imported.": "與本次匯入中另一個檔案內容相同的檔案:只匯入第一個。"
}
diff --cc docs/parity-checklist.md
index 4332eebcc,5e38cf127..fa57f06d0
--- a/docs/parity-checklist.md
+++ b/docs/parity-checklist.md
@@@ -699,10 -684,10 +699,12 @@@ From `08-lightroom-classic-extras.md` (
| LRC-LIB-IMPORT | Full import dialog | P1 | ✅ | `cmd:library.import` (`mode`, `destination`, `organize`, `rename`, `metadataPreset`, `preset`, `keywords`, `album`), `crates/ui-egui/src/import.rs` | review grid with duplicates skipped; add in place or copy (library Originals or any folder; by day / by month / one folder / custom folder template such as `{date:%Y}/{date:%Y%m%d}` → 2026/20260114, kept inside the destination; example destination shown; rename template with live example, Tags picker (insert at cursor) and unknown-tag warning, numbered across the import); develop preset, metadata preset, keywords, album on import |
| LRC-LIB-AUTOIMPORT | Watched-folder import | P2 | ✅ | `cmd:library.autoImport` | see LR-IMP-AUTO |
| LRC-LIB-TETHER | Tethered capture | P2 | ⬜ | | |
+| LRC-LIB-VIEWS | Grid / loupe / compare / survey / people | P1 | 🟡 | `cmd:view.photoGrid`, `cmd:view.squareGrid`, `cmd:view.detail`, `cmd:view.compare`, `cmd:view.survey`, `cmd:view.gridInfo` | grid, square grid, loupe, compare, survey, second window; square-grid captions: file name, exposure or capture date (View ▸ Grid Info); no people view |
+| LRC-LIB-COMPARE | Compare view | P1 | ✅ | `cmd:view.compare` | ⇧C (C is Crop here); swap, make select; a filmstrip click replaces the active side; zoom always linked; each pane says “Rendering…” or that the photo can't be opened, as the loupe does (see LR-VIEW-COMPARE) |
+ | LRC-LIB-VIEWS | Grid / loupe / compare / survey / people | P1 | 🟡 | `cmd:view.photoGrid`, `cmd:view.squareGrid`, `cmd:view.detail`, `cmd:view.compare`, `cmd:view.survey`, `cmd:view.gridInfo` | grid, square grid, loupe, compare, survey, second window; square-grid captions: file name, exposure or capture date (View ▸ Grid Info; picking one in Photo Grid switches to Square Grid); no people view |
+ | LRC-LIB-COMPARE | Compare view | P1 | ✅ | `cmd:view.compare` | ⇧C (C is Crop here); swap, make select; a filmstrip click replaces the active side; zoom always linked |
| LRC-LIB-SURVEY | Survey view | P2 | ✅ | `cmd:view.survey` | N |
-| LRC-LIB-REFVIEW | Reference view | P2 | ✅ | `cmd:view.reference`, `cmd:photo.setReference`, `crates/ui-egui/src/panels/compare.rs` (`show_reference`) | View ▸ Reference View (⇧R): the reference photo beside the active one (edited with the Edit panel); photo menu ▸ Set as Reference Photo |
+| LRC-LIB-REFVIEW | Reference view | P2 | ✅ | `cmd:view.reference`, `cmd:photo.setReference`, `crates/ui-egui/src/panels/compare.rs` (`show_reference`) | View ▸ Reference View (⇧R): the reference photo beside the active one (edited with the Edit panel); photo menu ▸ Set as Reference Photo; each pane says “Rendering…” (widget `compare:rendering:<pane>`) or “This photo can't be opened” (`compare:renderFailed:<pane>`) as the loupe does |
| LRC-LIB-CATALOG-PANEL | Catalog sets | P1 | ✅ | `cmd:library.source` (`missing`) | all, recently added, picks, recently deleted, missing photos (when any) |
| LRC-LIB-CATALOG-IMPORT | Native Lightroom Classic catalog import | P1 | 🟡 | `cmd:library.inspectLightroom`, `cmd:library.importLightroom`, `crates/engine/src/lightroom_catalog.rs`, `docs/lightroom-catalog-import.md` | read-only `.lrcat` plus committed WAL pages, in-tree read-only Rust SQLite B-tree reader; background inspection/import with progress/cancellation, per-open library identity checks; originals in place, ratings/flags/labels, XMP, hierarchical keywords, collection sets/regular collections, virtual copies, mapped develop settings; stable reimport identities, undo, missing-file placeholders, a root folder not found at its recorded path looked up relative to the catalog (Lightroom's `relativePathFromCatalog`, so a project folder copied from another computer stays linked; reported as a warning), existing edits preserved. Best-effort deduplicated recovery archives retain settings/history/snapshots/collection rules (32 MiB each, eight archives/128 MiB aggregate); archive limits/write failures and optional-table limits warn without blocking photo import; unrelated unsupported tables and opaque SQL BLOBs skipped. Custom white balance on relative-WB raws (`RAW` in Lightroom's terms) stays As Shot and is reported, since the catalog keeps no as-shot white to shift from (issue #510). Adobe rendering, AI data and native history replay remain incomplete; no writes to Lightroom catalogs. Open Library given a Lightroom catalog folder, an `.lrdata` / `.lrcat-data` folder or the `.lrcat` makes no library there and offers this import with the catalog found (`cmd:app.openLibrary`, `crates/engine/src/lightroom_folder.rs`; issue #891) |
| LRC-LIB-CATALOG-LOCK | Catalog open in one program at a time | P1 | ✅ | `cmd:app.openLibrary`, `crates/catalog/src/lock.rs`, `crates/engine/src/library.rs` (`open_library`) | exclusive OS lock on `catalog.lock` for the session (app and `lightcraft-cli --library`); a second opener is refused with who has it (`catalog.lock.owner`: program, process, computer); released by the OS on a crash, so never stale; file systems without locks open unprotected with a warning (the app's notices, `library.info` → `settingsWarnings`, and the CLI's stderr; issue #171); no read-only mode; the browser build (OPFS) has no guard across tabs yet. A library that can't be opened at launch (locked, unreadable, newer format, drive missing) shows a window — Try Again, Choose Another Library…, Continue Without Saving (then a banner; nothing written), Quit — instead of a silent demo session (`crates/ui-egui/src/panels/library_problem.rs`); the lock is released explicitly when the library closes, not by letting its file handle close, so a program another thread is starting at that moment (which holds a copy of every file handle until it is launched) cannot keep the library "already open" for a moment (issue #680) |