-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ regex = "1.10" | |
chrono = "0.4.34" | ||
filetime = "0.2" | ||
kamadak-exif = "0.5.5" | ||
little_exif = "0.4.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
use chrono::{DateTime, Utc}; | ||
use little_exif::exif_tag::ExifTag; | ||
use little_exif::metadata::Metadata; | ||
use std::path::Path; | ||
|
||
pub fn write_tag(path: &Path, dateTag: DateTime<Utc>) -> Result<(), String> { | ||
return Ok(()); | ||
pub fn write_tag(path: &Path, date_tag: DateTime<Utc>) -> Result<(), String> { | ||
let mut metadata = match Metadata::new_from_path(path) { | ||
Ok(metadata) => metadata, | ||
Err(e) => return Err(e.to_string()), | ||
}; | ||
|
||
metadata.set_tag(ExifTag::CreateDate(date_tag.to_string())); | ||
match metadata.write_to_file(path) { | ||
Ok(_) => Ok(()), | ||
Err(e) => return Err(e.to_string()), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,6 @@ impl FromIterator<DirEntry> for Stats { | |
} | ||
}; | ||
} | ||
|
||
s | ||
} | ||
} |