(image: &DynamicImage, size: u32)
| 107 | } |
| 108 | |
| 109 | pub fn encode_thumbnail(image: &DynamicImage, size: u32) -> Result<Vec<u8>> { |
| 110 | let thumbnail = image.thumbnail(size, size); |
| 111 | let mut buffer = std::io::Cursor::new(Vec::new()); |
| 112 | thumbnail.write_to(&mut buffer, ImageFormat::Png)?; |
| 113 | Ok(buffer.into_inner()) |
| 114 | } |
| 115 | |
| 116 | pub fn collect_image_files(dir: &Path, recursive: bool) -> Result<Vec<PathBuf>> { |
| 117 | let mut files = Vec::new(); |
no outgoing calls
no test coverage detected