Skip to main content

Module camera

Module camera 

Source
Expand description

What the camera wrote down: body, lens, exposure, when and where.

Read with kamadak-exif, which iced already brings into the tree for its own orientation handling — so the inspector’s Camera and Location sections cost this crate a dependency line and no new download.

§Never an error

Like measure’s orientation, a missing or damaged EXIF block is Camera::default, not a failure. Screenshots, exported PNGs and pictures that went through a messenger have none, and a panel that says nothing about a camera is right for all of them. What is written survives damage elsewhere: the reader is told to carry on past a bad IFD and keep whatever parsed.

§Split in two

read is the only part that touches a file. Everything a person sees — “Fujifilm X-T5”, “1/500 · f/2 · ISO 160”, “38.7139° N” — is a pure function over Camera, because the formatting is where the mistakes are (a shutter of 0.3s is not “1/3”, a make in capitals is not a brand) and a test should be able to reach it without a JPEG.

Structs§

Camera
The EXIF a person cares about, as plain values.
Location
Where, in signed decimal degrees: north and east positive.
Taken
DateTimeOriginal, unzoned.

Functions§

aperture
f/2, f/1.4, f/5.6 — one decimal, and none when it is whole.
read
Reads the EXIF of path. Blocking file I/O; call it off the UI thread. Never fails — see the module doc.
shutter
A shutter speed the way a camera’s own screen shows it: a fraction under a second (1/500), seconds from there up (0.3s, 2s).