From 945a02d1e1d7b45701e5a331ca22db630bc0bb5e Mon Sep 17 00:00:00 2001 From: Jonathan Behrens Date: Sun, 4 Sep 2022 12:46:11 -0700 Subject: [PATCH] Format --- src/decoder/image.rs | 4 +++- src/encoder/mod.rs | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/decoder/image.rs b/src/decoder/image.rs index 61952a4..544ec7b 100644 --- a/src/decoder/image.rs +++ b/src/decoder/image.rs @@ -98,7 +98,9 @@ impl Image { let width = tag_reader.require_tag(Tag::ImageWidth)?.into_u32()?; let height = tag_reader.require_tag(Tag::ImageLength)?.into_u32()?; if width == 0 || height == 0 { - return Err(TiffError::FormatError(TiffFormatError::InconsistentSizesEncountered)); + return Err(TiffError::FormatError( + TiffFormatError::InconsistentSizesEncountered, + )); } let photometric_interpretation = tag_reader diff --git a/src/encoder/mod.rs b/src/encoder/mod.rs index db6fa75..3547596 100644 --- a/src/encoder/mod.rs +++ b/src/encoder/mod.rs @@ -12,7 +12,8 @@ use std::{ use crate::{ error::TiffResult, - tags::{CompressionMethod, ResolutionUnit, Tag}, TiffError, TiffFormatError, + tags::{CompressionMethod, ResolutionUnit, Tag}, + TiffError, TiffFormatError, }; pub mod colortype; @@ -350,7 +351,9 @@ impl<'a, W: 'a + Write + Seek, T: ColorType, K: TiffKind, D: Compression> compression: D, ) -> TiffResult { if width == 0 || height == 0 { - return Err(TiffError::FormatError(TiffFormatError::InconsistentSizesEncountered)); + return Err(TiffError::FormatError( + TiffFormatError::InconsistentSizesEncountered, + )); } let row_samples = u64::from(width) * u64::try_from(::BITS_PER_SAMPLE.len())?;