Alpha to trns tests

This commit is contained in:
Andrew 2022-12-12 21:35:18 +13:00 committed by Josh Holmer
parent 0a1f737533
commit b176e5cd91
5 changed files with 48 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

View file

@ -130,6 +130,30 @@ fn rgba_8_should_be_rgb_8() {
);
}
#[test]
fn rgba_16_should_be_rgb_trns_16() {
test_it_converts(
"tests/files/rgba_16_should_be_rgb_trns_16.png",
true,
ColorType::RGBA,
BitDepth::Sixteen,
ColorType::RGB,
BitDepth::Sixteen,
);
}
#[test]
fn rgba_8_should_be_rgb_trns_8() {
test_it_converts(
"tests/files/rgba_8_should_be_rgb_trns_8.png",
true,
ColorType::RGBA,
BitDepth::Eight,
ColorType::RGB,
BitDepth::Eight,
);
}
#[test]
fn rgba_16_should_be_palette_8() {
test_it_converts(
@ -694,6 +718,30 @@ fn grayscale_8_should_be_grayscale_8() {
);
}
#[test]
fn grayscale_alpha_16_should_be_grayscale_trns_16() {
test_it_converts(
"tests/files/grayscale_alpha_16_should_be_grayscale_trns_16.png",
true,
ColorType::GrayscaleAlpha,
BitDepth::Sixteen,
ColorType::Grayscale,
BitDepth::Sixteen,
);
}
#[test]
fn grayscale_alpha_8_should_be_grayscale_trns_8() {
test_it_converts(
"tests/files/grayscale_alpha_8_should_be_grayscale_trns_8.png",
true,
ColorType::GrayscaleAlpha,
BitDepth::Eight,
ColorType::Grayscale,
BitDepth::Eight,
);
}
#[test]
fn small_files() {
let input = PathBuf::from("tests/files/small_files.png");