diff --git a/src/io/geotiff.rs b/src/io/geotiff.rs index 95f615c..a7b6528 100644 --- a/src/io/geotiff.rs +++ b/src/io/geotiff.rs @@ -11,7 +11,7 @@ pub fn read_geotiff(stream: R) -> Result, TiffError> decoder = decoder.with_limits(Limits::unlimited()); // Get image dimensions - let (height, width): (u32, u32) = decoder.dimensions()?; + let (width, height): (u32, u32) = decoder.dimensions()?; // Get image pixel data let DecodingResult::F32(img_data) = decoder.read_image()? else { @@ -49,16 +49,16 @@ mod tests { let mut file = tempfile().unwrap(); let mut bigtiff = TiffEncoder::new_big(&mut file).unwrap(); bigtiff - .write_image::(20, 10, &image_data) + .write_image::(10, 20, &image_data) // width, height, data .unwrap(); file.seek(SeekFrom::Start(0)).unwrap(); // Read a BigTIFF file let arr = read_geotiff(file).unwrap(); assert_eq!(arr.ndim(), 2); - assert_eq!(arr.dim(), (20, 10)); // (height, width) - assert_eq!(arr.nrows(), 20); // y-axis - assert_eq!(arr.ncols(), 10); // x-axis + assert_eq!(arr.dim(), (20, 10)); // (height, width) + assert_eq!(arr.nrows(), 20); // y-axis + assert_eq!(arr.ncols(), 10); // x-axis assert_eq!(arr.mean(), Some(14.0)); } }