require Sesse::pr0n::Config_local;
};
- $VERSION = "v2.04";
+ $VERSION = "v2.05";
@ISA = qw(Exporter);
@EXPORT = qw(&error &dberror);
%EXPORT_TAGS = qw();
# update the last_picture cache as well (this should of course be done
# via a trigger, but this is less complicated :-) )
- $dbh->do('UPDATE events SET last_picture=(SELECT COALESCE(MAX(date),\'1970-01-01 00:00:00\') FROM images WHERE event=events.id) WHERE id=(SELECT event FROM images WHERE id=?)',
- undef, $id)
+ $dbh->do('UPDATE events SET last_picture=GREATEST(last_picture, ?) FROM images WHERE event=events.id) WHERE id=(SELECT event FROM images WHERE id=?)',
+ undef, $datetime, $id)
or die "Couldn't update last_picture in SQL: $!";
}
my ($r, $filename, $id, $dbwidth, $dbheight, $infobox, $xres, $yres, @otherres) = @_;
my $fname = get_disk_location($r, $id);
- unless (defined($xres) && ($xres < $dbheight || $yres < $dbwidth || $dbwidth == -1 || $dbheight == -1)) {
+ unless (defined($xres) && ($xres < $dbheight || $yres < $dbwidth || $dbwidth == -1 || $dbheight == -1 || $xres == -1)) {
return ($fname, 0);
}
$quality = 80;
}
- $cimg->Resize(width=>$nwidth, height=>$nheight, filter=>$filter);
+ if ($xres != -1) {
+ $cimg->Resize(width=>$nwidth, height=>$nheight, filter=>$filter);
+ }
- if (($nwidth >= 800 || $nheight >= 600) && $infobox == 1) {
+ if (($nwidth >= 800 || $nheight >= 600 || $xres == -1) && $infobox == 1) {
make_infobox($cimg, $info, $r);
}