photo-stats

statistics processor for the terminal
git clone https://git.clttr.info/photo-stats.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 9f54e3c4809f1859df929b930f1889552eb3ec13
parent 8ca3d878c8103c1bb0c66b46fc1b192585700e3b
Author: René Wagner <rwagner@rw-net.de>
Date:   Wed, 29 Jul 2020 17:05:54 +0200

fix create time formatting

Diffstat:
Mphosta.pl | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/phosta.pl b/phosta.pl @@ -49,7 +49,7 @@ sub get_stats say "Scanning $destination_dir for files..."; - my $cmd = "exiftool -r -m -f -p '\$filepath##\$make##\$model##\$lens##\$lensmodel##\$focallength##\$focallengthin35mmformat##\$aperture##\$exposuretime##\$iso##\$flash##\$datetimeoriginal##\$createdate' -d \"%Y-%m-%d %H:%M:%S\" -ext jpg " . $destination_dir; + my $cmd = "exiftool -r -m -f -p '\$filepath##\$make##\$model##\$lens##\$lensmodel##\$focallength##\$focallengthin35mmformat##\$aperture##\$exposuretime##\$iso##\$flash##\$datetimeoriginal' -d \"%Y-%m-%d %H:%M:%S\" -ext jpg " . $destination_dir; my @lines = qx($cmd); my $dbh = DBI->connect($dsn, $userid, $password, { RaiseError => 1 }) @@ -60,11 +60,10 @@ sub get_stats foreach (@lines) { chomp $_; - my ( $file, $maker, $model, $lens, $lensmodel, $fl, $fl35, $apert, $exposuretime, $iso, $flash, $datetimeoriginal, $createdate ) = split(/#/, $_); + my ($file, $maker, $model, $lens, $lensmodel, $fl, $fl35, $apert, $exposuretime, $iso, $flash, $datetimeoriginal) = split(/#/, $_); if ($model eq '-') { $emptycount++; next; } $lens = ($lens ne '-') ? $lens : $lensmodel; - if ($datetimeoriginal eq '0000:00:00 00:00:00') { $datetimeoriginal = $createdate; } $exposuretime = (looks_like_number($exposuretime) && $exposuretime < 1) ? "1/". POSIX::lround(1/$exposuretime) : $exposuretime; my $stmt = "INSERT INTO photos (file, maker, model, lens, focallength, focallength35mm, aperture, shutterspeed, iso, flash, datetimeoriginal)