()
| 31 | } |
| 32 | |
| 33 | fn main() { |
| 34 | julia(); |
| 35 | for fname in std::env::args().skip(1) { |
| 36 | let src_path = PathBuf::from(&fname); |
| 37 | let mut thumb_path = PathBuf::from(&fname); |
| 38 | thumb_path.set_extension("thumbnail.jpg"); |
| 39 | if src_path != thumb_path { |
| 40 | let src_img = image::open(&src_path).expect("Can't open input image."); |
| 41 | let src_img = image::imageops::resize(&src_img, 128, 128, FilterType::CatmullRom); |
| 42 | src_img |
| 43 | .save_with_format(&thumb_path, ImageFormat::Jpeg) |
| 44 | .unwrap(); |
| 45 | } |
| 46 | } |
| 47 | } |