Skip to content

Commit

Permalink
Save single light images in subfolder
Browse files Browse the repository at this point in the history
Closes #93
  • Loading branch information
krzmaz authored and mrozycki committed Dec 8, 2022
1 parent d49b72b commit 1543ed6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions configurator/src/capture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl Capturer {
let mut coords = Vec::new();
let timestamp = chrono::offset::Local::now().format("%FT%X");
let dir = format!("captures/{}", timestamp);
std::fs::create_dir_all(dir.as_str())?;
std::fs::create_dir_all(dir.as_str().to_owned() + "/img")?;

let pb = ProgressBar::new(self.number_of_lights as u64)
.with_style(
Expand Down Expand Up @@ -129,7 +129,7 @@ impl Capturer {
if found_coords.confident() {
led_picture.mark(found_coords.inner.0, found_coords.inner.1)?;
}
let filename = format!("{}/{:03}.jpg", dir, i);
let filename = format!("{}/img/{:03}.jpg", dir, i);
led_picture.save_to_file(filename.as_str())?;
}
coords.push(found_coords);
Expand Down

0 comments on commit 1543ed6

Please sign in to comment.