]> git.sesse.net Git - pr0n/blobdiff - perl/Sesse/pr0n/Common.pm
Yet more flash tweaks.
[pr0n] / perl / Sesse / pr0n / Common.pm
index d03f46f1f01a01a10b656bb0efeb53aeb1adfb6e..8fe17d738f7b9300dda864abe45e6de6bd17a0ea 100644 (file)
@@ -192,7 +192,7 @@ sub update_width_height {
 
        # update the last_picture cache as well (this should of course be done
        # via a trigger, but this is less complicated :-) )
-       $dbh->do('UPDATE last_picture_cache SET last_picture=GREATEST(last_picture, ?) FROM images WHERE event=events.id) WHERE id=(SELECT event FROM images WHERE id=?)',
+       $dbh->do('UPDATE last_picture_cache SET last_picture=GREATEST(last_picture, ?) WHERE event=(SELECT event FROM images WHERE id=?)',
                undef, $datetime, $id)
                or die "Couldn't update last_picture in SQL: $!";
 }
@@ -288,7 +288,6 @@ sub ensure_cached {
 
                # NEF files aren't autodetected
                $fname = "NEF:$fname" if ($filename =~ /\.nef$/i);
-               $r->log->warn("Generating $fname for $filename");
                
                my $err = $magick->Read($fname);
                if ($err) {
@@ -438,9 +437,13 @@ sub make_infobox {
        }
 
        if (defined($info->{'Flash'})) {
-               if ($info->{'Flash'} =~ /did not fire/ || $info->{'Flash'} =~ /No Flash/) {
+               if ($info->{'Flash'} =~ /did not fire/i ||
+                   $info->{'Flash'} =~ /no flash/i ||
+                   $info->{'Flash'} =~ /not fired/i ||
+                   $info->{'Flash'} =~ /Off/)  {
                        push @lines, "No flash";
-               } elsif ($info->{'Flash'} =~ /fired/) {
+               } elsif ($info->{'Flash'} =~ /fired/i ||
+                        $info->{'Flash'} =~ /On/) {
                        push @lines, "Flash";
                } else {
                        push @lines, $info->{'Flash'};