Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Integration: pin Overprint's PSD read/write, translate its label (#6002)

David Mann2f002a4545be
diff --git a/crates/io/src/effects_map.rs b/crates/io/src/effects_map.rs
index 5ee999635..88748b645 100644
--- a/crates/io/src/effects_map.rs
+++ b/crates/io/src/effects_map.rs
@@ -752,6 +752,29 @@ mod tests {
assert!(matches!(back.last().unwrap(), Effect::Stroke(_)));
}
+ #[test]
+ fn stroke_overprint_is_read_and_written() {
+ for overprint in [false, true] {
+ let fx = [Effect::Stroke(StrokeFx {
+ common: FxCommon::new(BlendMode::Normal, 1.0),
+ size: 3.0,
+ position: StrokePosition::Outside,
+ paint: FxPaint::Color(Color::BLACK),
+ overprint,
+ })];
+ let (_, back) = parse_lfx2(&write_lfx2(false, &fx)).unwrap();
+ let [Effect::Stroke(s)] = back.as_slice() else { panic!("{back:?}") };
+ assert_eq!(s.overprint, overprint);
+ }
+ // A stroke without the key (other writers) has Overprint off.
+ let d = Descriptor::new("null").with("FrFX", Value::Descriptor(Descriptor::new("FrFX").with("enab", Value::Boolean(true))));
+ let mut data = 0u32.to_be_bytes().to_vec();
+ data.extend(VersionedDescriptor::new(d).to_bytes());
+ let (_, back) = parse_lfx2(&data).unwrap();
+ let [Effect::Stroke(s)] = back.as_slice() else { panic!("{back:?}") };
+ assert!(!s.overprint);
+ }
+
#[test]
fn lfx2_ignores_absent_effects_but_keeps_disabled_configured_effects() {
let d = Descriptor::new("null")
diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv
index 6789b7513..efd12bfbf 100644
--- a/crates/ui-egui/src/i18n/cs.tsv
+++ b/crates/ui-egui/src/i18n/cs.tsv
@@ -334,6 +334,7 @@
Blending Options… Možnosti prolnutí…
Bevel & Emboss… Úkos a reliéf…
Use Global Light Použít globální světlo
+ Overprint Přetisk
Inner Shadow… Vnitřní stín…
Inner Glow… Vnitřní záře…
Satin… Satén…
diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv
index 3aa7e7212..d3ad35a83 100644
--- a/crates/ui-egui/src/i18n/de.tsv
+++ b/crates/ui-egui/src/i18n/de.tsv
@@ -333,6 +333,7 @@
Blending Options… Fusionsoptionen…
Bevel & Emboss… Abgeflachte Kante & Relief…
Use Global Light Globales Licht verwenden
+ Overprint Überdrucken
Inner Shadow… Innerer Schatten…
Inner Glow… Schein nach innen…
Satin… Satin…
diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv
index 7b653fbbf..b44fdda3f 100644
--- a/crates/ui-egui/src/i18n/el.tsv
+++ b/crates/ui-egui/src/i18n/el.tsv
@@ -1819,6 +1819,7 @@
Blending Options… Επιλογές ανάμειξης…
Bevel & Emboss… Λοξότμηση και ανάγλυφο…
Use Global Light Χρήση καθολικού φωτισμού
+ Overprint Υπερεκτύπωση
Inner Shadow… Εσωτερική σκιά…
Inner Glow… Εσωτερική λάμψη…
Satin… Σατινέ…
diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv
index eab6215df..74b48017d 100644
--- a/crates/ui-egui/src/i18n/es.tsv
+++ b/crates/ui-egui/src/i18n/es.tsv
@@ -330,6 +330,7 @@
Blending Options… Opciones de fusión…
Bevel & Emboss… Bisel y relieve…
Use Global Light Usar luz global
+ Overprint Sobreimprimir
Inner Shadow… Sombra interior…
Inner Glow… Resplandor interior…
Satin… Satinado…
diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv
index 80c7f110f..483e63e9e 100644
--- a/crates/ui-egui/src/i18n/fr.tsv
+++ b/crates/ui-egui/src/i18n/fr.tsv
@@ -2651,6 +2651,7 @@
32 bit (float) 32 bits (flottant)
Floating point Virgule flottante
Use Global Light Utiliser la lumière globale
+ Overprint Surimpression
Native file drag-and-drop is unavailable Le glisser-déposer natif de fichiers n'est pas disponible
Native file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. Le glisser-déposer natif de fichiers n'est pas encore pris en charge sous Wayland. Utilisez Fichier › Ouvrir, ou copiez l'image dans votre gestionnaire de fichiers et collez-la avec {paste}.
To drop files, start PhotoCraft under XWayland: `{command}` Pour déposer des fichiers, lancez PhotoCraft sous XWayland : `{command}`
diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv
index ca747637c..8fc6f67ac 100644
--- a/crates/ui-egui/src/i18n/hu.tsv
+++ b/crates/ui-egui/src/i18n/hu.tsv
@@ -1609,6 +1609,7 @@ fontWeight Thin Hajszálvékony
Overlay Átfedés
Overlay Color Átfedés színe
Overlay Opacity Átfedés átlátszatlansága
+ Overprint Felülnyomás
Paint over hair or fur on the image; Alt paints the other mode Fesd át a hajat vagy a szőrzetet a képen; Alt lenyomásával a másik módban festesz
Pass Through Áteresztés
Pattern Overlay Mintázatfedés
diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv
index 4fd06fd88..2f9199d7e 100644
--- a/crates/ui-egui/src/i18n/id.tsv
+++ b/crates/ui-egui/src/i18n/id.tsv
@@ -2640,6 +2640,7 @@
32 bit (float) 32 bit (titik mengambang)
Floating point Titik mengambang
Use Global Light Gunakan Cahaya Global
+ Overprint Cetak Tindih
Native file drag-and-drop is unavailable Seret dan lepas berkas native tidak tersedia
Native file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. Seret dan lepas berkas native belum didukung di Wayland. Gunakan Berkas › Buka, atau salin gambar di pengelola berkas lalu tempel dengan {paste}.
To drop files, start PhotoCraft under XWayland: `{command}` Untuk menjatuhkan berkas, jalankan PhotoCraft di XWayland: `{command}`
diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv
index 1143b138f..315d1cd89 100644
--- a/crates/ui-egui/src/i18n/it.tsv
+++ b/crates/ui-egui/src/i18n/it.tsv
@@ -327,6 +327,7 @@
Blending Options… Opzioni di fusione…
Bevel & Emboss… Smusso e rilievo…
Use Global Light Usa luce globale
+ Overprint Sovrastampa
Inner Shadow… Ombra interna…
Inner Glow… Bagliore interno…
Satin… Raso…
diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv
index 8564b9b30..0b000037a 100644
--- a/crates/ui-egui/src/i18n/ja.tsv
+++ b/crates/ui-egui/src/i18n/ja.tsv
@@ -328,6 +328,7 @@
Blending Options… レイヤー効果…
Bevel & Emboss… ベベルとエンボス…
Use Global Light グローバルライトを使用
+ Overprint オーバープリント
Inner Shadow… シャドウ (内側)…
Inner Glow… 光彩 (内側)…
Satin… サテン…
diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv
index b99fde823..5d6c86447 100644
--- a/crates/ui-egui/src/i18n/ko.tsv
+++ b/crates/ui-egui/src/i18n/ko.tsv
@@ -2185,6 +2185,7 @@
32 bit (float) 32비트(부동 소수점)
Floating point 부동 소수점
Use Global Light 전체 조명 사용
+ Overprint 중복 인쇄
Native file drag-and-drop is unavailable 파일 드래그 앤 드롭을 사용할 수 없습니다
Native file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. Wayland에서는 아직 파일 드래그 앤 드롭을 지원하지 않습니다. 파일 › 열기를 사용하거나, 파일 관리자에서 이미지를 복사한 뒤 {paste}(으)로 붙여넣으세요.
To drop files, start PhotoCraft under XWayland: `{command}` 파일을 끌어다 놓으려면 XWayland에서 PhotoCraft를 실행하세요: `{command}`
diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv
index 791d173cb..46b68224a 100644
--- a/crates/ui-egui/src/i18n/nl.tsv
+++ b/crates/ui-egui/src/i18n/nl.tsv
@@ -319,6 +319,7 @@
Blending Options… Overvloeiopties…
Bevel & Emboss… Schuine kant en reliëf…
Use Global Light Globaal licht gebruiken
+ Overprint Overdrukken
Inner Shadow… Binnenschaduw…
Inner Glow… Gloed binnen…
Satin… Satijn…
diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv
index 23e253d62..ae0dba6b4 100644
--- a/crates/ui-egui/src/i18n/pl.tsv
+++ b/crates/ui-egui/src/i18n/pl.tsv
@@ -326,6 +326,7 @@
Blending Options… Opcje mieszania…
Bevel & Emboss… Ukos i płaskorzeźba…
Use Global Light Użyj światła globalnego
+ Overprint Nadrukowywanie
Inner Shadow… Cień wewnętrzny…
Inner Glow… Poświata wewnętrzna…
Satin… Satyna…
diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv
index 327533ad8..bf2a18f86 100644
--- a/crates/ui-egui/src/i18n/pt-br.tsv
+++ b/crates/ui-egui/src/i18n/pt-br.tsv
@@ -2643,6 +2643,7 @@
32 bit (float) 32 bits (flutuante)
Floating point Ponto flutuante
Use Global Light Usar luz global
+ Overprint Superimposição
Native file drag-and-drop is unavailable Arrastar e soltar arquivos não está disponível
Native file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. O recurso nativo de arrastar e soltar arquivos ainda não funciona no Wayland. Use Arquivo › Abrir ou copie a imagem no gerenciador de arquivos e cole-a com {paste}.
To drop files, start PhotoCraft under XWayland: `{command}` Para soltar arquivos, execute o PhotoCraft no XWayland: `{command}`
diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv
index 6b2e36845..c018f4515 100644
--- a/crates/ui-egui/src/i18n/ru.tsv
+++ b/crates/ui-egui/src/i18n/ru.tsv
@@ -247,6 +247,7 @@
Inner Glow… Внутреннее свечение…
Bevel & Emboss… Тиснение…
Use Global Light Использовать глобальный свет
+ Overprint Наложение
Satin… Глянец…
Color Overlay… Наложение цвета…
Gradient Overlay… Наложение градиента…
diff --git a/crates/ui-egui/src/i18n/sr.tsv b/crates/ui-egui/src/i18n/sr.tsv
index 5530f81ce..77759d625 100644
--- a/crates/ui-egui/src/i18n/sr.tsv
+++ b/crates/ui-egui/src/i18n/sr.tsv
@@ -2629,6 +2629,7 @@
32 bit (float) 32 bita (pokretni zarez)
Floating point Pokretni zarez
Use Global Light Koristi globalno svetlo
+ Overprint Pretisak
Native file drag-and-drop is unavailable Izvorno prevlačenje i otpuštanje datoteka nije dostupno
Native file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. Izvorno prevlačenje i otpuštanje datoteka još nije podržano na Wayland-u. Koristite Datoteka › Otvori ili kopirajte sliku u menadžeru datoteka i nalepite je pomoću {paste}.
To drop files, start PhotoCraft under XWayland: `{command}` Da biste otpuštali datoteke, pokrenite PhotoCraft pod XWayland-om: `{command}`
diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv
index 2e6f96a0e..012e46182 100644
--- a/crates/ui-egui/src/i18n/tr.tsv
+++ b/crates/ui-egui/src/i18n/tr.tsv
@@ -310,6 +310,7 @@
Blending Options… Karışım Seçenekleri…
Bevel & Emboss… Eğim ve Kabartma…
Use Global Light Global Light'ı kullanın
+ Overprint Üst Baskı
Inner Shadow… İç Gölge…
Inner Glow… İç Işıma…
Satin… Saten…
diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv
index 5280372ca..d19ab747d 100644
--- a/crates/ui-egui/src/i18n/uk.tsv
+++ b/crates/ui-egui/src/i18n/uk.tsv
@@ -234,6 +234,7 @@
Inner Glow… Внутрішнє світіння…
Bevel & Emboss… Фаска та рельєф…
Use Global Light Використовувати глобальне освітлення
+ Overprint Накладання
Satin… Атлас…
Color Overlay… Накладання кольору…
Gradient Overlay… Накладання градієнта…
diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv
index 8f8e1c344..9d485b075 100644
--- a/crates/ui-egui/src/i18n/vi.tsv
+++ b/crates/ui-egui/src/i18n/vi.tsv
@@ -1904,6 +1904,7 @@ document Orientation Hướng trang
Preview Xem trước
Blend Mode Chế độ hòa trộn
Use Global Light Dùng ánh sáng chung
+ Overprint In chồng
Distance Khoảng cách
Spread Lan rộng
Choke Thu hẹp
diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv
index 5efbe2899..c8770321c 100644
--- a/crates/ui-egui/src/i18n/zh-hans.tsv
+++ b/crates/ui-egui/src/i18n/zh-hans.tsv
@@ -333,6 +333,7 @@
Blending Options… 混合选项…
Bevel & Emboss… 斜面和浮雕…
Use Global Light 使用全局光
+ Overprint 叠印
Inner Shadow… 内阴影…
Inner Glow… 内发光…
Satin… 光泽…
diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv
index ea0af7945..8f3a15b4c 100644
--- a/crates/ui-egui/src/i18n/zh-hant.tsv
+++ b/crates/ui-egui/src/i18n/zh-hant.tsv
@@ -338,6 +338,7 @@
Blending Options… 混合選項…
Bevel & Emboss… 斜角和浮雕…
Use Global Light 使用全域光
+ Overprint 疊印
Inner Shadow… 內陰影…
Inner Glow… 內光暈…
Satin… 緞面…