Debian Codegraph @

tests/decode_bigtiff_images.rs

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 extern crate tiff;
2
3 use tiff::decoder::Decoder;
4 use tiff::tags::Tag;
5 use tiff::ColorType;
6
7 use std::fs::File;
8 use std::path::PathBuf;
9
10 const TEST_IMAGE_DIR: &str = "./tests/images/bigtiff";
11
12 #[test]
•13 #[ignore = "skipping, missing test data"]
14 fn test_big_tiff() {
15 let filenames = ["BigTIFF.tif", "BigTIFFMotorola.tif", "BigTIFFLong.tif"];
16 for filename in filenames.iter() {
17 let path = PathBuf::from(TEST_IMAGE_DIR).join(filename);
18 let img_file = File::open(path).expect("Cannot find test image!");
19 let mut decoder = Decoder::new(img_file).expect("Cannot create decoder");
20 assert_eq!(
21 decoder.dimensions().expect("Cannot get dimensions"),
22 (64, 64)
23 );
24 assert_eq!(
25 decoder.colortype().expect("Cannot get colortype"),
26 ColorType::RGB(8)
27 );
28 assert_eq!(
29 decoder
30 .get_tag_u64(Tag::StripOffsets)
31 .expect("Cannot get StripOffsets"),
32 16
33 );
34 assert_eq!(
35 decoder
36 .get_tag_u64(Tag::RowsPerStrip)
37 .expect("Cannot get RowsPerStrip"),
38 64
39 );
40 assert_eq!(
41 decoder
42 .get_tag_u64(Tag::StripByteCounts)
43 .expect("Cannot get StripByteCounts"),
44 12288
45 )
46 }
47 }