when i write dadblogs i include a lot of pics of the kids. i do a lot of side-by-side images where i take two similar or related pictures and put em together to fill the space on the page better. it's tedious and time consuming, so i decided enough is enough
whipped together a small utility called "image_gallery" in rust to do it for me. this is going to save me so much time, the most tedious part, honestly.
let canvas_height = min(img1.height(), img2.height());
let img1 = img1.resize(img1.width(), canvas_height, FilterType::Lanczos3);
let img2 = img2.resize(img2.width(), canvas_height, FilterType::Lanczos3);
canvas = DynamicImage::new(img1.width() + img2.width() + args.margin, canvas_height, img1.color());
canvas.copy_from(&img1, 0, 0).unwrap();
canvas.copy_from(&img2, img1.width() + args.margin, 0).unwrap();
// Only resize the width. Don't constrain by height.
canvas = canvas.resize(args.width, u32::MAX, FilterType::Lanczos3);
canvas.save("output.jpg").unwrap();