Skip to content

Commit

Permalink
test: test recoding RGBA image
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Apr 23, 2024
1 parent 7ea05cb commit 43fc55e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,28 @@ mod tests {
.unwrap();
}

/// Tests that RGBA PNG can be recoded into JPEG
/// by dropping alpha channel.
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_recode_image_rgba_png_to_jpeg() {
let bytes = include_bytes!("../test-data/image/screenshot-rgba.png");

send_image_check_mediaquality(
Viewtype::Image,
Some("1"),
bytes,
"png",
false, // no Exif
1920,
1080,
0,
constants::WORSE_IMAGE_SIZE,
constants::WORSE_IMAGE_SIZE * 1080 / 1920,
)
.await
.unwrap();
}

#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_recode_image_huge_jpg() {
let bytes = include_bytes!("../test-data/image/screenshot.jpg");
Expand Down

0 comments on commit 43fc55e

Please sign in to comment.