diff options
author | cc <cc@localhost> | 2025-08-20 17:28:35 -0700 |
---|---|---|
committer | cc <cc@localhost> | 2025-08-20 17:28:42 -0700 |
commit | b248c22d0d69643f33f779c65882f1158ed8f959 (patch) | |
tree | 976d6c2c2c4c735a1ae7380fbf93360b53071077 /src/lib.rs | |
parent | e38b77ca4a0bef6e5ae0a28d445929e9af2ddd05 (diff) |
Data Strip Information
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 49 |
1 files changed, 49 insertions, 0 deletions
@@ -50,4 +50,53 @@ mod tests { assert!(false); } } + + #[test] + fn tiff_strip_count() { + tiff::ignore_warnings(); + if let Some(t_handle) = tiff::open("../test.tif") { + let strip_count = tiff::get_strip_count(t_handle); + assert!(strip_count > 0); + println!("{:?}", strip_count); + tiff::close(t_handle); + } else { + assert!(false); + } + } + + #[test] + fn tiff_data_depth() { + tiff::ignore_warnings(); + if let Some(t_handle) = tiff::open("../test.tif") { + let strip_size = tiff::get_strip_size(t_handle); + let strip_count = tiff::get_strip_count(t_handle); + let strip_depth = strip_size * strip_count; + assert!(strip_depth > 0); + println!("{:?}", strip_depth); + let image_width = tiff::get_width(t_handle); + let image_height = tiff::get_height(t_handle); + let image_depth = image_width * image_height; + assert!(image_depth > 0); + println!("{:?}", image_depth); + let strip_depth = strip_depth as f64; + let image_depth = image_depth as f64; + println!("{:?}", strip_depth / image_depth); + tiff::close(t_handle); + } else { + assert!(false); + } + } + + #[test] + fn tiff_strip_size() { + tiff::ignore_warnings(); + if let Some(t_handle) = tiff::open("../test.tif") { + let strip_size = tiff::get_strip_size(t_handle); + assert!(strip_size > 0); + println!("{:?}", strip_size); + tiff::close(t_handle); + } else { + assert!(false); + } + } } |