summaryrefslogtreecommitdiff
path: root/src/tiff.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tiff.rs')
-rw-r--r--src/tiff.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tiff.rs b/src/tiff.rs
index f23e978..11755b6 100644
--- a/src/tiff.rs
+++ b/src/tiff.rs
@@ -178,11 +178,11 @@ pub fn as_standard_format(tiff_file_name: &str) -> Option<Vec<u32>> {
let width_opt = get_image_width(tiff);
let height_opt = get_image_height(tiff);
let channels = get_image_channels(tiff);
- if width_opt == None {
+ if (width_opt == None) || (height_opt == None) {
return None;
}
- if height_opt == None {
- return None;
+ if (channels == 0) || (channels > 4) {
+ return None
}
let width = width_opt.expect("Width Prechecked");
let height = height_opt.expect("Height Prechecked");