From d2776dddba835a58027cdde2b95112084cda9e81 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 14 Nov 2026 23:29:44 +0000 Subject: [PATCH] style: format streamed PNG size check --- crates/engine/src/cmd/fileio/load.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/cmd/fileio/load.rs b/crates/engine/src/cmd/fileio/load.rs index b1f294d313..0833739aa1 100644 --- a/crates/engine/src/cmd/fileio/load.rs +++ b/crates/engine/src/cmd/fileio/load.rs @@ -852,11 +852,8 @@ pub(crate) fn too_large_note(bytes: &[u8]) -> Option { // The renderer can stream a non-interlaced PNG a row at a time when those buffers fit. Its // full decoded byte count can exceed the allowance even though drawing it at native size is // safe; use the renderer's decision for that case instead of warning from total_bytes alone. - let png_streams_at_size = samples_over - && format == Some(image::ImageFormat::Png) - && vectorcraft_render::reduced_size(bytes) == Some((w, h)); - (rgba_over || (samples_over && !png_streams_at_size)) - .then(|| format!("an image of {w} × {h} pixels is too large to draw")) + let png_streams_at_size = samples_over && format == Some(image::ImageFormat::Png) && vectorcraft_render::reduced_size(bytes) == Some((w, h)); + (rgba_over || (samples_over && !png_streams_at_size)).then(|| format!("an image of {w} × {h} pixels is too large to draw")) } /// What Open, Place and the Links panel say of encoded image `bytes` that [`too_large_note`] is