Skip to content

Commit

Permalink
chore: improve error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikachu2333 committed Aug 23, 2024
1 parent b626fdc commit ca2a00e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/operations/resize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,9 @@ impl OperationsTrait for Resize {

fn execute_impl(&self, image: &mut Image) -> Result<(), ImageErrors> {
let (src_width, src_height) = image.dimensions();
let (mut dst_width, mut dst_height) = self.new_dimensions;
if dst_height == 0 {
dst_height = 100;
}
if dst_width == 0 {
dst_width = 100;
let (dst_width, dst_height) = self.new_dimensions;
if (dst_height == 0) || (dst_width == 0) {
return Err(ImageErrors::GenericStr("Error for 0 as Height or Width."));
}

let depth = image.depth().bit_type();
Expand Down

0 comments on commit ca2a00e

Please sign in to comment.