Skip to content

Commit

Permalink
feat: add exif orientation to PhotoMeta
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbchron committed Mar 11, 2024
1 parent b5a8c35 commit 45a3fb2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions crates/bl/src/upload/exif_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ pub fn photo_meta_from_exif(input: Option<Exif>) -> core_types::PhotoMeta {
}
}

// extract orientation
meta.orientation = orientation_from_exif(Some(&exif));

// extract gps
// this isn't implemented yet

Expand Down
8 changes: 5 additions & 3 deletions crates/core_types/src/photo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ pub struct Photo {
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PhotoMeta {
/// The date and time the photo was taken.
pub date_time: Option<chrono::NaiveDateTime>,
pub date_time: Option<chrono::NaiveDateTime>,
/// The GPS coordinates where the photo was taken.
pub gps: Option<(f64, f64)>,
pub gps: Option<(f64, f64)>,
/// The original orientation of the photo (uses EXIF orientations).
pub orientation: Option<u32>,
/// Extra EXIF data.
pub extra: HashMap<String, String>,
pub extra: HashMap<String, String>,
}

/// The artifacts for a photo. Not a table.
Expand Down

0 comments on commit 45a3fb2

Please sign in to comment.