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 metadata. 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.
18 lines
490 B
Nix
18 lines
490 B
Nix
{ pkgs ? import <nixpkgs> {}, lib ? pkgs.lib }:
|
|
|
|
pkgs.rustPlatform.buildRustPackage {
|
|
pname = "picobak";
|
|
version = "0.1.0";
|
|
src = lib.cleanSource ./.;
|
|
cargoHash = "sha256-W0SLjlrqONMdTXoOlMilEvza2WEIVaKUJRraGR//qsw=";
|
|
meta = {
|
|
description = "Backup and organize your pictures library";
|
|
};
|
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
|
# Inject exiftool
|
|
postInstall = ''
|
|
wrapProgram $out/bin/picobak \
|
|
--prefix PATH : "${lib.makeBinPath [pkgs.exiftool]}"
|
|
'';
|
|
}
|