From c559f1c9002dc077b70c1d8435ed8fb814539e76 Mon Sep 17 00:00:00 2001 From: Maciej Malinowski <231036771+webglobecontact-ui@users.noreply.github.com> Date: Sun, 18 Oct 2026 01:12:57 +0200 Subject: [PATCH 1/3] Contributors: add Maciej Malinowski --- contributors/people.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contributors/people.toml b/contributors/people.toml index e86ee8a01a1..e55cd0f8924 100644 --- a/contributors/people.toml +++ b/contributors/people.toml @@ -358,3 +358,6 @@ sync_github_name = true [people.MMexicann] display_name = "mexicann" + +[people.webglobepl] +real_name = "Maciej Malinowski" From 4033c515a7b4e3bd206488c689a71414998859b7 Mon Sep 17 00:00:00 2001 From: "WebGlobe.pl" Date: Thu, 19 Nov 2026 10:20:44 +0100 Subject: [PATCH 2/3] Export As: test that a panorama previews without transparent bands Since #15449 the dialog is craft-libs' Export As, whose preview paints the transparency checkerboard under the picture only, so a wide export no longer shows checkered bands above and below it. This test keeps it that way on PhotoCraft's side: the texture the dialog shows has the export's proportions (2172 x 724 previews at 3:1), and an opaque image previews fully opaque, with no transparent padding a square preview would add. --- .../src/dialogs/export_dialog/tests.rs | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/crates/ui-egui/src/dialogs/export_dialog/tests.rs b/crates/ui-egui/src/dialogs/export_dialog/tests.rs index 7adebfc1113..599fd127cf8 100644 --- a/crates/ui-egui/src/dialogs/export_dialog/tests.rs +++ b/crates/ui-egui/src/dialogs/export_dialog/tests.rs @@ -1099,3 +1099,29 @@ fn profile_and_metadata_follow_the_existing_exporter() { assert!(kept.windows(b"secret".len()).any(|w| w == b"secret")); assert_eq!(doc, before); } + +/// A panorama's preview is the exported picture alone: the texture Export As shows has the export's +/// proportions, and an opaque image previews opaque. A preview padded to a square would read as +/// transparent bands above and below a wide image, as if the exported file had them. +#[test] +fn a_panorama_previews_at_its_own_proportions_with_no_transparent_bands() { + let mut h = harness(export_app(2172, 724)); + super::open(h.state_mut()).unwrap(); + settle_preview(&mut h); + let [w, h_px] = h.state().export_open.as_ref().expect("Export As is open").texture.as_ref().expect("the preview is shown").size(); + assert!(w > h_px, "the preview is wider than tall: {w} × {h_px}"); + let ratio = w as f64 / h_px as f64; + assert!((ratio - 3.0).abs() < 0.02, "the preview keeps 2172 × 724's proportions: {w} × {h_px}"); + + let doc = Document::with_background( + "panorama", + photocraft_doc::Size::new(2172, 724), + photocraft_doc::ColorMode::Rgb, + photocraft_doc::SampleType::U8, + photocraft_doc::Color::WHITE, + ); + let f = Map::from_iter([("format".into(), json!("jpg")), ("scale".into(), json!(100))]); + let pixels = super::preview_pixels(&default_preview_proxy(&doc, &f).unwrap(), None); + assert_eq!(pixels.rgba.len(), pixels.width * pixels.height * 4); + assert!(pixels.rgba.chunks_exact(4).all(|px| px[3] == 255), "every preview pixel of an opaque image is opaque"); +} From 992002a2baf9f103d2f4517c5de973d5365b373f Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Wed, 2 Dec 2026 13:40:41 +0700 Subject: [PATCH 3/3] Use as_chunks in the opaque preview assertion The newer clippy flags chunks_exact with a constant size (chunks_exact_to_as_chunks) in export_dialog/tests.rs; the assertion is unchanged. --- crates/ui-egui/src/dialogs/export_dialog/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/dialogs/export_dialog/tests.rs b/crates/ui-egui/src/dialogs/export_dialog/tests.rs index 599fd127cf8..20efb9feb2e 100644 --- a/crates/ui-egui/src/dialogs/export_dialog/tests.rs +++ b/crates/ui-egui/src/dialogs/export_dialog/tests.rs @@ -1123,5 +1123,5 @@ fn a_panorama_previews_at_its_own_proportions_with_no_transparent_bands() { let f = Map::from_iter([("format".into(), json!("jpg")), ("scale".into(), json!(100))]); let pixels = super::preview_pixels(&default_preview_proxy(&doc, &f).unwrap(), None); assert_eq!(pixels.rgba.len(), pixels.width * pixels.height * 4); - assert!(pixels.rgba.chunks_exact(4).all(|px| px[3] == 255), "every preview pixel of an opaque image is opaque"); + assert!(pixels.rgba.as_chunks::<4>().0.iter().all(|px| px[3] == 255), "every preview pixel of an opaque image is opaque"); }