Commit Graph

12 Commits

Author SHA1 Message Date
Félix Baylac Jacqué cb40dda7e9 Use exiftool to parse more metadata when needed
While the EXIF crate is pretty good when it comes to parse JPEG and
PNG metadata, it does not support non-exif metadata such as MOV

I'd like to organise my videos like my pictures. I did not find a
Rust-native swiss army knife library. So I sadly decided to shell out
metadata parsing to the exiftool program if the exif crate does not
manage to parse the picture metadata.

Despite its name, this program can parse a wide range of picture/video
shooting metadata outside of EXIF. That's really good.

If for some reason exiftool fails to parse the file creation time, we
fallback to the unix file datetime.
2023-09-17 12:09:03 +02:00
Félix Baylac Jacqué d3b7bea53b Readme: rewrite example usage 2023-08-26 13:00:51 +02:00
Félix Baylac Jacqué 28bcd319f3 Readme: add demo, remove warning 2023-08-26 12:46:17 +02:00
Félix Baylac Jacqué 162486191c Add Nix derivation 2023-08-25 23:15:10 +02:00
Félix Baylac Jacqué ee9d8972e0 Duplicates warning display: show source and target file 2023-08-25 22:59:59 +02:00
Félix Baylac Jacqué 785d8ea4cf Improve backup statistics display 2023-08-25 22:09:25 +02:00
Félix Baylac Jacqué 9c767e4938 Backup multiple files on the same invocation
Concurently backing up the files pointed by stdin. Instead of having
to spin up a whole picobak process for each and every picture we want
to back up, we create a single process in charge of backing up the
files using all cores. This massively improves the backup speed.

We use rayon to concurently process the pictures.
2023-08-25 21:41:24 +02:00
Félix Baylac Jacqué 156a0b0814 Refactoring: extract processing logic out of main 2023-08-24 19:55:55 +02:00
Félix Baylac Jacqué 2cf564f1c4 Refactoring: simplify exif/mtime logic
Refactor the exif parsing/mtime parsing logic to have two clear
2023-08-24 18:19:28 +02:00
Félix Baylac Jacqué cec77e8766 Fallback to mtime when no EXIF available
We add some logic to read the file mtime and fallback using that when
there's not enough informations in the EXIF container.
2023-08-24 16:18:35 +02:00
Félix Baylac Jacqué c713e3d5a1 First semi-naive and dirty implementation
We adopt a semi-naive approach. Probably not the best performing and
most robust solution, but at least we have something functional.

We rely on a external scheduler, such as GNU parallel, to concurently
copy the files and use as much cores as possible. It makes the program
composable with the GNU userspace toolchain.

It however comes at a cost: we have to spin-up/tear-down a process for
each file. Scheduling the copy from inside the Rust program by
creating multiple threads (using rayon?) would be likely much more
performant. We'll probably come to it in the future.

The error handling also left to be desired. We're panicking with a
error message every time we encounter something unexpected.

The program is also untested. Might eat your kitten for now.
2023-08-24 13:09:51 +02:00
Félix Baylac Jacqué 456bac2e98 Init 2023-08-24 10:51:58 +02:00