You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
thumbnailer/tests/video_reading.rs

22 lines
505 B
Rust

use mime::Mime;
use std::io::Cursor;
use std::str::FromStr;
use thumbnailer::{create_thumbnails, ThumbnailSize};
const VIDEO_BYTES: &'static [u8] = include_bytes!("assets/test.mp4");
#[test]
fn it_creates_thumbnails_for_mp4() {
let reader = Cursor::new(VIDEO_BYTES);
create_thumbnails(
reader,
Mime::from_str("video/mp4").unwrap(),
[
ThumbnailSize::Small,
ThumbnailSize::Medium,
ThumbnailSize::Large,
],
)
.unwrap();
}