]> git.sesse.net Git - pr0n/blobdiff - perl/Sesse/pr0n/Index.pm
Remove some really long-standing silliness: If we have no idea about width
[pr0n] / perl / Sesse / pr0n / Index.pm
index 2c93c7c55c93bd930d71828759558ca33fc608e3..74d5329d5cbc376207ae2e527b051c5202fa4f79 100644 (file)
@@ -199,7 +199,9 @@ sub handler {
 
                my @files = ();
                while (my $ref = $q->fetchrow_hashref()) {
-                       push @files, [ $ref->{'event'}, $ref->{'filename'}, $ref->{'width'}, $ref->{'height'} ];
+                       my $width = defined($ref->{'width'}) ? $ref->{'width'} : -1;
+                       my $height = defined($ref->{'height'}) ? $ref->{'height'} : -1;
+                       push @files, [ $ref->{'event'}, $ref->{'filename'}, $width, $height ];
                }
                
                for my $i (0..$#files) {
@@ -366,7 +368,7 @@ sub handler {
                                }
                        }
 
-                       if ($ref->{'width'} != -1 && $ref->{'height'} != -1) {
+                       if (defined($ref->{'width'}) && defined($ref->{'height'})) {
                                my $width = $ref->{'width'};
                                my $height = $ref->{'height'};