mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
fix(svg): cast channel count for pixel budget arithmetic
This commit is contained in:
1 parent
6f46fcfc4a
commit
92647dd6ff
1 file changed
+1
-1
@@ -331,7 +331,7 @@ impl Conv {
|
||||
}
|
||||
|
||||
fn charge_pixels(&mut self, w: usize, h: usize) -> bool {
|
||||
let bytes = (w as u64).saturating_mul(h as u64).saturating_mul(u64::from(self.fmt.channels()) * 4);
|
||||
let bytes = (w as u64).saturating_mul(h as u64).saturating_mul(self.fmt.channels() as u64 * 4);
|
||||
match self.pixel_budget.checked_sub(bytes) {
|
||||
Some(remaining) => {
|
||||
self.pixel_budget = remaining;
|
||||
|
||||
Reference in new issue
Block a user