Skip to content

Commit

Permalink
CinemaDngReader: add support for reading files with missing FPS
Browse files Browse the repository at this point in the history
  • Loading branch information
anuejn committed Mar 11, 2024
1 parent 7f5f88c commit 6840f12
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/nodes_io/reader_cinema_dng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@ impl ProcessingNode for CinemaDngReader {
bit_depth: get_tag_as_u32(tags::ifd::BitsPerSample)?,
fps: dng
.get_entry_by_path(&main_ifd.chain_tag(tags::ifd::FrameRate))
.ok_or(anyhow!("couldnt read frame rate of DNG {path:?}"))?
.value
.as_f64()
.ok_or(anyhow!("couldnt interpret frame rate of DNG {path:?} as f64"))?,
.map(|entry| entry.value.as_f64().ok_or(anyhow!("couldnt interpret frame rate of DNG {path:?} as f64")))
.unwrap_or_else(|| {
eprintln!("DNG has no fps, falling back to 24");
Ok(24.0)
})?,
cfa,
};

Expand Down

0 comments on commit 6840f12

Please sign in to comment.