use 5 digits since we have a 5G file with 46372 frames

This commit is contained in:
Alon Levy 2023-12-31 01:25:08 +02:00
parent 5f5834835c
commit 6af9b21be1

View File

@ -249,12 +249,12 @@ fn decode(filename: &str) -> PyResult<PyFrameIterator> {
pub fn decode_to_files(filename: &str, frames_root: &str) -> anyhow::Result<()> { pub fn decode_to_files(filename: &str, frames_root: &str) -> anyhow::Result<()> {
let frameiter = Decoder::new(filename)?; let frameiter = Decoder::new(filename)?;
for (i, frame) in frameiter.enumerate() { for (i, frame) in frameiter.enumerate() {
let name = format!("{}/{:04}.png", frames_root, i); let name = format!("{}/{:05}.png", frames_root, i);
if let Err(_e) = write_raw_frame(&name, &frame.raw) { if let Err(_e) = write_raw_frame(&name, &frame.raw) {
println!("skipping bad frame {}", i); println!("skipping bad frame {}", i);
continue; continue;
} }
let name = format!("{}/temp_{:04}.png", frames_root, i); let name = format!("{}/temp_{:05}.png", frames_root, i);
let pixels = frame.pixels(); let pixels = frame.pixels();
write_calibrated_frame(&name, &pixels)?; write_calibrated_frame(&name, &pixels)?;
} }