feature/exif-endpoint #44
@@ -216,6 +216,8 @@ fn parse_exif_datetime(field: &exif::Field) -> Option<i64> {
|
|||||||
use chrono::NaiveDateTime;
|
use chrono::NaiveDateTime;
|
||||||
|
|
||||||
// EXIF datetime format: "YYYY:MM:DD HH:MM:SS"
|
// EXIF datetime format: "YYYY:MM:DD HH:MM:SS"
|
||||||
|
// Note: EXIF dates are local time without timezone info
|
||||||
|
// We return the timestamp as if it were UTC, and the client will display it as-is
|
||||||
NaiveDateTime::parse_from_str(&datetime_str, "%Y:%m:%d %H:%M:%S")
|
NaiveDateTime::parse_from_str(&datetime_str, "%Y:%m:%d %H:%M:%S")
|
||||||
.ok()
|
.ok()
|
||||||
.map(|dt| dt.and_utc().timestamp())
|
.map(|dt| dt.and_utc().timestamp())
|
||||||
@@ -224,11 +226,7 @@ fn parse_exif_datetime(field: &exif::Field) -> Option<i64> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn extract_gps_coordinate(
|
fn extract_gps_coordinate(exif: &exif::Exif, coord_tag: Tag, ref_tag: Tag) -> Option<f64> {
|
||||||
exif: &exif::Exif,
|
|
||||||
coord_tag: Tag,
|
|
||||||
ref_tag: Tag,
|
|
||||||
) -> Option<f64> {
|
|
||||||
let coord_field = exif.get_field(coord_tag, In::PRIMARY)?;
|
let coord_field = exif.get_field(coord_tag, In::PRIMARY)?;
|
||||||
let ref_field = exif.get_field(ref_tag, In::PRIMARY)?;
|
let ref_field = exif.get_field(ref_tag, In::PRIMARY)?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user