diff --git a/src/img.rs b/src/img.rs index 581898a..28e83e9 100644 --- a/src/img.rs +++ b/src/img.rs @@ -35,9 +35,9 @@ pub fn crop_image(buff: &[u8]) -> Vec> { let cropped_img = img.crop(start_x, start_y, PART_SIZE, PART_SIZE); let mut buffer = Cursor::new(Vec::new()); - cropped_img - .write_to(&mut buffer, IMAGE_FORMAT) - .unwrap(); + + cropped_img.write_to(&mut buffer, IMAGE_FORMAT).unwrap(); + let buffer = buffer.into_inner(); results.push(buffer) }