Fix alpha left and right
This commit is contained in:
parent
5429f63227
commit
77e981ff6f
1 changed files with 2 additions and 2 deletions
|
|
@ -149,9 +149,9 @@ fn reduced_alpha_to_left(png: &PngImage, bpc: usize, bpp: usize) -> Vec<u8> {
|
||||||
line_bytes.resize(line_bytes.len() + bpc, 0);
|
line_bytes.resize(line_bytes.len() + bpc, 0);
|
||||||
} else {
|
} else {
|
||||||
line_bytes.extend_from_slice(pixel);
|
line_bytes.extend_from_slice(pixel);
|
||||||
}
|
|
||||||
last_pixel = pixel.to_owned();
|
last_pixel = pixel.to_owned();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
reduced.push(line.filter);
|
reduced.push(line.filter);
|
||||||
reduced.extend(line_bytes.chunks(bpp).rev().flatten());
|
reduced.extend(line_bytes.chunks(bpp).rev().flatten());
|
||||||
}
|
}
|
||||||
|
|
@ -169,10 +169,10 @@ fn reduced_alpha_to_right(png: &PngImage, bpc: usize, bpp: usize) -> Vec<u8> {
|
||||||
reduced.resize(reduced.len() + bpc, 0);
|
reduced.resize(reduced.len() + bpc, 0);
|
||||||
} else {
|
} else {
|
||||||
reduced.extend_from_slice(pixel);
|
reduced.extend_from_slice(pixel);
|
||||||
}
|
|
||||||
last_pixel = pixel.to_owned();
|
last_pixel = pixel.to_owned();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
reduced
|
reduced
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue