Skip to main content

make_face_thumb

Function make_face_thumb 

Source
pub fn make_face_thumb(
    path: &str,
    bbox: [f32; 4],
    oriented: bool,
    face_id: i64,
) -> Option<DynamicImage>
Expand description

Load, crop, and orientation-correct a face thumbnail.

oriented mirrors faces.oriented and says which canvas the bbox is in:

  • true: the row was detected on the display canvas (every row written since the decode became orientation-correct). Decode upright, then crop.
  • false (every row written before the fix): the bbox is in the raw sensor canvas, so crop the raw decode first, then rotate the small square crop. Equivalent to the pre-fix behavior.

bbox coordinates are stored in terms of the full-size decoded image (videre faces rescales detections back to original width/height before writing to the DB), so the thumbnail must be cropped from an image of the same dimensions used at detection time.

For HEIC: videre faces converts via QuickLook (see videre_core::heic::heic_via_quicklook), which already applies correct rotation, so no separate orientation step is needed.

pub: the static-page base64 thumbnail path (face_thumb_b64 in render) also needs this exact crop+orientation logic, so it calls through here instead of keeping its own duplicate copy.