$r->status(401);
$r->headers_out->{'www-authenticate'} = 'Basic realm="pr0n.sesse.net"';
- if ($options{'DigestAuth'} // 1) {
+ # Digest auth is disabled for now, due to various client problems.
+ if (0 && ($options{'DigestAuth'} // 1)) {
# We make our nonce similar to the scheme of RFC2069 section 2.1.1,
# with some changes: We don't care about client IP (these have a nasty
# tendency to change from request to request when load-balancing
# If we use ->[0] unconditionally, text rendering (!) seems to crash
my $img;
- if (ref($magick)) {
+ if (ref($magick) !~ /Image::Magick/) {
$img = $magick;
} else {
$img = (scalar @$magick > 1) ? $magick->[0] : $magick;
my $height = $img->Get('rows');
my ($nwidth, $nheight) = scale_aspect($width, $height, $xres, $yres);
- # Use lanczos (sharper) for heavy scaling, mitchell (faster) otherwise
- my $filter = 'Mitchell';
- my $quality = 90;
- my $sf = undef;
-
- if ($width / $nwidth > 8.0 || $height / $nheight > 8.0) {
- $filter = 'Lanczos';
- $quality = 85;
- $sf = "1x1";
- }
+ my $filter = 'Lanczos';
+ my $quality = 87;
+ my $sf = "1x1";
if ($xres != -1) {
$cimg->Resize(width=>$nwidth, height=>$nheight, filter=>$filter, 'sampling-factor'=>$sf);