diff --git a/phosta.pl b/phosta.pl

index ed6244b78bf1d0de0aa8439d90fd56b8934183e9..f5a97345f04d6e62a759311a3fc6c4f2fd55604e 100755

--- a/phosta.pl

+++ b/phosta.pl

@@ -49,7 +49,7 @@ my ($destination_dir) = @_;

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 @@ my $emptycount = 0;

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)