]> git.sesse.net Git - pr0n/commitdiff
Treat empty lens/model as NULL. Doesn't actually appear to happen much in
authorSteinar H. Gunderson <sesse@debian.org>
Tue, 21 Aug 2007 05:18:29 +0000 (07:18 +0200)
committerSteinar H. Gunderson <sesse@debian.org>
Tue, 21 Aug 2007 05:18:29 +0000 (07:18 +0200)
practice.

perl/Sesse/pr0n/Common.pm

index eff6fc13ecb991196a64fb8ea695708f1cf6d66b..d2dcd7da04f61fe2e3347cce9223c380d324c57e 100644 (file)
@@ -265,9 +265,11 @@ sub update_image_info {
 
                $model =~ s/^\s*//;
                $model =~ s/\s*$//;
+               $model = undef if (length($model) == 0);
 
                $lens =~ s/^\s*//;
                $lens =~ s/\s*$//;
+               $lens = undef if (length($lens) == 0);
                
                # Now update the main table with the information we've got
                $dbh->do('UPDATE images SET width=?, height=?, date=?, model=?, lens=? WHERE id=?',