Skip to content

Commit

Permalink
Add test for gray_i8_roundtrip
Browse files Browse the repository at this point in the history
Check that an SBYTE (int8) image can be read and written to properly. The minisblack-1c-i8b.tiff image was created using the command `gdal_translate -ot Int8 -co PIXELTYPE=SIGNEDBYTE -scale 0 255 \-128 128 tests/images/minisblack-1c-8b.tiff tests/images/minisblack-1c-i8b.tiff`.
  • Loading branch information
weiji14 committed Jun 2, 2024
1 parent c566021 commit bfb8112
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/encode_images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ macro_rules! test_roundtrip {
}

test_roundtrip!(test_u8_roundtrip, U8, u8);
test_roundtrip!(test_i8_roundtrip, I8, i8);
test_roundtrip!(test_u16_roundtrip, U16, u16);
test_roundtrip!(test_i16_roundtrip, I16, i16);
test_roundtrip!(test_u32_roundtrip, U32, u32);
Expand All @@ -200,6 +201,11 @@ fn test_gray_u8_roundtrip() {
test_u8_roundtrip::<colortype::Gray8>("minisblack-1c-8b.tiff", ColorType::Gray(8));
}

#[test]
fn test_gray_i8_roundtrip() {
test_i8_roundtrip::<colortype::GrayI8>("minisblack-1c-i8b.tiff", ColorType::Gray(8));
}

#[test]
fn test_rgb_u8_roundtrip() {
test_u8_roundtrip::<colortype::RGB8>("rgb-3c-8b.tiff", ColorType::RGB(8));
Expand Down
Binary file added tests/images/minisblack-1c-i8b.tiff
Binary file not shown.

0 comments on commit bfb8112

Please sign in to comment.