mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-03 06:31:42 +01:00
AF.3: compare image sizes as the unsigned values they are
Clippy (-D warnings) flagged an always-false comparison and a no-op cast in the Affinity image resampler after Rect::width became u32. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01GQPh8UDgMyARR5Hat9UchC
This commit is contained in:
1 parent
ef870103f8
commit
508fafd92d
1 file changed
+2
-2
@@ -535,10 +535,10 @@ impl Builder {
|
||||
let format = if channels == 1 { PixelFormat::GRAY8 } else { self.format };
|
||||
let mut out = if channels == 1 { Surface::with_default(format, &[0.0]) } else { Surface::new(format) };
|
||||
let r = self.bbox(m, af::Rect { x0: 0.0, y0: 0.0, x1: f64::from(w), y1: f64::from(h) });
|
||||
if r.width() <= 0 || r.height() <= 0 {
|
||||
if r.width() == 0 || r.height() == 0 {
|
||||
return Some(out);
|
||||
}
|
||||
if u64::from(r.width() as u32) * u64::from(r.height() as u32) > MAX_PIXELS {
|
||||
if u64::from(r.width()) * u64::from(r.height()) > MAX_PIXELS {
|
||||
self.warn("images larger than 64 megapixels on the canvas were left out");
|
||||
return None;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user