### Basic Camera Capture and Download Source: https://github.com/maxicarlos08/gphoto2-rs/blob/main/README.md This example demonstrates capturing an image from a camera and downloading it to the local filesystem. Ensure libgphoto2 is installed and a camera is connected. ```rust use gphoto2::{Context, Result}; use std::path::Path; fn main() -> Result<()> { // Create a new context and detect the first camera from it let camera = Context::new()?.autodetect_camera().wait().expect("Failed to autodetect camera"); let camera_fs = camera.fs(); // And take pictures let file_path = camera.capture_image().wait().expect("Could not capture image"); camera_fs.download_to(&file_path.folder(), &file_path.name(), Path::new(&file_path.name().to_string())).wait()?; // For more advanced examples take a look at the examples/ folder Ok(()) } ``` -------------------------------- ### Install libgphoto2 on Debian Source: https://github.com/maxicarlos08/gphoto2-rs/blob/main/README.md Install the libgphoto2 development library on Debian-based systems using apt. ```shell sudo apt install libgphoto2-dev ``` -------------------------------- ### Install libgphoto2 on macOS Source: https://github.com/maxicarlos08/gphoto2-rs/blob/main/README.md Install the libgphoto2 development library on macOS using Homebrew. ```shell homebrew install libgphoto2 ``` -------------------------------- ### Install libgphoto2 on Windows with MSYS2 Source: https://github.com/maxicarlos08/gphoto2-rs/blob/main/README.md Install the libgphoto2 development library on Windows using MSYS2. Refer to the provided package link for details. ```shell mingw-w64-x86_64-libgphoto2 ``` -------------------------------- ### Install libgphoto2 on Arch Linux Source: https://github.com/maxicarlos08/gphoto2-rs/blob/main/README.md Install the libgphoto2 development library on Arch Linux systems using pacman. ```shell sudo pacman -S libgphoto2 ``` -------------------------------- ### Add gphoto2 to Cargo.toml Source: https://github.com/maxicarlos08/gphoto2-rs/blob/main/README.md Add the gphoto2 crate to your project's dependencies by including it in your Cargo.toml file. ```toml [dependencies] gphoto2 = "3.3" ``` -------------------------------- ### Run Tests with 'test' Feature Source: https://github.com/maxicarlos08/gphoto2-rs/blob/main/README.md Enable the 'test' feature when running cargo tests to build a stripped-down version of libgphoto2 suitable for testing. Do not use this feature in production. ```shell cargo test -F test ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.