MCPcopy Create free account
hub / github.com/bedroombuilds/python2rust / main

Function main

24_raster_graphics/rust/thumbnail/src/main.rs:33–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31}
32
33fn 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}

Callers

nothing calls this directly

Calls 1

juliaFunction · 0.70

Tested by

no test coverage detected