1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
use openexr_sys as sys;
use Path;
/// Struct representing information about the type of an OpenEXR file.
///
/// Get information about the type of OpenEXR file at path `filename`.
///
/// If the file cannot be opened, or is not an OpenEXR file, `None` is returned.
///
// FIXME: re-enable this when we figure out why it's failing
/*
#[cfg(test)]
#[test]
pub fn test_test_file() {
use std::path::PathBuf;
let path = PathBuf::from(
std::env::var("CARGO_MANIFEST_DIR")
.expect("CARGO_MANIFEST_DIR not set"),
)
.join("images")
.join("ferris.exr");
let info = is_openexr_file(path).unwrap();
assert_eq!(info.is_deep, false);
assert_eq!(info.is_tiled, false);
assert_eq!(info.is_multi_part, false);
let path = PathBuf::from(
std::env::var("CARGO_MANIFEST_DIR")
.expect("CARGO_MANIFEST_DIR not set"),
)
.join("images")
.join("ferris-multipart.exr");
let info = is_openexr_file(path).unwrap();
assert_eq!(info.is_deep, false);
assert_eq!(info.is_tiled, false);
assert_eq!(info.is_multi_part, true);
let path_cyl = PathBuf::from(
std::env::var("CARGO_MANIFEST_DIR")
.expect("CARGO_MANIFEST_DIR not set"),
)
.join("images")
.join("deep_plane.exr");
let info = is_openexr_file(path_cyl).unwrap();
assert_eq!(info.is_deep, true);
assert_eq!(info.is_tiled, false);
assert_eq!(info.is_multi_part, false);
let path = PathBuf::from(
std::env::var("CARGO_MANIFEST_DIR")
.expect("CARGO_MANIFEST_DIR not set"),
)
.join("images")
.join("DOES_NOT_EXIST");
assert!(is_openexr_file(path).is_none());
let path = PathBuf::from(
std::env::var("CARGO_MANIFEST_DIR")
.expect("CARGO_MANIFEST_DIR not set"),
)
.join("images")
.join("ferris.png");
assert!(is_openexr_file(path).is_none());
}
*/